From 2b36054a5d311cbf8dbffe2cf01df3d43c6209bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Tue, 25 Mar 2014 17:25:47 +0000 Subject: [PATCH] W32: Fix double-arrowed combobox button The arrow is part of the background image drawn by the theme, don't draw GTK's own arrow. This also applies to non-entry comboboxes. On XP the arrow-and-nothing-else part does not exist (W32 XP theme draws a white rectangle) and has to be subtituted for a simple dropdown button even for non-entry comboboxes. https://bugzilla.gnome.org/show_bug.cgi?id=727035 --- gtk/resources/theme/gtk-win32-base.css | 35 ++++++++++++++++++++++++++ gtk/resources/theme/gtk-win32-xp.css | 10 ++++++++ 2 files changed, 45 insertions(+) diff --git a/gtk/resources/theme/gtk-win32-base.css b/gtk/resources/theme/gtk-win32-base.css index a845769cc4..a76c994830 100644 --- a/gtk/resources/theme/gtk-win32-base.css +++ b/gtk/resources/theme/gtk-win32-base.css @@ -744,6 +744,41 @@ GtkComboBox .separator { -GtkWidget-vertical-separator: 0; } +/* Draw "arrow" for non-entry comboboxes. Select the box, since selecting + the arrow itself does not seem to work as intended. */ +GtkComboBox GtkBox { + color: rgba(255, 0, 0, 0); + background-image: -gtk-win32-theme-part(combobox, 6 1); +} +GtkComboBox GtkBox:insensitive { + color: rgba(255, 0, 0, 0); + background-image: -gtk-win32-theme-part(combobox, 6 4); +} +/* Make sure the style above does not touch comboboxes with entries by + disabling background image for the box again */ +GtkComboBox.combobox-entry GtkBox { + color: rgba(255, 0, 0, 0); + background-image: none; +} +GtkComboBox.combobox-entry GtkBox:insensitive { + color: rgba(255, 0, 0, 0); + background-image: none; +} +/* The arrow is part of the background image drawn by the theme, don't draw GTK's own arrow */ +GtkComboBox.combobox-entry GtkArrow { + color: rgba(255, 0, 0, 0); +} +GtkComboBox.combobox-entry GtkArrow:insensitive { + color: rgba(255, 0, 0, 0); +} +GtkComboBox GtkArrow { + color: rgba(255, 0, 0, 0); +} +GtkComboBox GtkArrow:insensitive { + color: rgba(255, 0, 0, 0); +} + + /* Notebook */ .notebook { diff --git a/gtk/resources/theme/gtk-win32-xp.css b/gtk/resources/theme/gtk-win32-xp.css index 70ee8628d5..c1788a22b0 100644 --- a/gtk/resources/theme/gtk-win32-xp.css +++ b/gtk/resources/theme/gtk-win32-xp.css @@ -1,5 +1,15 @@ @import url("gtk-win32-base.css"); +/* Override non-entry combobox arrow parts from the base theme, + since XP draws an empty white rectangle for parts 6 1 and 6 4. + Draw parts 1 1 and 1 4 instead */ +GtkComboBox GtkBox { + background-image: -gtk-win32-theme-part(combobox, 1 1, margins (1 0 1 0)); +} +GtkComboBox GtkBox:insensitive { + background-image: -gtk-win32-theme-part(combobox, 1 4, margins (1 0 1 0)); +} + .menubar { background-color: #f7f7f7; /*background-color: -gtk-win32-color(button, 30);*/