[gtk+] win32 theme: Size titlebar icons correctly.



commit 808017d1d0a57a94229092d3424d374f227f111c
Author: Benjamin Otte <otte redhat com>
Date:   Mon Feb 22 04:01:44 2016 +0100

    win32 theme: Size titlebar icons correctly.
    
    Sizing according to
    
http://web.archive.org/web/20070301202835/http://shellrevealed.com/photos/blog_images/images/4538/original.aspx

 gtk/theme/win32/gtk.css |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/gtk/theme/win32/gtk.css b/gtk/theme/win32/gtk.css
index 2330850..1c95859 100644
--- a/gtk/theme/win32/gtk.css
+++ b/gtk/theme/win32/gtk.css
@@ -343,11 +343,12 @@ row:selected:hover {
 
 /* Titlebar */
 
-window .titlebar {
+.titlebar {
     background: -gtk-win32-theme-part(window, 1, 1);
+    min-height: -gtk-win32-size(window, cycaption);
 }
 
-window:backdrop .titlebar {
+.titlebar:backdrop {
     background: -gtk-win32-theme-part(window, 1, 2);
 }
 
@@ -355,6 +356,26 @@ window .titlebar:disabled {
     background: -gtk-win32-theme-part(window, 1, 3);
 }
 
+.titlebar button.titlebutton {
+    margin-top: -gtk-win32-size(button, cyedge);
+    margin-bottom: -gtk-win32-size(button, cyedge);
+    margin-right: -gtk-win32-size(button, cxedge);
+    min-width: calc(-gtk-win32-size(button, cxsize) - 2 * -gtk-win32-size(button, cxedge));
+    min-height: calc(-gtk-win32-size(button, cysize) - 2 * -gtk-win32-size(button, cyedge));
+}
+
+/* XXX: headerbar insists on 6px spacing between buttons. Windows doesn't
+ * think so. */
+.titlebar .titlebutton + .titlebutton {
+  margin-left: -6px;
+}
+
+/* XXX: We don't draw icons here, but the GtkImage still sizes itself to 16x16,
+ * so shrink it enough: */
+.titlebar button.titlebutton image {
+  margin: -3px;
+}
+
 .titlebar button.close {
     background-image: -gtk-win32-theme-part(window, 18, 1);
     color: transparent;


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