Skip to content

Commit

Permalink
theme: Include both dark and light variant in resource
Browse files Browse the repository at this point in the history
This will allow us to switch between the variants according to
the color-scheme setting.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5545

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2324>
  • Loading branch information
fmuellner committed May 25, 2023
1 parent 4c727b4 commit d76f309
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion data/gnome-shell-theme.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<file>checkbox-off-focused.svg</file>
<file>checkbox-off-light.svg</file>
<file>checkbox-off.svg</file>
<file>gnome-shell.css</file>
<file>gnome-shell-dark.css</file>
<file>gnome-shell-light.css</file>
<file>gnome-shell-high-contrast.css</file>
<file>gnome-shell-start.svg</file>
<file>pad-osd.css</file>
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions data/theme/gnome-shell-light.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$variant: 'light';

@import "gnome-shell-sass/_colors"; //use gtk colors
@import "gnome-shell-sass/_drawing";
@import "gnome-shell-sass/_common";
@import "gnome-shell-sass/_widgets";
6 changes: 4 additions & 2 deletions data/theme/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
theme_sources = files([
'gnome-shell-high-contrast.scss',
'gnome-shell.scss',
'gnome-shell-dark.scss',
'gnome-shell-light.scss',
'gnome-shell-sass/_colors.scss',
'gnome-shell-sass/_common.scss',
'gnome-shell-sass/_drawing.scss',
Expand Down Expand Up @@ -43,7 +44,8 @@ theme_sources = files([

stylesheets = [
'gnome-shell-high-contrast.css',
'gnome-shell.css'
'gnome-shell-dark.css',
'gnome-shell-light.css',
]

foreach stylesheet: stylesheets
Expand Down
2 changes: 1 addition & 1 deletion js/ui/sessionMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (Config.HAVE_NETWORKMANAGER)
const _modes = {
'restrictive': {
parentMode: null,
stylesheetName: 'gnome-shell.css',
stylesheetName: 'gnome-shell-dark.css',
themeResourceName: 'gnome-shell-theme.gresource',
hasOverview: false,
showCalendarEvents: false,
Expand Down
3 changes: 2 additions & 1 deletion meson/generate-stylesheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

stylesheets = [
'data/theme/gnome-shell-high-contrast.css',
'data/theme/gnome-shell.css'
'data/theme/gnome-shell-dark.css',
'data/theme/gnome-shell-light.css'
]

sourceroot = os.environ.get('MESON_SOURCE_ROOT')
Expand Down

0 comments on commit d76f309

Please sign in to comment.