[gtk+] Adwaita: use margin for spacing widgets on toolbars



commit 3549490aa8f9744c9165325ef6edf05222022dcb
Author: Lapo Calamandrei <calamandrei gmail com>
Date:   Thu Mar 3 15:58:13 2016 +0100

    Adwaita: use margin for spacing widgets on toolbars
    
    kind of a workaround, this approach is pretty unmaintainable, I
    hope we'll get a CSS property for spacing directly on the parent
    container (a toolbar in this particular case).
    See https://bugzilla.gnome.org/show_bug.cgi?id=762397

 gtk/theme/Adwaita/_common.scss           |   18 ++++++++++++++----
 gtk/theme/Adwaita/gtk-contained-dark.css |   28 ++++++++++++++++++++++++----
 gtk/theme/Adwaita/gtk-contained.css      |   28 ++++++++++++++++++++++++----
 3 files changed, 62 insertions(+), 12 deletions(-)
---
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index 3f54aa3..7b77af3 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -1110,14 +1110,14 @@ combobox {
  ************/
 toolbar {
   -GtkWidget-window-dragging: true;
-  padding: 4px;
+  padding: 4px 3px 3px 4px;
   background-color: $bg_color;
   // on OSD
   .osd & { background-color: transparent; }
 
   // stand-alone OSD toolbars
   &.osd {
-    padding: 13px;
+    padding: 13px 12px 12px 13px;
     border: none;
     border-radius: 5px;
     background-color: $osd_bg_color;
@@ -1129,8 +1129,18 @@ toolbar {
   &.osd.bottom { border-radius: 0; } // positional classes for `attached` osd toolbars
 
   // toolbar separators
-  &.horizontal separator { margin: 0 6px; }
-  &.vertical separator { margin: 6px 0; }
+  &.horizontal separator { margin: 0 7px 1px 6px; }
+  &.vertical separator { margin: 6px 1px 7px 0; }
+
+  &:not(.inline-toolbar) {
+    switch,
+    scale,
+    entry,
+    button {
+      margin-right: 1px;
+      margin-bottom: 1px;
+      }
+  }
 }
 
 //searchbar, location-bar & inline-toolbar
diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css
index 677d134..1875a4d 100644
--- a/gtk/theme/Adwaita/gtk-contained-dark.css
+++ b/gtk/theme/Adwaita/gtk-contained-dark.css
@@ -1420,14 +1420,14 @@ combobox arrow {
 toolbar, .inline-toolbar, searchbar,
 .location-bar {
   -GtkWidget-window-dragging: true;
-  padding: 4px;
+  padding: 4px 3px 3px 4px;
   background-color: #393f3f; }
   .osd toolbar, .osd .inline-toolbar, .osd searchbar,
   .osd .location-bar {
     background-color: transparent; }
   toolbar.osd, .osd.inline-toolbar, searchbar.osd,
   .osd.location-bar {
-    padding: 13px;
+    padding: 13px 12px 12px 13px;
     border: none;
     border-radius: 5px;
     background-color: rgba(32, 37, 38, 0.8); }
@@ -1439,10 +1439,30 @@ toolbar, .inline-toolbar, searchbar,
     border-radius: 0; }
   toolbar.horizontal separator, .horizontal.inline-toolbar separator, searchbar.horizontal separator,
   .horizontal.location-bar separator {
-    margin: 0 6px; }
+    margin: 0 7px 1px 6px; }
   toolbar.vertical separator, .vertical.inline-toolbar separator, searchbar.vertical separator,
   .vertical.location-bar separator {
-    margin: 6px 0; }
+    margin: 6px 1px 7px 0; }
+  toolbar:not(.inline-toolbar) switch, .inline-toolbar:not(.inline-toolbar) switch, 
searchbar:not(.inline-toolbar) switch,
+  .location-bar:not(.inline-toolbar) switch,
+  toolbar:not(.inline-toolbar) scale,
+  .inline-toolbar:not(.inline-toolbar) scale,
+  searchbar:not(.inline-toolbar) scale,
+  .location-bar:not(.inline-toolbar) scale,
+  toolbar:not(.inline-toolbar) entry,
+  .inline-toolbar:not(.inline-toolbar) entry,
+  searchbar:not(.inline-toolbar) entry,
+  .location-bar:not(.inline-toolbar) entry,
+  toolbar:not(.inline-toolbar) spinbutton:not(.vertical),
+  .inline-toolbar:not(.inline-toolbar) spinbutton:not(.vertical),
+  searchbar:not(.inline-toolbar) spinbutton:not(.vertical),
+  .location-bar:not(.inline-toolbar) spinbutton:not(.vertical),
+  toolbar:not(.inline-toolbar) button,
+  .inline-toolbar:not(.inline-toolbar) button,
+  searchbar:not(.inline-toolbar) button,
+  .location-bar:not(.inline-toolbar) button {
+    margin-right: 1px;
+    margin-bottom: 1px; }
 
 .inline-toolbar {
   border-width: 0 1px 1px;
diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css
index 75a3c43..e6b2558 100644
--- a/gtk/theme/Adwaita/gtk-contained.css
+++ b/gtk/theme/Adwaita/gtk-contained.css
@@ -1424,14 +1424,14 @@ combobox arrow {
 toolbar, .inline-toolbar, searchbar,
 .location-bar {
   -GtkWidget-window-dragging: true;
-  padding: 4px;
+  padding: 4px 3px 3px 4px;
   background-color: #e8e8e7; }
   .osd toolbar, .osd .inline-toolbar, .osd searchbar,
   .osd .location-bar {
     background-color: transparent; }
   toolbar.osd, .osd.inline-toolbar, searchbar.osd,
   .osd.location-bar {
-    padding: 13px;
+    padding: 13px 12px 12px 13px;
     border: none;
     border-radius: 5px;
     background-color: rgba(32, 37, 38, 0.8); }
@@ -1443,10 +1443,30 @@ toolbar, .inline-toolbar, searchbar,
     border-radius: 0; }
   toolbar.horizontal separator, .horizontal.inline-toolbar separator, searchbar.horizontal separator,
   .horizontal.location-bar separator {
-    margin: 0 6px; }
+    margin: 0 7px 1px 6px; }
   toolbar.vertical separator, .vertical.inline-toolbar separator, searchbar.vertical separator,
   .vertical.location-bar separator {
-    margin: 6px 0; }
+    margin: 6px 1px 7px 0; }
+  toolbar:not(.inline-toolbar) switch, .inline-toolbar:not(.inline-toolbar) switch, 
searchbar:not(.inline-toolbar) switch,
+  .location-bar:not(.inline-toolbar) switch,
+  toolbar:not(.inline-toolbar) scale,
+  .inline-toolbar:not(.inline-toolbar) scale,
+  searchbar:not(.inline-toolbar) scale,
+  .location-bar:not(.inline-toolbar) scale,
+  toolbar:not(.inline-toolbar) entry,
+  .inline-toolbar:not(.inline-toolbar) entry,
+  searchbar:not(.inline-toolbar) entry,
+  .location-bar:not(.inline-toolbar) entry,
+  toolbar:not(.inline-toolbar) spinbutton:not(.vertical),
+  .inline-toolbar:not(.inline-toolbar) spinbutton:not(.vertical),
+  searchbar:not(.inline-toolbar) spinbutton:not(.vertical),
+  .location-bar:not(.inline-toolbar) spinbutton:not(.vertical),
+  toolbar:not(.inline-toolbar) button,
+  .inline-toolbar:not(.inline-toolbar) button,
+  searchbar:not(.inline-toolbar) button,
+  .location-bar:not(.inline-toolbar) button {
+    margin-right: 1px;
+    margin-bottom: 1px; }
 
 .inline-toolbar {
   border-width: 0 1px 1px;


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