[libadwaita/wip/exalm/borderless] More changes




commit aabeb47ba39f1b825c903d94855fad6ac0f5b624
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Jul 2 17:40:46 2021 +0500

    More changes
    
    Splitting this is gonna be fun, but not nearly as fun as the previous
    commit.

 examples/adw-view-switcher-demo-window.ui  | 155 ++++++++++-------------------
 src/stylesheet/_defaults.scss              |   4 +-
 src/stylesheet/widgets/_buttons.scss       |   5 +-
 src/stylesheet/widgets/_linked.scss        |   6 +-
 src/stylesheet/widgets/_toolbars.scss      |  14 ++-
 src/stylesheet/widgets/_view-switcher.scss |   1 +
 6 files changed, 70 insertions(+), 115 deletions(-)
---
diff --git a/examples/adw-view-switcher-demo-window.ui b/examples/adw-view-switcher-demo-window.ui
index 97e0a5cd..fde60ad3 100644
--- a/examples/adw-view-switcher-demo-window.ui
+++ b/examples/adw-view-switcher-demo-window.ui
@@ -12,6 +12,14 @@
         <property name="orientation">vertical</property>
         <child>
           <object class="AdwHeaderBar">
+            <property name="title-widget">
+              <object class="AdwViewSwitcherTitle">
+                <binding name="title">
+                  <lookup name="title">AdwViewSwitcherDemoWindow</lookup>
+                </binding>
+                <property name="stack">stack</property>
+              </object>
+            </property>
             <child>
               <object class="GtkButton">
                 <property name="icon-name">go-previous-symbolic</property>
@@ -111,126 +119,55 @@
           </object>
         </child>
         <child>
-          <object class="GtkLabel">
-            <property name="label">Borderless Demo</property>
-            <property name="vexpand">True</property>
-            <style>
-              <class name="large-title"/>
-            </style>
-          </object>
-        </child>
-        <child>
-          <object class="GtkBox">
-            <property name="spacing">12</property>
-            <property name="halign">center</property>
-            <property name="valign">center</property>
+          <object class="GtkStack" id="stack">
             <property name="vexpand">True</property>
+            <property name="transition-type">crossfade</property>
             <child>
-              <object class="GtkBox">
-                <property name="spacing">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <object class="AdwSplitButton">
-                    <property name="label">Button</property>
-                    <property name="menu-model">menu</property>
+              <object class="GtkStackPage">
+                <property name="icon-name">clock-world-symbolic</property>
+                <property name="title">World</property>
+                <property name="child">
+                  <object class="AdwStatusPage">
+                    <property name="icon-name">clock-world-symbolic</property>
+                    <property name="title">World</property>
                   </object>
-                </child>
-                <child>
-                  <object class="AdwSplitButton">
-                    <property name="label">Button</property>
-                    <property name="menu-model">menu</property>
-                    <style>
-                      <class name="flat"/>
-                    </style>
-                  </object>
-                </child>
-                <child>
-                  <object class="AdwSplitButton">
-                    <property name="label">Button</property>
-                    <property name="menu-model">menu</property>
-                    <style>
-                      <class name="outline"/>
-                    </style>
-                  </object>
-                </child>
+                </property>
               </object>
             </child>
             <child>
-              <object class="GtkBox">
-                <property name="spacing">12</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <object class="AdwSplitButton">
-                    <property name="icon-name">tab-new-symbolic</property>
-                    <property name="menu-model">menu</property>
-                  </object>
-                </child>
-                <child>
-                  <object class="AdwSplitButton">
-                    <property name="icon-name">tab-new-symbolic</property>
-                    <property name="menu-model">menu</property>
-                    <style>
-                      <class name="flat"/>
-                    </style>
-                  </object>
-                </child>
-                <child>
-                  <object class="AdwSplitButton">
-                    <property name="icon-name">tab-new-symbolic</property>
-                    <property name="menu-model">menu</property>
-                    <style>
-                      <class name="outline"/>
-                    </style>
+              <object class="GtkStackPage">
+                <property name="icon-name">clock-alarm-symbolic</property>
+                <property name="title">Alarms</property>
+                <property name="child">
+                  <object class="AdwStatusPage">
+                    <property name="icon-name">clock-alarm-symbolic</property>
+                    <property name="title">Alarms</property>
                   </object>
-                </child>
+                </property>
               </object>
             </child>
             <child>
-              <object class="GtkBox">
-                <style>
-                  <class name="toolbar"/>
-                </style>
-                <property name="spacing">6</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <object class="AdwSplitButton">
-                    <property name="label">Button</property>
-                    <property name="menu-model">menu</property>
-                  </object>
-                </child>
-                <child>
-                  <object class="AdwSplitButton">
-                    <property name="label">Button</property>
-                    <property name="menu-model">menu</property>
-                    <style>
-                      <class name="flat"/>
-                    </style>
+              <object class="GtkStackPage">
+                <property name="icon-name">clock-stopwatch-symbolic</property>
+                <property name="title">Stopwatch</property>
+                <property name="child">
+                  <object class="AdwStatusPage">
+                    <property name="icon-name">clock-stopwatch-symbolic</property>
+                    <property name="title">Stopwatch</property>
                   </object>
-                </child>
+                </property>
               </object>
             </child>
             <child>
-              <object class="GtkBox">
-                <style>
-                  <class name="toolbar"/>
-                </style>
-                <property name="spacing">6</property>
-                <property name="orientation">vertical</property>
-                <child>
-                  <object class="AdwSplitButton">
-                    <property name="icon-name">tab-new-symbolic</property>
-                    <property name="menu-model">menu</property>
-                    <style>
-                      <class name="raised"/>
-                    </style>
+              <object class="GtkStackPage">
+                <property name="icon-name">clock-timer-symbolic</property>
+                <property name="title">Timer</property>
+                <property name="child">
+                  <object class="AdwStatusPage">
+                    <property name="icon-name">clock-timer-symbolic</property>
+                    <property name="title">Timer</property>
                   </object>
-                </child>
-                <child>
-                  <object class="AdwSplitButton">
-                    <property name="icon-name">tab-new-symbolic</property>
-                    <property name="menu-model">menu</property>
-                  </object>
-                </child>
+                </property>
               </object>
             </child>
           </object>
@@ -337,6 +274,14 @@
         </child>
         <child>
           <object class="GtkActionBar">
+            <child type="center">
+              <object class="AdwViewSwitcherTitle">
+                <binding name="title">
+                  <lookup name="title">AdwViewSwitcherDemoWindow</lookup>
+                </binding>
+                <property name="stack">stack</property>
+              </object>
+            </child>
             <child type="start">
               <object class="GtkMenuButton">
                 <property name="label">Open</property>
diff --git a/src/stylesheet/_defaults.scss b/src/stylesheet/_defaults.scss
index 3cec7308..c49f253e 100644
--- a/src/stylesheet/_defaults.scss
+++ b/src/stylesheet/_defaults.scss
@@ -11,12 +11,12 @@
 // The main accent color and the matching text value
 @define-color accent_bg_color #{$blue_3};
 @define-color accent_fg_color #{$light_1};
-@define-color accent_color #{if($variant == 'dark', $blue_1, $blue_5)};
+@define-color accent_color #{if($variant == 'dark', $blue_1, $blue_4)};
 
 // destructive-action buttons
 @define-color destructive_bg_color #{$red_3};
 @define-color destructive_fg_color #{$light_1};
-@define-color destructive_color #{if($variant == 'dark', $red_1, $red_5)};
+@define-color destructive_color #{if($variant == 'dark', $red_1, $red_4)};
 
 // Levelbars, entries, labels and infobars. These don't need text colors
 @define-color success_color #{$green_3};
diff --git a/src/stylesheet/widgets/_buttons.scss b/src/stylesheet/widgets/_buttons.scss
index 2e49af7b..67df0a3a 100644
--- a/src/stylesheet/widgets/_buttons.scss
+++ b/src/stylesheet/widgets/_buttons.scss
@@ -12,6 +12,7 @@ button {
     padding: 5px 10px;
     border-radius: $button_radius;
     background-color: $button_color;
+    font-weight: bold;
 
     @if $contrast == 'high' {
       box-shadow: inset 0 0 0 1px $borders_color;
@@ -52,8 +53,8 @@ button {
 
     &.image-button {
       min-width: 24px;
-      padding-left: 6px;
-      padding-right: 6px;
+      padding-left: 5px;
+      padding-right: 5px;
     }
 
     &.text-button {
diff --git a/src/stylesheet/widgets/_linked.scss b/src/stylesheet/widgets/_linked.scss
index 7bbd34c7..91273915 100644
--- a/src/stylesheet/widgets/_linked.scss
+++ b/src/stylesheet/widgets/_linked.scss
@@ -11,10 +11,6 @@ $_linked_widgets: ("%button",          ""),
                   ("%entry",           ""),
                   ("entry",            "");
 
-.linked {
-  border-spacing: 2px;
-}
-
 @each $widget, $child in $_linked_widgets {
   .linked:not(.vertical) > {
     #{$widget} {
@@ -22,6 +18,7 @@ $_linked_widgets: ("%button",          ""),
       &:dir(rtl):not(:last-child) #{$child} {
         border-top-left-radius: 0;
         border-bottom-left-radius: 0;
+        margin-left: -1px;
       }
 
       &:dir(ltr):not(:last-child) #{$child},
@@ -37,6 +34,7 @@ $_linked_widgets: ("%button",          ""),
       &:not(:first-child) #{$child} {
         border-top-left-radius: 0;
         border-top-right-radius: 0;
+        margin-top: -1px;
       }
 
       &:not(:last-child) #{$child} {
diff --git a/src/stylesheet/widgets/_toolbars.scss b/src/stylesheet/widgets/_toolbars.scss
index de4d6384..4fec6100 100644
--- a/src/stylesheet/widgets/_toolbars.scss
+++ b/src/stylesheet/widgets/_toolbars.scss
@@ -11,6 +11,13 @@
     }
   }
 
+  menubutton.raised {
+    > button.image-button,
+    > button.arrow-button {
+      @extend %button;
+    }
+  }
+
   splitbutton {
     // Specificity bump
     > separator.vertical {
@@ -30,13 +37,16 @@
   splitbutton,
   separator:not(.sidebar),
   button,
+  menubutton,
   .linked2 {
     margin-top: 6px;
     margin-bottom: 6px;
   }
 
-  .linked2 button,
-  splitbutton button {
+  // Reset margins for buttons inside menubutton
+  menubutton > button,
+  splitbutton > button,
+  splitbutton > menubutton {
     margin-top: 0px;
     margin-bottom: 0px;
   }
diff --git a/src/stylesheet/widgets/_view-switcher.scss b/src/stylesheet/widgets/_view-switcher.scss
index 0d14b5c4..45582ebb 100644
--- a/src/stylesheet/widgets/_view-switcher.scss
+++ b/src/stylesheet/widgets/_view-switcher.scss
@@ -9,6 +9,7 @@ viewswitcher {
     border-top: none;
     border-bottom: none;
     font-size: 1rem;
+    font-weight: inherit;
 
     > stack > box {
       &.narrow {


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