[gtk+] Fix W32 theme for spinbuttons



commit ce9437daf56d787592470a8bc15739b2e059bc80
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Tue Mar 25 15:47:56 2014 +0000

    Fix W32 theme for spinbuttons
    
    It seems that the dec-button no longer has a "bottom" selector-thingy to
    select for. Use "last-child" instead.
    Use .vertical to style vertical instance differently, as last-child/first-child
    meaning is inverted there.
    Increase (towards 0) margins a bit, to avoid clipping the pre-light rectangle.
    Use dir(rtl) selector to style horizontal instance differently for RTL locales,
    where first-child is "inc".
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727022

 gtk/resources/theme/gtk-win32-base.css |  122 +++++++++++++++++++++++++++----
 1 files changed, 106 insertions(+), 16 deletions(-)
---
diff --git a/gtk/resources/theme/gtk-win32-base.css b/gtk/resources/theme/gtk-win32-base.css
index b8474ca..a845769 100644
--- a/gtk/resources/theme/gtk-win32-base.css
+++ b/gtk/resources/theme/gtk-win32-base.css
@@ -376,51 +376,141 @@ GtkButton.check:active:prelight {
 .spinbutton .button,
 .spinbutton .button:focused {
     background-color: transparent;
-    background-image: -gtk-win32-theme-part(spin, 1 1, margins(-1 -1 0 -1));
+    background-image: -gtk-win32-theme-part(spin, 2 1, margins(0 -1 -1 -1));
     color: rgba(0, 0, 0, 0);
 }
 
-.spinbutton .button:last-child {
-    background-image: -gtk-win32-theme-part(spin, 1 1, margins(-1 -1 0 -2));
+.spinbutton .button:last-child,
+.spinbutton .button:focused:last-child {
+    background-image: -gtk-win32-theme-part(spin, 1 1, margins(-1 -1 0 -1));
 }
 
 .spinbutton .button:prelight,
 .spinbutton .button:prelight:focused {
+    background-image: -gtk-win32-theme-part(spin, 2 2, margins(0 -1 -1 -1));
+}
+
+.spinbutton .button:prelight:last-child,
+.spinbutton .button:prelight:focused:last-child {
     background-image: -gtk-win32-theme-part(spin, 1 2, margins(-1 -1 0 -1));
 }
 
+
 .spinbutton .button:active,
 .spinbutton .button:active:prelight,
 .spinbutton .button:active:focused,
 .spinbutton .button:active:prelight:focused {
+    background-image: -gtk-win32-theme-part(spin, 2 3, margins(0 -1 -1 -1));
+}
+
+.spinbutton .button:active:last-child,
+.spinbutton .button:active:prelight:last-child,
+.spinbutton .button:active:focused:last-child,
+.spinbutton .button:active:prelight:focused:last-child {
     background-image: -gtk-win32-theme-part(spin, 1 3, margins(-1 -1 0 -1));
 }
 
 .spinbutton .button:insensitive {
-    background-image: -gtk-win32-theme-part(spin, 1 4, margins(-1 -1 0 -1));
+    background-image: -gtk-win32-theme-part(spin, 2 4, margins(0 -1 -1 -1));
 }
 
 .spinbutton .button:insensitive:last-child {
-    background-image: -gtk-win32-theme-part(spin, 1 4, margins(-1 -1 0 -2));
+    background-image: -gtk-win32-theme-part(spin, 1 4, margins(-1 -1 0 -1));
+}
+
+
+
+.spinbutton.vertical .button,
+.spinbutton.vertical .button:focused {
+    background-color: transparent;
+    color: rgba(0, 0, 0, 0);
+    background-image: -gtk-win32-theme-part(spin, 1 1, margins(0 -1 -0 -1));
+}
+
+.spinbutton.vertical .button:last-child,
+.spinbutton.vertical .button:focused:last-child {
+    background-image: -gtk-win32-theme-part(spin, 2 1, margins(0 -1 0 -1));
+}
+
+
+.spinbutton.vertical .button:prelight,
+.spinbutton.vertical .button:prelight:focused {
+    background-image: -gtk-win32-theme-part(spin, 1 2, margins(0 -1 -0 -1));
+}
+
+.spinbutton.vertical .button:prelight:last-child,
+.spinbutton.vertical .button:prelight:focused:last-child {
+    background-image: -gtk-win32-theme-part(spin, 2 2, margins(0 -1 0 -1));
+}
+
+
+.spinbutton.vertical .button:active,
+.spinbutton.vertical .button:active:prelight,
+.spinbutton.vertical .button:active:focused,
+.spinbutton.vertical .button:active:prelight:focused {
+    background-image: -gtk-win32-theme-part(spin, 1 3, margins(0 -1 -0 -1));
+}
+
+.spinbutton.vertical .button:active:last-child,
+.spinbutton.vertical .button:active:prelight:last-child,
+.spinbutton.vertical .button:active:focused:last-child,
+.spinbutton.vertical .button:active:prelight:focused:last-child {
+    background-image: -gtk-win32-theme-part(spin, 2 3, margins(0 -1 0 -1));
+}
+
+.spinbutton.vertical .button:insensitive {
+    background-image: -gtk-win32-theme-part(spin, 1 4, margins(0 -1 -0 -1));
+}
+
+.spinbutton.vertical .button:insensitive:last-child {
+    background-image: -gtk-win32-theme-part(spin, 2 4, margins(0 -1 0 -1));
+}
+
+
+
+.spinbutton .button:dir(rtl),
+.spinbutton .button:focused:dir(rtl) {
+    background-color: transparent;
+    background-image: -gtk-win32-theme-part(spin, 2 1, margins(0 -1 -1 -1));
+    color: rgba(0, 0, 0, 0);
+}
+
+.spinbutton .button:first-child:dir(rtl),
+.spinbutton .button:focused:first-child:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 1 1, margins(-1 -1 0 -1));
+}
+
+.spinbutton .button:prelight:dir(rtl),
+.spinbutton .button:prelight:focused:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 2 2, margins(0 -1 -1 -1));
 }
 
-.spinbutton .button.bottom,
-.spinbutton .button.bottom:focused {
-    background-image: -gtk-win32-theme-part(spin, 2 1);
+.spinbutton .button:prelight:first-child:dir(rtl),
+.spinbutton .button:prelight:focused:first-child:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 1 2, margins(-1 -1 0 -1));
+}
+
+
+.spinbutton .button:active:dir(rtl),
+.spinbutton .button:active:prelight:dir(rtl),
+.spinbutton .button:active:focused:dir(rtl),
+.spinbutton .button:active:prelight:focused:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 2 3, margins(0 -1 -1 -1));
 }
 
-.spinbutton .button.bottom:prelight,
-.spinbutton .button.bottom:prelight:focused {
-    background-image: -gtk-win32-theme-part(spin, 2 2);
+.spinbutton .button:active:first-child:dir(rtl),
+.spinbutton .button:active:prelight:first-child:dir(rtl),
+.spinbutton .button:active:focused:first-child:dir(rtl),
+.spinbutton .button:active:prelight:focused:first-child:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 1 3, margins(-1 -1 0 -1));
 }
 
-.spinbutton .button.bottom:active,
-.spinbutton .button.bottom:active:prelight {
-    background-image: -gtk-win32-theme-part(spin, 2 3);
+.spinbutton .button:insensitive:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 2 4, margins(0 -1 -1 -1));
 }
 
-.spinbutton .button.bottom:insensitive {
-    background-image: -gtk-win32-theme-part(spin, 2 4);
+.spinbutton .button:insensitive:first-child:dir(rtl) {
+    background-image: -gtk-win32-theme-part(spin, 1 4, margins(-1 -1 0 -1));
 }
 
 /* Ranges */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]