[gtk+] win32 theme: Query theme borders when rendering buttons
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] win32 theme: Query theme borders when rendering buttons
- Date: Wed, 17 Feb 2016 03:51:11 +0000 (UTC)
commit 01bcda8a8c5c2e7a87db1a1b585fc858abb9657e
Author: Benjamin Otte <otte gnome org>
Date: Mon Feb 15 06:50:49 2016 +0100
win32 theme: Query theme borders when rendering buttons
If someone figures out where the remaining pixel comes from: Tell me!
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 6e00067..ae68ea1 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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]