[gtk+] win32 theme: Fix scrollbars



commit ed980824c4c262dc1a3fb225460f858ad8502f1d
Author: Jaime Velasco Juan <jsagarribay gmail com>
Date:   Thu Oct 13 12:38:05 2016 +0100

    win32 theme: Fix scrollbars
    
    The fix is only partial, when both scrollbars are visible their ends
    overlap.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773221

 gtk/theme/win32/gtk-win32-base.css |  140 ++++++++++++++++++------------------
 1 files changed, 71 insertions(+), 69 deletions(-)
---
diff --git a/gtk/theme/win32/gtk-win32-base.css b/gtk/theme/win32/gtk-win32-base.css
index 57bb53a..9624f59 100644
--- a/gtk/theme/win32/gtk-win32-base.css
+++ b/gtk/theme/win32/gtk-win32-base.css
@@ -278,35 +278,19 @@ button {
 
 button.default {
     background-image: -gtk-win32-theme-part(button, 1, 5);
-    padding-top: calc(1px + -gtk-win32-part-border-top(button, 1, 5));
-    padding-right: calc(1px + -gtk-win32-part-border-right(button, 1, 5));
-    padding-bottom: calc(1px + -gtk-win32-part-border-bottom(button, 1, 5));
-    padding-left: calc(1px + -gtk-win32-part-border-left(button, 1, 5));
 }
 
 button:hover {
     background-image: -gtk-win32-theme-part(button, 1, 2);
-    padding-top: calc(1px + -gtk-win32-part-border-top(button, 1, 2));
-    padding-right: calc(1px + -gtk-win32-part-border-right(button, 1, 2));
-    padding-bottom: calc(1px + -gtk-win32-part-border-bottom(button, 1, 2));
-    padding-left: calc(1px + -gtk-win32-part-border-left(button, 1, 2));
 }
 
 button:active, button:checked {
     background-image: -gtk-win32-theme-part(button, 1, 3);
-    padding-top: calc(1px + -gtk-win32-part-border-top(button, 1, 3));
-    padding-right: calc(1px + -gtk-win32-part-border-right(button, 1, 3));
-    padding-bottom: calc(1px + -gtk-win32-part-border-bottom(button, 1, 3));
-    padding-left: calc(1px + -gtk-win32-part-border-left(button, 1, 3));
 }
 
 /* XXX: Figure out how to handle disabled active togglebuttons */
 button:disabled {
     background-image: -gtk-win32-theme-part(button, 1, 4);
-    padding-top: calc(1px + -gtk-win32-part-border-top(button, 1, 4));
-    padding-right: calc(1px + -gtk-win32-part-border-right(button, 1, 4));
-    padding-bottom: calc(1px + -gtk-win32-part-border-bottom(button, 1, 4));
-    padding-left: calc(1px + -gtk-win32-part-border-left(button, 1, 4));
 }
 
 /* checkbuttons */
@@ -547,85 +531,93 @@ notebook > header > tabs > tab:only-child:checked {
 
 scrollbar {
     background-color: transparent;
-    -GtkRange-arrow-scaling: 0.0;
-    -GtkRange-slider-width: -gtk-win32-size(scrollbar, cyhscroll);
 }
 
-scrollbar.vertical {
-    -GtkRange-slider-width: -gtk-win32-size(scrollbar, cxvscroll);
+scrollbar.horizontal button {
+    min-width : -gtk-win32-size(scrollbar, cxhscroll);
+    min-height : -gtk-win32-size(scrollbar, cyhscroll);
 }
-
-scrollbar button.bottom {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 5);
+scrollbar.vertical button {
+    min-width : -gtk-win32-size(scrollbar, cxvscroll);
+    min-height : -gtk-win32-size(scrollbar, cyvscroll);
 }
-
-scrollbar button.bottom:hover {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 6);
+scrollbar button, scrollbar button:disabled {
+    color: transparent;
+    margin: 0;
+    padding: 0;
 }
 
-scrollbar button.bottom:active,
-scrollbar button.bottom:active:hover {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 7);
+/* up button */
+scrollbar.vertical button.up {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 1);
 }
-
-scrollbar button.bottom:disabled {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 8);
+scrollbar.vertical:hover button.up {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 17);
 }
-
-scrollbar button.top {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 1);
+scrollbar.vertical:hover button.up:hover {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 2);
 }
-
-scrollbar button.top:hover {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 2);
+scrollbar.vertical:hover button.up:active {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 3);
 }
-
-scrollbar button.top:active,
-scrollbar button.top:active:hover {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 3);
+scrollbar.vertical:hover button.up:disabled {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 4);
 }
 
-scrollbar button.top:disabled {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 4);
+/* down button */
+scrollbar.vertical button.down {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 5);
 }
-
-scrollbar button.left {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 9);
+scrollbar.vertical:hover button.down {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 18);
 }
-
-scrollbar button.left:hover {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 10);
+scrollbar.vertical:hover button.down:hover {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 6);
 }
-
-scrollbar button.left:active,
-scrollbar button.left:active:hover {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 11);
+scrollbar.vertical:hover button.down:active {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 7);
 }
-
-scrollbar button.left:disabled {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 12);
+scrollbar.vertical:hover button.down:disabled {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 8);
 }
 
-scrollbar button.right {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 13);
+/* left button */
+scrollbar.horizontal button.up {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 9);
 }
-
-scrollbar button.right:hover {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 14);
+scrollbar.horizontal:hover button.up {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 19);
 }
-
-scrollbar button.right:active,
-scrollbar button.right:active:hover {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 15);
+scrollbar.horizontal:hover button.up:hover {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 10);
+}
+scrollbar.horizontal:hover button.up:active {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 11);
+}
+scrollbar.horizontal:hover button.up:disabled {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 12);
 }
 
-scrollbar button.right:disabled {
-    background-image: -gtk-win32-theme-part(scrollbar, 1, 16);
+/* right button */
+scrollbar.horizontal button.down {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 13);
+}
+scrollbar.horizontal:hover button.down {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 20);
+}
+scrollbar.horizontal:hover button.down:hover {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 14);
+}
+scrollbar.horizontal:hover button.down:active {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 16);
+}
+scrollbar.horizontal:hover button.down:disabled {
+background-image: -gtk-win32-theme-part(scrollbar, 1 , 17);
 }
 
 scrollbar trough {
     border-width: 0;
-    background-image: -gtk-win32-theme-part(scrollbar, 2, 1, over(4, 1));
+    background-image: -gtk-win32-theme-part(scrollbar, 6, 1);
 }
 
 scrollbar trough.vertical {
@@ -633,6 +625,16 @@ scrollbar trough.vertical {
     background-image: -gtk-win32-theme-part(scrollbar, 2, 1, over(6, 1));
 }
 
+scrollbar.horizontal slider {
+    min-height: -gtk-win32-size(scrollbar, cyhscroll);
+    min-width: -gtk-win32-size(scrollbar, cxhthumb);
+}
+scrollbar.vertical slider {
+    min-width: -gtk-win32-size(scrollbar, cxvscroll);
+    min-height: -gtk-win32-size(scrollbar, cyvthumb);
+}
+
+
 scrollbar slider {
     border-width: 0;
     background-image: -gtk-win32-theme-part(scrollbar, 2, 1, over(8, 1));


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