[gnome-themes-standard] gtk2: make it possible to override GtkEntry's backgrounds
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-themes-standard] gtk2: make it possible to override GtkEntry's backgrounds
- Date: Fri, 25 Jan 2013 20:23:46 +0000 (UTC)
commit 12596e2cd0585db73af54d4180065e001d01e67f
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri Jan 25 14:34:14 2013 -0500
gtk2: make it possible to override GtkEntry's backgrounds
Some GTK2 applications like to override GtkEntry's background with their
own color for e.g. showing an error state.
Since we currently draw an asset for the entry's background, this
doesn't work.
To support this use case, always use the background color from the style
with no overrides, and put an overlay on top of it to get the same
gradient we used to get.
In addition, entry borders cannot be transparent anymore now, so we have
to provide two versions - a normal one and one that works on notebooks,
to avoid the base shining through the corners.
This also bumps the GTK2 required version to 2.24.15, which has a fix
that makes this possible.
https://bugzilla.gnome.org/show_bug.cgi?id=685712
configure.ac | 3 +-
.../gtk-2.0/Entry/combo-entry-border-active-bg.png | Bin 0 -> 299 bytes
.../Entry/combo-entry-border-active-notebook.png | Bin 0 -> 290 bytes
.../Entry/combo-entry-border-active-rtl-bg.png | Bin 0 -> 325 bytes
.../combo-entry-border-active-rtl-notebook.png | Bin 0 -> 302 bytes
.../gtk-2.0/Entry/combo-entry-border-bg.png | Bin 0 -> 307 bytes
.../Entry/combo-entry-border-disabled-bg.png | Bin 0 -> 275 bytes
.../Entry/combo-entry-border-disabled-notebook.png | Bin 0 -> 263 bytes
.../Entry/combo-entry-border-disabled-rtl-bg.png | Bin 0 -> 295 bytes
.../combo-entry-border-disabled-rtl-notebook.png | Bin 0 -> 280 bytes
.../gtk-2.0/Entry/combo-entry-border-notebook.png | Bin 0 -> 304 bytes
.../gtk-2.0/Entry/combo-entry-border-rtl-bg.png | Bin 0 -> 328 bytes
.../Entry/combo-entry-border-rtl-notebook.png | Bin 0 -> 308 bytes
themes/Adwaita/gtk-2.0/Entry/entry-bg-disabled.png | Bin 155 -> 0 bytes
themes/Adwaita/gtk-2.0/Entry/entry-bg.png | Bin 162 -> 0 bytes
.../gtk-2.0/Entry/entry-border-active-bg.png | Bin 0 -> 402 bytes
.../gtk-2.0/Entry/entry-border-active-notebook.png | Bin 0 -> 377 bytes
.../Adwaita/gtk-2.0/Entry/entry-border-active.png | Bin 455 -> 0 bytes
themes/Adwaita/gtk-2.0/Entry/entry-border-bg.png | Bin 0 -> 406 bytes
.../gtk-2.0/Entry/entry-border-disabled-bg.png | Bin 0 -> 353 bytes
.../Entry/entry-border-disabled-notebook.png | Bin 0 -> 331 bytes
.../gtk-2.0/Entry/entry-border-disabled.png | Bin 405 -> 0 bytes
themes/Adwaita/gtk-2.0/Entry/entry-border-fill.png | Bin 0 -> 179 bytes
.../gtk-2.0/Entry/entry-border-notebook.png | Bin 0 -> 393 bytes
themes/Adwaita/gtk-2.0/Entry/entry-border.png | Bin 462 -> 0 bytes
themes/Adwaita/gtk-2.0/Makefile.am | 30 ++--
themes/Adwaita/gtk-2.0/gtkrc | 182 ++++++++++++++-----
27 files changed, 155 insertions(+), 60 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1733453..89e7698 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,8 +59,9 @@ AC_MSG_CHECKING([building gtk2 engine])
AM_CONDITIONAL(GTK2_ENGINE, test "x$enable_gtk2_engine" = "xyes")
AC_MSG_RESULT([$enable_gtk2_engine])
+GTK2_VERSION_REQUIRED=2.24.15
if test "x$enable_gtk2_engine" = "xyes"; then
- PKG_CHECK_MODULES([GTK2_ENGINE], [gtk+-2.0 gdk-2.0])
+ PKG_CHECK_MODULES([GTK2_ENGINE], [gtk+-2.0 >= $GTK2_VERSION_REQUIRED gdk-2.0 >= $GTK2_VERSION_REQUIRED])
fi
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-bg.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-bg.png
new file mode 100644
index 0000000..bf41b04
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-bg.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-notebook.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-notebook.png
new file mode 100644
index 0000000..1eba7fe
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-notebook.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-rtl-bg.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-rtl-bg.png
new file mode 100644
index 0000000..aba98bc
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-rtl-bg.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-rtl-notebook.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-rtl-notebook.png
new file mode 100644
index 0000000..1ad5f65
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-active-rtl-notebook.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-bg.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-bg.png
new file mode 100644
index 0000000..3235336
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-bg.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-bg.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-bg.png
new file mode 100644
index 0000000..b5fc666
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-bg.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-notebook.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-notebook.png
new file mode 100644
index 0000000..bd768dd
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-notebook.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-rtl-bg.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-rtl-bg.png
new file mode 100644
index 0000000..aef4a29
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-rtl-bg.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-rtl-notebook.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-rtl-notebook.png
new file mode 100644
index 0000000..45eee33
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-disabled-rtl-notebook.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-notebook.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-notebook.png
new file mode 100644
index 0000000..b8e1ad4
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-notebook.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-rtl-bg.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-rtl-bg.png
new file mode 100644
index 0000000..99e5818
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-rtl-bg.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-rtl-notebook.png b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-rtl-notebook.png
new file mode 100644
index 0000000..8e7d0c0
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/combo-entry-border-rtl-notebook.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/entry-border-active-bg.png b/themes/Adwaita/gtk-2.0/Entry/entry-border-active-bg.png
new file mode 100644
index 0000000..85839b5
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/entry-border-active-bg.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/entry-border-active-notebook.png b/themes/Adwaita/gtk-2.0/Entry/entry-border-active-notebook.png
new file mode 100644
index 0000000..358a5c7
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/entry-border-active-notebook.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/entry-border-bg.png b/themes/Adwaita/gtk-2.0/Entry/entry-border-bg.png
new file mode 100644
index 0000000..4fd41cd
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/entry-border-bg.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/entry-border-disabled-bg.png b/themes/Adwaita/gtk-2.0/Entry/entry-border-disabled-bg.png
new file mode 100644
index 0000000..e16b8dd
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/entry-border-disabled-bg.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/entry-border-disabled-notebook.png b/themes/Adwaita/gtk-2.0/Entry/entry-border-disabled-notebook.png
new file mode 100644
index 0000000..0c14042
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/entry-border-disabled-notebook.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/entry-border-fill.png b/themes/Adwaita/gtk-2.0/Entry/entry-border-fill.png
new file mode 100644
index 0000000..e28e815
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/entry-border-fill.png differ
diff --git a/themes/Adwaita/gtk-2.0/Entry/entry-border-notebook.png b/themes/Adwaita/gtk-2.0/Entry/entry-border-notebook.png
new file mode 100644
index 0000000..c831b2b
Binary files /dev/null and b/themes/Adwaita/gtk-2.0/Entry/entry-border-notebook.png differ
diff --git a/themes/Adwaita/gtk-2.0/Makefile.am b/themes/Adwaita/gtk-2.0/Makefile.am
index 94e2e94..0872a60 100644
--- a/themes/Adwaita/gtk-2.0/Makefile.am
+++ b/themes/Adwaita/gtk-2.0/Makefile.am
@@ -53,23 +53,31 @@ asset_data = \
Check-Radio/option-unchecked.png \
Check-Radio/option-checked-insensitive.png \
Check-Radio/option-unchecked-insensitive.png \
- Entry/combo-entry-border.png \
- Entry/combo-entry-border-rtl.png \
- Entry/combo-entry-border-active.png \
- Entry/combo-entry-border-active-rtl.png \
- Entry/combo-entry-border-disabled.png \
- Entry/combo-entry-border-disabled-rtl.png \
+ Entry/combo-entry-border-bg.png \
+ Entry/combo-entry-border-rtl-bg.png \
+ Entry/combo-entry-border-active-bg.png \
+ Entry/combo-entry-border-active-rtl-bg.png \
+ Entry/combo-entry-border-disabled-bg.png \
+ Entry/combo-entry-border-disabled-rtl-bg.png \
+ Entry/combo-entry-border-notebook.png \
+ Entry/combo-entry-border-rtl-notebook.png \
+ Entry/combo-entry-border-active-notebook.png \
+ Entry/combo-entry-border-active-rtl-notebook.png \
+ Entry/combo-entry-border-disabled-notebook.png \
+ Entry/combo-entry-border-disabled-rtl-notebook.png \
Entry/combo-entry-button.png \
Entry/combo-entry-button-rtl.png \
Entry/combo-entry-button-active.png \
Entry/combo-entry-button-active-rtl.png \
Entry/combo-entry-button-disabled.png \
Entry/combo-entry-button-disabled-rtl.png \
- Entry/entry-border.png \
- Entry/entry-border-active.png \
- Entry/entry-border-disabled.png \
- Entry/entry-bg.png \
- Entry/entry-bg-disabled.png \
+ Entry/entry-border-fill.png \
+ Entry/entry-border-bg.png \
+ Entry/entry-border-active-bg.png \
+ Entry/entry-border-disabled-bg.png \
+ Entry/entry-border-notebook.png \
+ Entry/entry-border-active-notebook.png \
+ Entry/entry-border-disabled-notebook.png \
Expanders/minus.png \
Expanders/plus.png \
Handles/handle-h.png \
diff --git a/themes/Adwaita/gtk-2.0/gtkrc b/themes/Adwaita/gtk-2.0/gtkrc
index 875c9df..d82359e 100755
--- a/themes/Adwaita/gtk-2.0/gtkrc
+++ b/themes/Adwaita/gtk-2.0/gtkrc
@@ -1,6 +1,6 @@
# Bridge | ScionicSpectre
-gtk-color-scheme = "base_color:#FFFFFF\nfg_color:#000000\ntooltip_fg_color:#FFFFFF\nselected_bg_color:#4A90D9\nselected_fg_color:#FFFFFF\ntext_color:#313739\nbg_color:#EDEDED\ntooltip_bg_color:#343434"
+gtk-color-scheme = "base_color:#FFFFFF\nfg_color:#000000\ntooltip_fg_color:#FFFFFF\nselected_bg_color:#4A90D9\nselected_fg_color:#FFFFFF\ntext_color:#313739\nbg_color:#EDEDED\ninsensitive_bg_color:#F4F4F2\ntooltip_bg_color:#343434"
gtk-auto-mnemonics = 1
gtk-primary-button-warps-slider = 1
@@ -1021,7 +1021,8 @@ style "entry"
xthickness = 3
ythickness = 4
- base[NORMAL] = @bg_color
+ base[NORMAL] = @base_color
+ base[INSENSITIVE] = @insensitive_bg_color
engine "pixmap"
{
@@ -1031,7 +1032,7 @@ style "entry"
detail = "entry"
state = NORMAL
shadow = IN
- file = "Entry/entry-border.png"
+ file = "Entry/entry-border-bg.png"
border = { 4, 4, 4, 4 }
stretch = TRUE
}
@@ -1041,7 +1042,7 @@ style "entry"
detail = "entry"
state = INSENSITIVE
shadow = IN
- file = "Entry/entry-border-disabled.png"
+ file = "Entry/entry-border-disabled-bg.png"
border = { 4, 4, 4, 4 }
stretch = TRUE
}
@@ -1050,7 +1051,7 @@ style "entry"
function = SHADOW
detail = "entry"
state = ACTIVE
- file = "Entry/entry-border-active.png"
+ file = "Entry/entry-border-active-bg.png"
border = { 4, 4, 4, 4 }
stretch = TRUE
}
@@ -1059,41 +1060,56 @@ style "entry"
function = FLAT_BOX
detail = "entry_bg"
state = NORMAL
- file = "Entry/entry-bg.png"
- border = { 0, 0, 0, 0 }
- stretch = TRUE
+ overlay_file = "Entry/entry-border-fill.png"
+ overlay_border = { 0, 0, 0, 0 }
+ overlay_stretch = TRUE
}
image
{
function = FLAT_BOX
detail = "entry_bg"
state = ACTIVE
- file = "Entry/entry-bg.png"
- border = { 0, 0, 0, 0 }
- stretch = TRUE
- }
- image
- {
- function = FLAT_BOX
- detail = "entry_bg"
- state = INSENSITIVE
- file = "Entry/entry-bg-disabled.png"
- border = { 0, 0, 0, 0 }
- stretch = TRUE
+ overlay_file = "Entry/entry-border-fill.png"
+ overlay_border = { 0, 0, 0, 0 }
+ overlay_stretch = TRUE
}
}
}
style "notebook_entry"
{
- base[NORMAL] = @base_color
- base[INSENSITIVE] = @base_color
-}
-
-style "notebook_spinbutton"
-{
- # this also inherits "notebook_entry" above
- bg[NORMAL] = @base_color
+ engine "pixmap"
+ {
+ image
+ {
+ function = SHADOW
+ detail = "entry"
+ state = NORMAL
+ shadow = IN
+ file = "Entry/entry-border-notebook.png"
+ border = { 4, 4, 4, 4 }
+ stretch = TRUE
+ }
+ image
+ {
+ function = SHADOW
+ detail = "entry"
+ state = INSENSITIVE
+ shadow = IN
+ file = "Entry/entry-border-disabled-notebook.png"
+ border = { 4, 4, 4, 4 }
+ stretch = TRUE
+ }
+ image
+ {
+ function = SHADOW
+ detail = "entry"
+ state = ACTIVE
+ file = "Entry/entry-border-active-notebook.png"
+ border = { 4, 4, 4, 4 }
+ stretch = TRUE
+ }
+ }
}
style "notebook_tab_label"
@@ -1115,7 +1131,7 @@ style "combobox_entry"
detail = "entry"
state = NORMAL
shadow = IN
- file = "Entry/combo-entry-border.png"
+ file = "Entry/combo-entry-border-bg.png"
border = { 4, 4, 5, 4 }
stretch = TRUE
direction = LTR
@@ -1126,7 +1142,7 @@ style "combobox_entry"
detail = "entry"
state = INSENSITIVE
shadow = IN
- file = "Entry/combo-entry-border-disabled.png"
+ file = "Entry/combo-entry-border-disabled-bg.png"
border = { 4, 4, 5, 4 }
stretch = TRUE
direction = LTR
@@ -1136,7 +1152,7 @@ style "combobox_entry"
function = SHADOW
detail = "entry"
state = ACTIVE
- file = "Entry/combo-entry-border-active.png"
+ file = "Entry/combo-entry-border-active-bg.png"
border = { 4, 4, 5, 4 }
stretch = TRUE
direction = LTR
@@ -1149,7 +1165,7 @@ style "combobox_entry"
detail = "entry"
state = NORMAL
shadow = IN
- file = "Entry/combo-entry-border-rtl.png"
+ file = "Entry/combo-entry-border-rtl-bg.png"
border = { 4, 4, 5, 4 }
stretch = TRUE
direction = RTL
@@ -1160,7 +1176,7 @@ style "combobox_entry"
detail = "entry"
state = INSENSITIVE
shadow = IN
- file = "Entry/combo-entry-border-disabled-rtl.png"
+ file = "Entry/combo-entry-border-disabled-rtl-bg.png"
border = { 4, 4, 5, 4 }
stretch = TRUE
direction = RTL
@@ -1170,7 +1186,81 @@ style "combobox_entry"
function = SHADOW
detail = "entry"
state = ACTIVE
- file = "Entry/combo-entry-border-active-rtl.png"
+ file = "Entry/combo-entry-border-active-rtl-bg.png"
+ border = { 4, 4, 5, 4 }
+ stretch = TRUE
+ direction = RTL
+ }
+ }
+}
+
+style "notebook_combobox_entry"
+{
+ engine "pixmap"
+ {
+ # LTR version
+ image
+ {
+ function = SHADOW
+ detail = "entry"
+ state = NORMAL
+ shadow = IN
+ file = "Entry/combo-entry-border-notebook.png"
+ border = { 4, 4, 5, 4 }
+ stretch = TRUE
+ direction = LTR
+ }
+ image
+ {
+ function = SHADOW
+ detail = "entry"
+ state = INSENSITIVE
+ shadow = IN
+ file = "Entry/combo-entry-border-disabled-notebook.png"
+ border = { 4, 4, 5, 4 }
+ stretch = TRUE
+ direction = LTR
+ }
+ image
+ {
+ function = SHADOW
+ detail = "entry"
+ state = ACTIVE
+ file = "Entry/combo-entry-border-active-notebook.png"
+ border = { 4, 4, 5, 4 }
+ stretch = TRUE
+ direction = LTR
+ }
+
+ # RTL version
+ image
+ {
+ function = SHADOW
+ detail = "entry"
+ state = NORMAL
+ shadow = IN
+ file = "Entry/combo-entry-border-rtl-notebook.png"
+ border = { 4, 4, 5, 4 }
+ stretch = TRUE
+ direction = RTL
+ }
+ image
+ {
+ function = SHADOW
+ detail = "entry"
+ state = INSENSITIVE
+ shadow = IN
+ file = "Entry/combo-entry-border-disabled-rtl-notebook.png"
+ border = { 4, 4, 5, 4 }
+ stretch = TRUE
+ direction = RTL
+ }
+ image
+ {
+ function = SHADOW
+ detail = "entry"
+ state = ACTIVE
+ file = "Entry/combo-entry-border-active-rtl-notebook.png"
border = { 4, 4, 5, 4 }
stretch = TRUE
direction = RTL
@@ -1488,22 +1578,17 @@ style "gimp_spin_scale"
{
image
{
- function = FLAT_BOX
- detail = "entry_bg"
- state = NORMAL
+ function = FLAT_BOX
+ detail = "entry_bg"
+ state = NORMAL
}
image
{
- function = FLAT_BOX
- detail = "entry_bg"
- state = ACTIVE
- }
- image
- {
- function = FLAT_BOX
- detail = "entry_bg"
- state = INSENSITIVE
+ function = FLAT_BOX
+ detail = "entry_bg"
+ state = ACTIVE
}
+
image
{
function = BOX
@@ -2114,9 +2199,10 @@ widget_class "*<GtkNotebook>*<GtkScrolledWindow>*<GtkViewport>" style "notebook
# Entries in notebooks draw with notebook's base color, but not if there's
# something else in the middle that draws gray again
widget_class "*<GtkNotebook>*<GtkEntry>" style "notebook_entry"
-widget_class "*<GtkNotebook>*<GtkSpinButton>" style "notebook_spinbutton"
widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkEntry>" style "entry"
-widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkSpinButton>" style "spinbutton"
+
+widget_class "*<GtkNotebook>*<GtkComboBoxEntry>*<GtkEntry>" style "notebook_combobox_entry"
+widget_class "*<GtkNotebook>*<GtkEventBox>*<GtkComoBoxEntry>*<GtkEntry>" style "combobox_entry"
# We also need to avoid changing fg color for the inactive notebook tab labels
widget_class "*<GtkNotebook>.<GtkLabel>" style "notebook_tab_label"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]