[libadwaita/wip/exalm/stylesheet2: 86/103] stylesheet: Split window styles into a separate file




commit f37ec2c1dfb506bda663b81002ce7634efd5fd44
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Apr 9 13:50:21 2021 +0500

    stylesheet: Split window styles into a separate file

 src/stylesheet/_common.scss         | 64 -------------------------------------
 src/stylesheet/_widgets.scss        |  1 +
 src/stylesheet/meson.build          |  1 +
 src/stylesheet/widgets/_window.scss | 60 ++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+), 64 deletions(-)
---
diff --git a/src/stylesheet/_common.scss b/src/stylesheet/_common.scss
index 23c808c..274ba98 100644
--- a/src/stylesheet/_common.scss
+++ b/src/stylesheet/_common.scss
@@ -708,70 +708,6 @@ colorchooser .popover.osd { border-radius: 5px; }
 }
 
 
-/**********************
- * Window Decorations *
- *********************/
-window {
-  // lamefun trick to get rounded borders regardless of CSD use
-  border-width: 0px;
-
-  // this needs to be transparent
-  // see bug #722563
-  $_wm_border: if($variant=='light', transparentize(black, 0.77), transparentize(black, 0.25));
-  $_wm_border_backdrop: if($variant=='light', transparentize(black, 0.82), transparentize(black, 0.25));
-
-  &.csd {
-    box-shadow: 0 3px 9px 1px transparentize(black, 0.5),
-                0 0 0 1px $_wm_border; //doing borders with box-shadow
-    margin: 0px;
-    border-radius: $window_radius;
-    &:backdrop {
-      // the transparent shadow here is to enforce that the shadow extents don't
-      // change when we go to backdrop, to prevent jumping windows.
-      // The biggest shadow should be in the same order then in the active state
-      // or the jumping will happen during the transition.
-      box-shadow: 0 3px 9px 1px transparent,
-                  0 2px 6px 2px transparentize(black, 0.8),
-                  0 0 0 1px $_wm_border_backdrop;
-      transition: $backdrop_transition;
-    }
-
-    &.dialog.message {
-      box-shadow: 0 1px 2px transparentize(black, 0.8),
-                  0 0 0 1px transparentize($_wm_border, 0.1);
-    }
-
-    &.solid-csd {
-      margin: 0;
-      padding: 0;
-      border: solid 1px $borders_color;
-      border-radius: 0;
-      box-shadow: inset 0 0 0 3px $headerbar_bg_color, inset 0 1px $top_hilight;
-
-      &:backdrop { box-shadow: inset 0 0 0 3px $backdrop_bg_color, inset 0 1px $top_hilight; }
-    }
-  }
-
-  &.maximized,
-  &.fullscreen { border-radius: 0; box-shadow: none; }
-
-  &.tiled,
-  &.tiled-top,
-  &.tiled-left,
-  &.tiled-right,
-  &.tiled-bottom {
-   border-radius: 0;
-   box-shadow: 0 0 0 1px $_wm_border_backdrop,
-               0 0 0 20px transparent; //transparent control workaround -- #3670
-   }
-   &:backdrop { box-shadow: 0 0 0 1px $_wm_border_backdrop,
-                            0 0 0 20px transparent; // #3670
-  }
-
-  // server-side decorations as used by mutter
-  &.ssd { box-shadow: 0 0 0 1px $_wm_border; } //just doing borders, wm draws actual shadows
-}
-
 // catch all extend :)
 
 %selected_items {
diff --git a/src/stylesheet/_widgets.scss b/src/stylesheet/_widgets.scss
index 8b444ed..863473f 100644
--- a/src/stylesheet/_widgets.scss
+++ b/src/stylesheet/_widgets.scss
@@ -19,3 +19,4 @@
 @import 'widgets/switch';
 @import 'widgets/toolbars';
 @import 'widgets/trees';
+@import 'widgets/window';
diff --git a/src/stylesheet/meson.build b/src/stylesheet/meson.build
index 4301c18..22bf8ab 100644
--- a/src/stylesheet/meson.build
+++ b/src/stylesheet/meson.build
@@ -41,6 +41,7 @@ if not fs.exists('Adwaita-light.css')
       'widgets/_switch.scss',
       'widgets/_toolbars.scss',
       'widgets/_trees.scss',
+      'widgets/_window.scss',
     ])
 
     theme_variants = [
diff --git a/src/stylesheet/widgets/_window.scss b/src/stylesheet/widgets/_window.scss
new file mode 100644
index 0000000..7eb6961
--- /dev/null
+++ b/src/stylesheet/widgets/_window.scss
@@ -0,0 +1,60 @@
+window {
+  // lamefun trick to get rounded borders regardless of CSD use
+  border-width: 0px;
+
+  // this needs to be transparent
+  // see bug #722563
+  $_wm_border: if($variant=='light', transparentize(black, 0.77), transparentize(black, 0.25));
+  $_wm_border_backdrop: if($variant=='light', transparentize(black, 0.82), transparentize(black, 0.25));
+
+  &.csd {
+    box-shadow: 0 3px 9px 1px transparentize(black, 0.5),
+                0 0 0 1px $_wm_border; //doing borders with box-shadow
+    margin: 0px;
+    border-radius: $window_radius;
+    &:backdrop {
+      // the transparent shadow here is to enforce that the shadow extents don't
+      // change when we go to backdrop, to prevent jumping windows.
+      // The biggest shadow should be in the same order then in the active state
+      // or the jumping will happen during the transition.
+      box-shadow: 0 3px 9px 1px transparent,
+                  0 2px 6px 2px transparentize(black, 0.8),
+                  0 0 0 1px $_wm_border_backdrop;
+      transition: $backdrop_transition;
+    }
+
+    &.dialog.message {
+      box-shadow: 0 1px 2px transparentize(black, 0.8),
+                  0 0 0 1px transparentize($_wm_border, 0.1);
+    }
+
+    &.solid-csd {
+      margin: 0;
+      padding: 0;
+      border: solid 1px $borders_color;
+      border-radius: 0;
+      box-shadow: inset 0 0 0 3px $headerbar_bg_color, inset 0 1px $top_hilight;
+
+      &:backdrop { box-shadow: inset 0 0 0 3px $backdrop_bg_color, inset 0 1px $top_hilight; }
+    }
+  }
+
+  &.maximized,
+  &.fullscreen { border-radius: 0; box-shadow: none; }
+
+  &.tiled,
+  &.tiled-top,
+  &.tiled-left,
+  &.tiled-right,
+  &.tiled-bottom {
+   border-radius: 0;
+   box-shadow: 0 0 0 1px $_wm_border_backdrop,
+               0 0 0 20px transparent; //transparent control workaround -- #3670
+   }
+   &:backdrop { box-shadow: 0 0 0 1px $_wm_border_backdrop,
+                            0 0 0 20px transparent; // #3670
+  }
+
+  // server-side decorations as used by mutter
+  &.ssd { box-shadow: 0 0 0 1px $_wm_border; } //just doing borders, wm draws actual shadows
+}


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