diff options
author | Benjamin Otte <otte@gnome.org> | 2016-02-15 06:50:49 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-02-17 04:49:27 +0100 |
commit | 01bcda8a8c5c2e7a87db1a1b585fc858abb9657e (patch) | |
tree | 4ea16fa1f8172aed4f1d680e7f788bc4e54b9e7f | |
parent | 67b893c5f8be66c316189ed73692093accfb1e9a (diff) | |
download | gtk+-01bcda8a8c5c2e7a87db1a1b585fc858abb9657e.tar.gz |
win32 theme: Query theme borders when rendering buttons
If someone figures out where the remaining pixel comes from: Tell me!
-rw-r--r-- | gtk/theme/win32/gtk-win32-base.css | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/gtk/theme/win32/gtk-win32-base.css b/gtk/theme/win32/gtk-win32-base.css index 6e00067cfc..ae68ea1857 100644 --- a/gtk/theme/win32/gtk-win32-base.css +++ b/gtk/theme/win32/gtk-win32-base.css @@ -286,33 +286,44 @@ radio:indeterminate:disabled { /* Buttons */ button { - background-color: transparent; background-image: -gtk-win32-theme-part(button, 1, 1); - border-width: 0; - padding: 3px; -} - -button:disabled { - background-image: -gtk-win32-theme-part(button, 1, 4); + padding-top: calc(1px + -gtk-win32-part-border-top(button, 1, 1)); + padding-right: calc(1px + -gtk-win32-part-border-right(button, 1, 1)); + padding-bottom: calc(1px + -gtk-win32-part-border-bottom(button, 1, 1)); + padding-left: calc(1px + -gtk-win32-part-border-left(button, 1, 1)); } -button:focus { +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, button:hover:focus { +button:hover { background-image: -gtk-win32-theme-part(button, 1, 2); - color: @text_color; + 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:active:focus, button:active:focus:hover { +button:active, button:checked { background-image: -gtk-win32-theme-part(button, 1, 3); - color: @text_color; + 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)); } -/* Override *:selected { ...} style; affects horizontalbuttons */ -button:selected { - background-color: transparent; +/* 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)); } /* Scrollbars */ |