1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# HG changeset patch
# User Martin Stransky <stransky@redhat.com>
# Parent f986e55c4e0b41c6b50bd74d287614b564d7895f
Bug 1169233 - Get grey (inactive) text color from menu labels, r=?karlt
diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp
--- a/widget/gtk/nsLookAndFeel.cpp
+++ b/widget/gtk/nsLookAndFeel.cpp
@@ -237,20 +237,18 @@ nsLookAndFeel::NativeGetColor(ColorID aI
case eColorID_inactiveborder:
// inactive window border
gtk_style_context_get_border_color(mBackgroundStyle,
GTK_STATE_FLAG_INSENSITIVE,
&gdk_color);
aColor = GDK_RGBA_TO_NS_RGBA(gdk_color);
break;
case eColorID_graytext: // disabled text in windows, menus, etc.
- case eColorID_inactivecaptiontext: // text in inactive window caption
- gtk_style_context_get_color(mBackgroundStyle,
- GTK_STATE_FLAG_INSENSITIVE, &gdk_color);
- aColor = GDK_RGBA_TO_NS_RGBA(gdk_color);
+ case eColorID_inactivecaptiontext: // text in inactive window caption
+ aColor = sMenuTextInactive;
break;
case eColorID_inactivecaption:
// inactive window caption
gtk_style_context_get_background_color(mBackgroundStyle,
GTK_STATE_FLAG_INSENSITIVE,
&gdk_color);
aColor = GDK_RGBA_TO_NS_RGBA(gdk_color);
break;
@@ -1023,16 +1021,18 @@ nsLookAndFeel::Init()
g_object_ref_sink(menu);
gtk_container_add(GTK_CONTAINER(menuitem), accel_label);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
style = gtk_widget_get_style_context(accel_label);
gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color);
sMenuText = GDK_RGBA_TO_NS_RGBA(color);
+ gtk_style_context_get_color(style, GTK_STATE_FLAG_INSENSITIVE, &color);
+ sMenuTextInactive = GDK_RGBA_TO_NS_RGBA(color);
style = gtk_widget_get_style_context(menu);
gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL, &color);
sMenuBackground = GDK_RGBA_TO_NS_RGBA(color);
style = gtk_widget_get_style_context(menuitem);
gtk_style_context_get_background_color(style, GTK_STATE_FLAG_PRELIGHT, &color);
sMenuHover = GDK_RGBA_TO_NS_RGBA(color);
diff --git a/widget/gtk/nsLookAndFeel.h b/widget/gtk/nsLookAndFeel.h
--- a/widget/gtk/nsLookAndFeel.h
+++ b/widget/gtk/nsLookAndFeel.h
@@ -54,16 +54,17 @@ protected:
// Cached colors
nscolor sInfoBackground;
nscolor sInfoText;
nscolor sMenuBackground;
nscolor sMenuBarText;
nscolor sMenuBarHoverText;
nscolor sMenuText;
+ nscolor sMenuTextInactive;
nscolor sMenuHover;
nscolor sMenuHoverText;
nscolor sButtonText;
nscolor sButtonHoverText;
nscolor sButtonBackground;
nscolor sFrameOuterLightBorder;
nscolor sFrameInnerDarkBorder;
nscolor sOddCellBackground;
|