Commit e6f15411 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

theme: add fallback css for GpImageMenuItem

parent dfa97eed
......@@ -7,6 +7,7 @@ SUBDIRS = \
EXTRA_DIST = \
common.css \
fallback.css \
$(NULL)
-include $(top_srcdir)/git.mk
.gp-image-menu-item > image {
min-height: 16px;
min-width: 16px;
}
.gp-image-menu-item > image:dir(ltr) {
margin-right: 5px;
}
.gp-image-menu-item > image:dir(rtl) {
margin-left: 5px;
}
panel-toplevel.left gp-applet > menubar > .gp-image-menu-item > image:dir(ltr) {
margin-right: 0px;
margin-top: 5px;
}
panel-toplevel.left gp-applet > menubar > .gp-image-menu-item > image:dir(rtl) {
margin-left: 0px;
margin-bottom: 5px;
}
panel-toplevel.right gp-applet > menubar > .gp-image-menu-item > image:dir(ltr) {
margin-right: 0px;
margin-bottom: 5px;
}
panel-toplevel.right gp-applet > menubar > .gp-image-menu-item > image:dir(rtl) {
margin-left: 0px;
margin-top: 5px;
}
......@@ -58,22 +58,23 @@ theme_changed (GtkSettings *settings,
g_clear_object (&provider);
}
g_object_get (settings, "gtk-theme-name", &theme_name, NULL);
g_object_get (settings,
"gtk-theme-name", &theme_name,
"gtk-application-prefer-dark-theme", &dark_theme,
NULL);
if (g_strcmp0 (theme_name, "Adwaita") != 0 &&
g_strcmp0 (theme_name, "HighContrast") != 0)
{
g_free (theme_name);
return;
priority = GTK_STYLE_PROVIDER_PRIORITY_FALLBACK;
resource = g_strdup ("/org/gnome/gnome-panel/theme/fallback.css");
}
else
{
priority = GTK_STYLE_PROVIDER_PRIORITY_APPLICATION;
resource = g_strdup_printf ("/org/gnome/gnome-panel/theme/%s/gnome-panel%s.css",
theme_name, dark_theme ? "-dark" : "");
}
g_object_get (settings,
"gtk-application-prefer-dark-theme", &dark_theme,
NULL);
priority = GTK_STYLE_PROVIDER_PRIORITY_APPLICATION;
resource = g_strdup_printf ("/org/gnome/gnome-panel/theme/%s/gnome-panel%s.css",
theme_name, dark_theme ? "-dark" : "");
css = gtk_css_provider_new ();
provider = GTK_STYLE_PROVIDER (css);
......
......@@ -6,6 +6,7 @@
<file alias="HighContrast/gnome-panel.css">../data/theme/HighContrast/gnome-panel.css</file>
<file alias="HighContrast/gnome-panel-dark.css">../data/theme/HighContrast/gnome-panel-dark.css</file>
<file alias="common.css">../data/theme/common.css</file>
<file alias="fallback.css">../data/theme/fallback.css</file>
</gresource>
<gresource prefix="/org/gnome/panel">
<file compressed="true">gp-properties-dialog.ui</file>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment