Skip to content

Commit

Permalink
Properly handle background color
Browse files Browse the repository at this point in the history
When background is not set or background is bright,
"unset" property "foreground". This fix solves bugs in
GTG LP#1034069 & LP#1033578
  • Loading branch information
izidormatusov committed Aug 15, 2012
1 parent ea696f7 commit 7af1f77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions liblarch_gtk/__init__.py
Expand Up @@ -344,10 +344,10 @@ def _celldatafunction(self, column, cell, model, myiter):

if isinstance(cell, gtk.CellRendererText):
if color is not None and brightness(color) < 0.5:
fg_color = '#FFFFFF'
cell.set_property("foreground", '#FFFFFF')
else:
fg_color = '#000000'
cell.set_property("foreground", fg_color)
# Otherwise unset foreground color
cell.set_property("foreground-set", False)

cell.set_property("cell-background", color)

Expand Down

0 comments on commit 7af1f77

Please sign in to comment.