[gnome-shell/wip/jimmac/frederik-light] theme: add light/dark switches



commit eed2d730bf2338de4a8b546c19782d4c3e4b4d66
Author: Jakub Steiner <jimmac gmail com>
Date:   Thu May 30 09:38:00 2019 +0200

    theme: add light/dark switches

 data/gnome-shell-theme.gresource.xml     |   6 +-
 data/theme/gnome-shell-sass/_common.scss |   8 ++-
 data/theme/toggle-off-dark.svg           |   1 +
 data/theme/toggle-off-intl.svg           | 103 -------------------------------
 data/theme/toggle-off.svg                |   1 +
 data/theme/toggle-on-dark.svg            |   1 +
 data/theme/toggle-on-intl.svg            | 103 -------------------------------
 data/theme/toggle-on.svg                 |   1 +
 8 files changed, 14 insertions(+), 210 deletions(-)
---
diff --git a/data/gnome-shell-theme.gresource.xml b/data/gnome-shell-theme.gresource.xml
index c05be6b42..dc08ef8e3 100644
--- a/data/gnome-shell-theme.gresource.xml
+++ b/data/gnome-shell-theme.gresource.xml
@@ -21,9 +21,11 @@
     <file>noise-texture.png</file>
     <file>pad-osd.css</file>
     <file>process-working.svg</file>
-    <file>toggle-off-intl.svg</file>
+    <file>toggle-off.svg</file>
+    <file>toggle-off-dark.svg</file>
     <file>toggle-off-hc.svg</file>
-    <file>toggle-on-intl.svg</file>
+    <file>toggle-on.svg</file>
+    <file>toggle-on-dark.svg</file>
     <file>toggle-on-hc.svg</file>
   </gresource>
 </gresources>
diff --git a/data/theme/gnome-shell-sass/_common.scss b/data/theme/gnome-shell-sass/_common.scss
index 7362fc682..9736c52c3 100644
--- a/data/theme/gnome-shell-sass/_common.scss
+++ b/data/theme/gnome-shell-sass/_common.scss
@@ -169,8 +169,12 @@ StScrollBar {
   width: 46px;
   height: 22px;
   background-size: contain;
-  background-image: url("resource:///org/gnome/shell/theme/toggle-off-intl.svg");
-  &:checked { background-image: url("resource:///org/gnome/shell/theme/toggle-on-intl.svg"); }
+  background-image: if($variant == 'light', url("resource:///org/gnome/shell/theme/toggle-off.svg"),
+                                           url("resource:///org/gnome/shell/theme/toggle-off-dark.svg"));
+  &:checked { 
+    background-image: if($variant == 'light', url("resource:///org/gnome/shell/theme/toggle-on.svg"),
+                                           url("resource:///org/gnome/shell/theme/toggle-on-dark.svg"));
+  }
 }
 
 /* links */
diff --git a/data/theme/toggle-off-dark.svg b/data/theme/toggle-off-dark.svg
new file mode 100644
index 000000000..ef1e25f97
--- /dev/null
+++ b/data/theme/toggle-off-dark.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; width="46" 
height="22"><defs><linearGradient id="a"><stop offset="0" stop-color="#39393a"/><stop offset="1" 
stop-color="#302f30"/></linearGradient><linearGradient xlink:href="#a" id="b" x1="53" y1="294.429" x2="53" 
y2="309.804" gradientUnits="userSpaceOnUse" gradientTransform="translate(-42.76)"/></defs><g 
transform="translate(0 -291.18)" stroke-width="1.085"><rect style="marker:none" width="44.446" 
height="20.911" x=".625" y="291.715" rx="10.455" ry="10.073" fill="#323233" stroke="#272728"/><rect 
ry="10.455" rx="10.455" y="291.715" x=".543" height="20.911" width="21.143" style="marker:none" 
fill="url(#b)" stroke="#151515"/></g></svg>
\ No newline at end of file
diff --git a/data/theme/toggle-off.svg b/data/theme/toggle-off.svg
new file mode 100644
index 000000000..ee5178294
--- /dev/null
+++ b/data/theme/toggle-off.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg"; width="46" height="22"><g transform="translate(0 -291.18)"><rect 
style="marker:none;font-variant-east_asian:normal" width="44.446" height="20.911" x=".625" y="291.715" 
rx="10.455" ry="10.073" fill="#e1dedb" stroke="#cdc7c2" stroke-linecap="round" stroke-linejoin="round"/><rect 
ry="10.455" rx="10.455" y="291.715" x=".543" height="20.911" width="21.143" 
style="marker:none;font-variant-east_asian:normal" fill="#f8f7f7" stroke="#aa9f98" stroke-linecap="round" 
stroke-linejoin="round"/><g transform="matrix(.97148 0 0 1 1658.914 -2552.91)" stroke-width="1.015" 
stroke-linecap="round" stroke-linejoin="round"><rect ry="13.17" rx="13.556" y="1234.681" x="-1242.732" 
height="26" width="49.409" style="marker:none" fill="#e1dedb" stroke="#cdc7c2"/><rect style="marker:none" 
width="26.763" height="26" x="-1242.732" y="1234.769" rx="13.511" ry="13.126" fill="#f8f7f7" 
stroke="#aa9f98"/></g><g transform="matrix(.97148 0 0 1 1658.914 -2512.91)" stroke-widt
 h="1.015
 " stroke="#2b73cc"><rect style="marker:none" width="49.409" height="26" x="-1242.732" y="1234.681" 
rx="13.556" ry="13.17" fill="#3081e3"/><rect ry="13.126" rx="13.511" y="1234.769" x="-1220.086" height="26" 
width="26.763" style="marker:none" fill="#f8f7f7" stroke-linecap="round" 
stroke-linejoin="round"/></g></g></svg>
\ No newline at end of file
diff --git a/data/theme/toggle-on-dark.svg b/data/theme/toggle-on-dark.svg
new file mode 100644
index 000000000..b71931ac8
--- /dev/null
+++ b/data/theme/toggle-on-dark.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; width="46" 
height="22"><defs><linearGradient id="a"><stop offset="0" stop-color="#39393a"/><stop offset="1" 
stop-color="#302f30"/></linearGradient><linearGradient xlink:href="#a" id="b" x1="53" y1="294.429" x2="53" 
y2="309.804" gradientUnits="userSpaceOnUse" gradientTransform="translate(-19)"/></defs><g 
transform="translate(0 -291.18)" stroke="#030e1b" stroke-width="1.085"><rect style="marker:none" 
width="44.446" height="20.911" x=".625" y="291.715" rx="10.455" ry="10.073" fill="#15539e"/><rect ry="10.455" 
rx="10.455" y="291.715" x="24.304" height="20.911" width="21.143" style="marker:none" 
fill="url(#b)"/></g></svg>
\ No newline at end of file
diff --git a/data/theme/toggle-on.svg b/data/theme/toggle-on.svg
new file mode 100644
index 000000000..28be67e28
--- /dev/null
+++ b/data/theme/toggle-on.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg"; width="46" height="22"><g transform="translate(0 -291.18)" 
stroke="#2b73cc"><rect style="marker:none;font-variant-east_asian:normal" width="44.446" height="20.911" 
x=".625" y="291.715" rx="10.455" ry="10.073" fill="#3081e3"/><rect ry="10.455" rx="10.455" y="291.715" 
x="24.304" height="20.911" width="21.143" style="marker:none;font-variant-east_asian:normal" fill="#f8f7f7" 
stroke-linecap="round" stroke-linejoin="round"/></g></svg>
\ No newline at end of file


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