From eed2d730bf2338de4a8b546c19782d4c3e4b4d66 Mon Sep 17 00:00:00 2001 From: Jakub Steiner Date: Thu, 30 May 2019 09:38:00 +0200 Subject: [PATCH] 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(-) create mode 100644 data/theme/toggle-off-dark.svg delete mode 100644 data/theme/toggle-off-intl.svg create mode 100644 data/theme/toggle-off.svg create mode 100644 data/theme/toggle-on-dark.svg delete mode 100644 data/theme/toggle-on-intl.svg create mode 100644 data/theme/toggle-on.svg 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 @@ noise-texture.png pad-osd.css process-working.svg - toggle-off-intl.svg + toggle-off.svg + toggle-off-dark.svg toggle-off-hc.svg - toggle-on-intl.svg + toggle-on.svg + toggle-on-dark.svg toggle-on-hc.svg 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 @@ + \ No newline at end of file diff --git a/data/theme/toggle-off-intl.svg b/data/theme/toggle-off-intl.svg deleted file mode 100644 index cb0871277..000000000 --- a/data/theme/toggle-off-intl.svg +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - 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 @@ + \ 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 @@ + \ No newline at end of file diff --git a/data/theme/toggle-on-intl.svg b/data/theme/toggle-on-intl.svg deleted file mode 100644 index 142e0a82a..000000000 --- a/data/theme/toggle-on-intl.svg +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - 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 @@ + \ No newline at end of file