by
Changes to one file · Browse files at a18e920a0559 Showing diff from parent 908c9cdac39e a6e409b31fdb Diff from another changeset...
@@ -199,6 +199,16 @@ ( 1.0, 0.0, 1.0 ),
]
+def get_gtk_colors():
+ color_scheme = gtk.settings_get_default().get_property('gtk-color-scheme')
+ colors = {}
+ for color in color_scheme.split('\n'):
+ color = color.strip()
+ if color:
+ name, color = color.split(':')
+ colors[name.strip()] = gtk.gdk.color_parse(color.strip())
+ return colors
+
def get_gtk_text_color():
w = gtk.Window()
w.realize()
@@ -207,7 +217,11 @@
def is_dark_theme():
global NORMAL, MAINLINE_COLOR
- normal = gtk.gdk.color_parse(get_gtk_text_color())
+ if gtk.pygtk_version < (2, 12, 0):
+ gtk_colors = get_gtk_colors()
+ normal = gtk_colors.get('fg_color', gtk.gdk.color_parse('black'))
+ else:
+ normal = gtk.gdk.color_parse(get_gtk_text_color())
NORMAL = str(normal)
MAINLINE_COLOR = (
normal.red / 65535.0,
|
Loading...