diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index b5501e35..c6d318a2 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -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()