[gtk+] Adwaita: be more specific about menu items height



commit 6085bba0a5960390497e429e7a9e41746ff80ac4
Author: Lapo Calamandrei <calamandrei gmail com>
Date:   Tue Feb 16 17:40:13 2016 +0100

    Adwaita: be more specific about menu items height
    
    setting a 16px min-height (same as a check/radio) and resetting
    margins on check/radio to workaround a sizing issues there.

 gtk/theme/Adwaita/_common.scss           |    8 +++++-
 gtk/theme/Adwaita/gtk-contained-dark.css |   37 +++++++++++++++++-------------
 gtk/theme/Adwaita/gtk-contained.css      |   37 +++++++++++++++++-------------
 3 files changed, 48 insertions(+), 34 deletions(-)
---
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index e14dcc3..e00e4ce 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -1656,6 +1656,7 @@ menubar,
   &:backdrop { background-color: $backdrop_bg_color; }
 
   > menuitem {
+    min-height: 16px;
     padding: 4px 8px;
 
     &:hover { //Seems like it :hover even with keyboard focus
@@ -1682,9 +1683,10 @@ menu,
   &:backdrop { background-color: $backdrop_menu_color; }
 
   menuitem {
-    text-shadow: none;
-    padding: 4px;
+    min-height: 16px;
     min-width: 40px;
+    padding: 4px 6px;
+    text-shadow: none;
 
     &:hover {
       color: $selected_fg_color;
@@ -2344,6 +2346,8 @@ radio {
   }
 
   menu menuitem & {
+    margin: 0; // this is a workaround for a menu check/radio size allocation issue
+
     &, &:hover, &:disabled {
       min-height: 14px;
       min-width: 14px;
diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css
index 898516d..6ab127e 100644
--- a/gtk/theme/Adwaita/gtk-contained-dark.css
+++ b/gtk/theme/Adwaita/gtk-contained-dark.css
@@ -2023,6 +2023,7 @@ menubar,
     background-color: #393f3f; }
   menubar > menuitem,
   .menubar > menuitem {
+    min-height: 16px;
     padding: 4px 8px; }
     menubar > menuitem:hover,
     .menubar > menuitem:hover {
@@ -2047,9 +2048,10 @@ menu,
     background-color: #2f3030; }
   menu menuitem,
   .menu menuitem {
-    text-shadow: none;
-    padding: 4px;
-    min-width: 40px; }
+    min-height: 16px;
+    min-width: 40px;
+    padding: 4px 6px;
+    text-shadow: none; }
     menu menuitem:hover,
     .menu menuitem:hover {
       color: #ffffff;
@@ -2602,19 +2604,22 @@ radio {
       text-shadow: none;
       -gtk-icon-shadow: none;
       box-shadow: inset 0 1px rgba(255, 255, 255, 0), 0 1px rgba(238, 238, 236, 0); }
-  menu menuitem check, menu menuitem check:hover, menu menuitem check:disabled, menu menuitem
-  radio, menu menuitem
-  radio:hover, menu menuitem
-  radio:disabled {
-    min-height: 14px;
-    min-width: 14px;
-    background-image: none;
-    background-color: transparent;
-    box-shadow: none;
-    -gtk-icon-shadow: none;
-    color: inherit;
-    border-color: currentColor;
-    animation: none; }
+  menu menuitem check, menu menuitem
+  radio {
+    margin: 0; }
+    menu menuitem check, menu menuitem check:hover, menu menuitem check:disabled, menu menuitem
+    radio, menu menuitem
+    radio:hover, menu menuitem
+    radio:disabled {
+      min-height: 14px;
+      min-width: 14px;
+      background-image: none;
+      background-color: transparent;
+      box-shadow: none;
+      -gtk-icon-shadow: none;
+      color: inherit;
+      border-color: currentColor;
+      animation: none; }
 
 treeview.view check:selected:focus:disabled, treeview.view check:selected:focus, treeview.view 
check:selected:backdrop:disabled, treeview.view check:selected:backdrop, treeview.view 
check:selected:disabled, treeview.view check:selected,
 check {
diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css
index 25039b2..864bf53 100644
--- a/gtk/theme/Adwaita/gtk-contained.css
+++ b/gtk/theme/Adwaita/gtk-contained.css
@@ -2033,6 +2033,7 @@ menubar,
     background-color: #e8e8e7; }
   menubar > menuitem,
   .menubar > menuitem {
+    min-height: 16px;
     padding: 4px 8px; }
     menubar > menuitem:hover,
     .menubar > menuitem:hover {
@@ -2057,9 +2058,10 @@ menu,
     background-color: white; }
   menu menuitem,
   .menu menuitem {
-    text-shadow: none;
-    padding: 4px;
-    min-width: 40px; }
+    min-height: 16px;
+    min-width: 40px;
+    padding: 4px 6px;
+    text-shadow: none; }
     menu menuitem:hover,
     .menu menuitem:hover {
       color: #ffffff;
@@ -2627,19 +2629,22 @@ radio {
   row:selected check, row:selected
   radio {
     border-color: #184472; }
-  menu menuitem check, menu menuitem check:hover, menu menuitem check:disabled, menu menuitem
-  radio, menu menuitem
-  radio:hover, menu menuitem
-  radio:disabled {
-    min-height: 14px;
-    min-width: 14px;
-    background-image: none;
-    background-color: transparent;
-    box-shadow: none;
-    -gtk-icon-shadow: none;
-    color: inherit;
-    border-color: currentColor;
-    animation: none; }
+  menu menuitem check, menu menuitem
+  radio {
+    margin: 0; }
+    menu menuitem check, menu menuitem check:hover, menu menuitem check:disabled, menu menuitem
+    radio, menu menuitem
+    radio:hover, menu menuitem
+    radio:disabled {
+      min-height: 14px;
+      min-width: 14px;
+      background-image: none;
+      background-color: transparent;
+      box-shadow: none;
+      -gtk-icon-shadow: none;
+      color: inherit;
+      border-color: currentColor;
+      animation: none; }
 
 treeview.view check:selected:focus:disabled, treeview.view check:selected:focus, treeview.view 
check:selected:backdrop:disabled, treeview.view check:selected:backdrop, treeview.view 
check:selected:disabled, treeview.view check:selected,
 check {


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