diff --git a/data/css/style.css b/data/css/style.css index 2bd0fef20af354aca1dee9813179ccf92b613e7d..9fa216d40eb1eed83cc453608d333c683a7c7694 100644 --- a/data/css/style.css +++ b/data/css/style.css @@ -11,6 +11,10 @@ window.educational { background: #faf4f4; } +window.classic { + background: #34385b; +} + /* Scores */ columnview { background: transparent; diff --git a/data/org.gnome.Mahjongg.gschema.xml.in b/data/org.gnome.Mahjongg.gschema.xml.in index 55d101e68ec36641cfd9a71938f9ebdd86cd8330..f9767d823b89a4a2cf6461a1a6529749c3acba22 100644 --- a/data/org.gnome.Mahjongg.gschema.xml.in +++ b/data/org.gnome.Mahjongg.gschema.xml.in @@ -1,5 +1,6 @@ <schemalist> <enum id="@app-id@.BackgroundColor"> + <value nick="classic" value="-1"/> <value nick="system" value="0"/> <value nick="light" value="1"/> <value nick="dark" value="4"/> diff --git a/data/ui/menu.ui b/data/ui/menu.ui index 91a6f947e0488a69928e491c78a8737dd311b846..56fa3fc905ce2fa478838ba54363e55cb6379810 100644 --- a/data/ui/menu.ui +++ b/data/ui/menu.ui @@ -69,6 +69,11 @@ <attribute name="action">app.background-color</attribute> <attribute name="target">dark</attribute> </item> + <item> + <attribute name="label" translatable="yes">Classic</attribute> + <attribute name="action">app.background-color</attribute> + <attribute name="target">classic</attribute> + </item> </section> </submenu> <submenu id="theme_menu"> diff --git a/src/gnome-mahjongg.vala b/src/gnome-mahjongg.vala index 83807f37cd983624661c59f02fedc1ef15e59b34..752b97b27672ec4e096e1e3e7073619429a28eb6 100644 --- a/src/gnome-mahjongg.vala +++ b/src/gnome-mahjongg.vala @@ -163,9 +163,16 @@ public class Mahjongg : Adw.Application { new_game (); } else if (key == "background-color") { + window.remove_css_class ("classic"); + var style_manager = Adw.StyleManager.get_default (); var color_scheme = settings.get_enum ("background-color"); + if (color_scheme < 0) { + window.add_css_class ("classic"); + color_scheme = 0; + } + style_manager.set_color_scheme (color_scheme); } } diff --git a/src/window.vala b/src/window.vala index 563926684d17eedaea0957ede4068e28e9cdfa6f..fe8b2d5d4fbc024bc244ecdd551d3c160ae9a1be 100644 --- a/src/window.vala +++ b/src/window.vala @@ -39,6 +39,7 @@ public class MahjonggWindow : Adw.ApplicationWindow { theme_menu.append_item (menu_item); } + remove_css_class ("background"); if (APP_ID.has_suffix (".Devel")) add_css_class ("devel");