[gtk/theme-reorg] widget-factory: Use the new themes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/theme-reorg] widget-factory: Use the new themes
- Date: Fri, 15 Jan 2021 06:08:29 +0000 (UTC)
commit 232c165b628e22b1fe61fce84ba75be2fe1c38f7
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 15 01:07:47 2021 -0500
widget-factory: Use the new themes
Update the Style menu to switch between the variants
of the Default theme.
demos/widget-factory/widget-factory.c | 31 +++++++++----------------------
demos/widget-factory/widget-factory.ui | 16 ++++++++--------
2 files changed, 17 insertions(+), 30 deletions(-)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index 6d022bb203..ed9de763c0 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -48,32 +48,19 @@ change_theme_state (GSimpleAction *action,
GtkSettings *settings = gtk_settings_get_default ();
const char *s;
const char *theme;
- gboolean prefer_dark = FALSE;
g_simple_action_set_state (action, state);
s = g_variant_get_string (state, NULL);
- if (strcmp (s, "adwaita") == 0)
- {
- theme = "Adwaita";
- prefer_dark = FALSE;
- }
- else if (strcmp (s, "adwaita-dark") == 0)
- {
- theme = "Adwaita";
- prefer_dark = TRUE;
- }
- else if (strcmp (s, "highcontrast") == 0)
- {
- theme = "HighContrast";
- prefer_dark = FALSE;
- }
- else if (strcmp (s, "highcontrast-inverse") == 0)
- {
- theme = "HighContrastInverse";
- prefer_dark = FALSE;
- }
+ if (strcmp (s, "default") == 0)
+ theme = "Default";
+ else if (strcmp (s, "dark") == 0)
+ theme = "Default-dark";
+ else if (strcmp (s, "hc") == 0)
+ theme = "Default-hc";
+ else if (strcmp (s, "hc-dark") == 0)
+ theme = "Default-hc-dark";
else if (strcmp (s, "current") == 0)
{
gtk_settings_reset_property (settings, "gtk-theme-name");
@@ -85,7 +72,7 @@ change_theme_state (GSimpleAction *action,
g_object_set (G_OBJECT (settings),
"gtk-theme-name", theme,
- "gtk-application-prefer-dark-theme", prefer_dark,
+ "gtk-application-prefer-dark-theme", FALSE,
NULL);
}
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index 306cbbac42..d55da80c09 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -15,24 +15,24 @@
<attribute name="target">current</attribute>
</item>
<item>
- <attribute name="label" translatable="yes">Adwaita</attribute>
+ <attribute name="label" translatable="yes">Default</attribute>
<attribute name="action">win.theme</attribute>
- <attribute name="target">adwaita</attribute>
+ <attribute name="target">default</attribute>
</item>
<item>
- <attribute name="label" translatable="yes">Adwaita dark</attribute>
+ <attribute name="label" translatable="yes">Dark</attribute>
<attribute name="action">win.theme</attribute>
- <attribute name="target">adwaita-dark</attribute>
+ <attribute name="target">dark</attribute>
</item>
<item>
- <attribute name="label" translatable="yes">High contrast</attribute>
+ <attribute name="label" translatable="yes">Highcontrast</attribute>
<attribute name="action">win.theme</attribute>
- <attribute name="target">highcontrast</attribute>
+ <attribute name="target">hc</attribute>
</item>
<item>
- <attribute name="label" translatable="yes">High contrast inverse</attribute>
+ <attribute name="label" translatable="yes">Highcontrast inverse</attribute>
<attribute name="action">win.theme</attribute>
- <attribute name="target">highcontrast-inverse</attribute>
+ <attribute name="target">hc-dark</attribute>
</item>
</section>
</submenu>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]