mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 02:45:35 +00:00
Also draw vertical help lines
This commit is contained in:
parent
9619daa316
commit
b1085b3b4d
2 changed files with 15 additions and 2 deletions
|
@ -231,7 +231,6 @@ class FilteredLogModel (LogModelBase):
|
|||
|
||||
self.parent_model = lazy_log_model
|
||||
self.ensure_cached = lazy_log_model.ensure_cached
|
||||
|
||||
self.line_cache = lazy_log_model.line_cache
|
||||
|
||||
self.line_offsets += lazy_log_model.line_offsets
|
||||
|
|
|
@ -145,6 +145,12 @@ class LineFrequencyWidget (gtk.DrawingArea):
|
|||
ctx.rectangle (position1, 0, line_width, h)
|
||||
ctx.fill ()
|
||||
|
||||
def find_indicative_time_step (self):
|
||||
|
||||
MINIMUM_PIXEL_STEP = 32
|
||||
time_per_pixel = self.sentinel_step
|
||||
return 32 # FIXME use self.sentinel_step and len (self.sentinel_data)
|
||||
|
||||
def __draw (self, drawable):
|
||||
|
||||
ctx = drawable.cairo_create ()
|
||||
|
@ -156,13 +162,21 @@ class LineFrequencyWidget (gtk.DrawingArea):
|
|||
ctx.new_path ()
|
||||
|
||||
ctx.set_line_width (1.)
|
||||
ctx.set_source_rgb (.96, .96, .96)
|
||||
ctx.set_source_rgb (.95, .95, .95)
|
||||
for i in range (h // 16):
|
||||
y = i * 16 - .5
|
||||
ctx.move_to (0, y)
|
||||
ctx.line_to (w, y)
|
||||
ctx.stroke ()
|
||||
|
||||
pixel_step = self.find_indicative_time_step ()
|
||||
ctx.set_source_rgb (.9, .9, .9)
|
||||
for i in range (w // pixel_step):
|
||||
x = i * pixel_step - .5
|
||||
ctx.move_to (x, 0)
|
||||
ctx.line_to (x, h)
|
||||
ctx.stroke ()
|
||||
|
||||
if self.sentinel_data is None and self.sentinel:
|
||||
if w > 15:
|
||||
self.logger.debug ("running sentinel for width %i", w)
|
||||
|
|
Loading…
Reference in a new issue