[d-feet/correctly-honour-theme-foreground-colour-2] Correctly honour theme foreground colour
- From: Will Thompson <wjt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [d-feet/correctly-honour-theme-foreground-colour-2] Correctly honour theme foreground colour
- Date: Thu, 18 Oct 2018 14:53:00 +0000 (UTC)
commit 89c29b82d8fe53224dc791904c09e68e7c568b5e
Author: Will Thompson <will willthompson co uk>
Date: Thu Oct 18 15:48:53 2018 +0100
Correctly honour theme foreground colour
Rather than try to explicitly look up the colour, don't specify a colour
at all. Argument names are never nested within a <span> applying a
different foreground colour.
This does have one visible effect: with Adwaita (light), selecting the
treeview row causes method argument names to switch from black to white,
just like the method name. I think this is actually more readable (and
the green used for the signature is illegible against the blue
selected-row highlight.)
As discussed in https://gitlab.gnome.org/GNOME/d-feet/merge_requests/4#note_319094 and !8.
src/dfeet/introspection_helper.py | 20 ++------------------
1 file changed, 2 insertions(+), 18 deletions(-)
---
diff --git a/src/dfeet/introspection_helper.py b/src/dfeet/introspection_helper.py
index b718c1a..74789f5 100644
--- a/src/dfeet/introspection_helper.py
+++ b/src/dfeet/introspection_helper.py
@@ -1,31 +1,15 @@
# -*- coding: utf-8 -*-
-from gi.repository import GObject, Gio, Gtk
+from gi.repository import GObject, Gio
from dfeet import dbus_utils
-_style_context = None
-_fg_color = "#000000"
-
-
-def fg_color():
- global _style_context, _fg_color
- if _style_context is None:
- _style_context = Gtk.StyleContext()
- color = _style_context.get_color(Gtk.StateFlags.NORMAL)
- _fg_color = "#%02x%02x%02x" % (
- int(color.red) * 255,
- int(color.green) * 255,
- int(color.blue) * 255,
- )
- return _fg_color
-
def args_signature_markup(arg_signature):
return '<small><span foreground="#2E8B57">%s</span></small>' % (arg_signature)
def args_name_markup(arg_name):
- return '<small><span foreground="%s">%s</span></small>' % (fg_color(), arg_name)
+ return '<small>%s</small>' % (arg_name,)
class DBusNode(GObject.GObject):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]