fpdb.pyw: force bg_colour for inactive tab labels - workaround themes problem

This commit is contained in:
gimick 2011-03-06 23:51:21 +00:00
parent f0e046ac83
commit 8792b427de

View File

@ -187,6 +187,22 @@ class fpdb:
tabBox.pack_start(tabLabel, False)
eventBox.add(tabBox)
# fixme: force background state to fix problem where STATE_ACTIVE
# tab labels are black in some gtk themes, and therefore unreadable
# This behaviour is probably a bug in libwimp.dll or pygtk, but
# need to force background to avoid issues with menu labels being
# unreadable
#
# gtk.STATE_ACTIVE is a displayed, but not selected tab
# gtk.STATE_NORMAL is a displayed, selected, focussed tab
# gtk.STATE_INSENSITIVE is an inactive tab
# Insensitive/base is chosen as the background colour, because
# although not perfect, it seems to be the least instrusive.
baseNormStyle = eventBox.get_style().base[gtk.STATE_INSENSITIVE]
if baseNormStyle:
print baseNormStyle
eventBox.modify_bg(gtk.STATE_ACTIVE, gtk.gdk.color_parse(str(baseNormStyle)))
if nb.get_n_pages() > 0:
tabButton = gtk.Button()