Commit 34f0cc36 authored by Ell's avatar Ell

tools: in performance-log-viewer.py, fix percentage cell renderer

(cherry picked from commit 27dc9b815da79203a9f7edf2dfcb2526a490360a)
parent 728534d4
......@@ -2245,17 +2245,17 @@ class CellRendererPercentage (Gtk.CellRendererText):
Gtk.CellRendererText.do_render (self,
cr, widget,
background_area, cell_area,
Gtk.CellRendererState (
flags |
Gtk.CellRendererState.SELECTED
))
flags)
value = min (max (self.value, 0), 1)
width = round (full_width * value)
height = full_height
if width > 0 and height > 0:
state = Gtk.StateFlags (state | Gtk.StateFlags.SELECTED)
state = Gtk.StateFlags (state |
Gtk.StateFlags.SELECTED)
flags = Gtk.CellRendererState (flags |
Gtk.CellRendererState.SELECTED)
style.save ()
style.set_state (state)
......@@ -2278,10 +2278,7 @@ class CellRendererPercentage (Gtk.CellRendererText):
Gtk.CellRendererText.do_render (self,
cr, widget,
background_area, cell_area,
Gtk.CellRendererState (
flags |
Gtk.CellRendererState.SELECTED
))
flags)
style.restore ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment