[libadwaita/wip/exalm/dropdown-style: 3/5] stylesheet: Unify menu and dropdown styles




commit ffcabbbadd8cb3ed8af3cec327223b5862136c46
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Oct 18 18:41:48 2021 +0500

    stylesheet: Unify menu and dropdown styles
    
    Dropdowns currently use a very custom style resembling an earlier menu
    style from pre-4.0 GTK development versions, even though its popover
    has .menu style class like menus.
    
    Make it possible to have listboxes and listviews in menus, make lists
    inside sections as seamless as possible with menu items.
    
    Remove dropdown style overrides, make it use the new default menu list
    styles.

 src/stylesheet/widgets/_dropdowns.scss | 10 ++-----
 src/stylesheet/widgets/_menus.scss     | 54 ++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+), 7 deletions(-)
---
diff --git a/src/stylesheet/widgets/_dropdowns.scss b/src/stylesheet/widgets/_dropdowns.scss
index e4bfb026..fb2b16de 100644
--- a/src/stylesheet/widgets/_dropdowns.scss
+++ b/src/stylesheet/widgets/_dropdowns.scss
@@ -28,16 +28,12 @@ combobox {
     button.combo { @extend %button_basic_drop_active; }
   }
 
-  // newstyle
   popover {
-    margin-top: 6px;
-    padding: 0;
+    padding-top: 6px;
 
     listview {
-      padding: 8px 0;
-
-      & > row {
-        padding: 8px;
+      > row {
+        min-width: 0;
       }
     }
 
diff --git a/src/stylesheet/widgets/_menus.scss b/src/stylesheet/widgets/_menus.scss
index 3dd2adf0..80bcfa18 100644
--- a/src/stylesheet/widgets/_menus.scss
+++ b/src/stylesheet/widgets/_menus.scss
@@ -147,6 +147,60 @@ popover.menu {
     font-weight: bold;
     padding: 4px ($menu_padding + 20px); //this will fall apart with font sizing
   }
+
+  list, listview {
+    background: none;
+    color: inherit;
+
+    > row {
+      border-radius: $menu_radius;
+      padding: 0 $menu_padding;
+      min-height: 30px;
+      min-width: 40px;
+
+      &:selected {
+        background: none;
+      }
+
+      &:hover {
+        &, &:selected.activatable {
+          background-color: $view_selected_color;
+        }
+      }
+
+      &:active {
+        &, &:selected.activatable {
+          background-color: $view_selected_active_color;
+        }
+      }
+
+      &.has-open-popup {
+        &, &:selected.activatable {
+          background-color: $view_selected_color;
+        }
+      }
+
+      > box {
+        border-spacing: 6px;
+      }
+    }
+  }
+
+  // Standalone lists should have same margins as menu sections,
+  // but we don't want that on lists inside sections themselves
+  contents > list,
+  contents > listview,
+  scrolledwindow > viewport > list,
+  scrolledwindow > listview {
+    padding: $menu_margin 0; //only vertical padding. horizontal row size would clip
+
+    > row {
+      margin: 0 $menu_margin;
+
+      padding: 8px;
+      min-height: 0;
+    }
+  }
 }
 
 menubar {


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