Skip to content

Commit

Permalink
gtk3, gtk4: Install gtk-dark.css for Arc-Dark
Browse files Browse the repository at this point in the history
With the new "dark style preference" introduced with GNOME 42, when
dark style is requested while using a theme that doesn't have a
gtk-dark.css, GTK will use the default dark theme Adwaita-Dark,
instead of falling back to just using the non-dark version of the
selected theme, which was the old behavior when applications
requested dark theme. Fix this situation in Arc-Dark by adding the
gtk-dark.css files just like with other variants.

Fixes: #180
  • Loading branch information
jnsh committed Apr 7, 2022
1 parent 1491458 commit 73ada85
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
18 changes: 8 additions & 10 deletions common/gtk-3.0/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,14 @@ foreach variant : get_option('variants')
rename : ['gtk.css']
)

if variant != 'dark'
#FIXME gtk-dark.css gets overwritten for subsequent variants, resulting in build warnings
gtk3_dark_css = configure_file(
capture : true,
command : ['echo', '@import url("resource:https:///org/gnome/arc-theme/' + output_css_dark + '");'],
output : 'gtk-dark.css',
install : true,
install_dir : prefix / install_dir.get(variant) / common_dirs.get('gtk3')
)
endif
#FIXME gtk-dark.css gets overwritten for subsequent variants, resulting in build warnings
gtk3_dark_css = configure_file(
capture : true,
command : ['echo', '@import url("resource:https:///org/gnome/arc-theme/' + output_css_dark + '");'],
output : 'gtk-dark.css',
install : true,
install_dir : prefix / install_dir.get(variant) / common_dirs.get('gtk3')
)

# install thumbnail
install_data(
Expand Down
18 changes: 8 additions & 10 deletions common/gtk-4.0/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,12 @@ foreach variant : get_option('variants')
rename : ['gtk.css']
)

if variant != 'dark'
#FIXME gtk-dark.css gets overwritten for subsequent variants, resulting in build warnings
gtk4_dark_css = configure_file(
capture : true,
command : ['echo', '@import url("resource:https:///org/gnome/arc-theme/' + output_css_dark + '");'],
output : 'gtk-dark.css',
install : true,
install_dir : prefix / install_dir.get(variant) / common_dirs.get('gtk4')
)
endif
#FIXME gtk-dark.css gets overwritten for subsequent variants, resulting in build warnings
gtk4_dark_css = configure_file(
capture : true,
command : ['echo', '@import url("resource:https:///org/gnome/arc-theme/' + output_css_dark + '");'],
output : 'gtk-dark.css',
install : true,
install_dir : prefix / install_dir.get(variant) / common_dirs.get('gtk4')
)
endforeach

0 comments on commit 73ada85

Please sign in to comment.