Mercurial > MadButterfly
comparison pyink/frameline.py @ 950:1bb0780f1036
Add more border line to frameline and frameruler
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Wed, 17 Nov 2010 02:29:47 +0800 |
parents | c9bf47cc621f |
children | e06a8d90592c |
comparison
equal
deleted
inserted
replaced
949:c9bf47cc621f | 950:1bb0780f1036 |
---|---|
70 mark_h = w_h / 10 | 70 mark_h = w_h / 10 |
71 for i in range(self._num_frames): | 71 for i in range(self._num_frames): |
72 mark_x = (i + 1) * self._frame_width | 72 mark_x = (i + 1) * self._frame_width |
73 win.draw_line(gc, mark_x, 0, mark_x, mark_h) | 73 win.draw_line(gc, mark_x, 0, mark_x, mark_h) |
74 win.draw_line(gc, mark_x, w_h - mark_h - 1, mark_x, w_h - 1) | 74 win.draw_line(gc, mark_x, w_h - mark_h - 1, mark_x, w_h - 1) |
75 if (i % 5) == 4: | 75 pass |
76 pass | 76 |
77 pass | 77 win.draw_line(gc, 0, w_h - 1, w_w, w_h -1) |
78 | 78 |
79 # | 79 # |
80 # Set color of frame number | 80 # Set color of frame number |
81 # | 81 # |
82 color_rgb = color_to_rgb(self._number_color) | 82 color_rgb = color_to_rgb(self._number_color) |
198 win.draw_line(gc, next_f_x, 0, next_f_x, w_h) | 198 win.draw_line(gc, next_f_x, 0, next_f_x, w_h) |
199 pass | 199 pass |
200 | 200 |
201 def _draw_frames(self): | 201 def _draw_frames(self): |
202 win = self.window | 202 win = self.window |
203 w_x, w_y, w_w, w_h, depth = win.get_geometry() | |
203 gc = gtk.gdk.GC(win) | 204 gc = gtk.gdk.GC(win) |
204 self._gc = gc | 205 self._gc = gc |
205 | 206 |
206 i = 0 | 207 i = 0 |
207 key_i = 0 | 208 key_i = 0 |
235 else: | 236 else: |
236 self._draw_frame(i) | 237 self._draw_frame(i) |
237 i = i + 1 | 238 i = i + 1 |
238 pass | 239 pass |
239 pass | 240 pass |
241 | |
242 border_rgb = color_to_rgb(self._normal_border) | |
243 border_color = gtk.gdk.Color(*border_rgb) | |
244 gc.set_rgb_fg_color(border_color) | |
245 stop_x = num_frames * self._frame_width | |
246 win.draw_line(gc, 0, w_h - 1, stop_x, w_h - 1) | |
240 pass | 247 pass |
241 | 248 |
242 def _draw_keyframes(self): | 249 def _draw_keyframes(self): |
243 win = self.window | 250 win = self.window |
244 w_x, w_y, w_w, w_h, depth = win.get_geometry() | 251 w_x, w_y, w_w, w_h, depth = win.get_geometry() |
274 line_x1 = idx * self._frame_width | 281 line_x1 = idx * self._frame_width |
275 line_x2 = line_x1 + self._frame_width | 282 line_x2 = line_x1 + self._frame_width |
276 | 283 |
277 win.draw_line(gc, line_x1, 0, line_x1, w_h) | 284 win.draw_line(gc, line_x1, 0, line_x1, w_h) |
278 win.draw_line(gc, line_x2, 0, line_x2, w_h) | 285 win.draw_line(gc, line_x2, 0, line_x2, w_h) |
286 win.draw_line(gc, line_x1, w_h - 1, line_x2, w_h - 1) | |
287 win.draw_line(gc, line_x1, 0, line_x2, 0) | |
279 pass | 288 pass |
280 | 289 |
281 def update(self): | 290 def update(self): |
282 win = self.window | 291 win = self.window |
283 x, y, w, h, depth = win.get_geometry() | 292 x, y, w, h, depth = win.get_geometry() |