css: adjust priority and remove old css

Also set "devel" css when necessary.
This commit is contained in:
Christian Hergert
2021-10-01 15:01:31 -07:00
parent 24ac040563
commit b59e779dfb
4 changed files with 19 additions and 27 deletions

View File

@ -123,7 +123,7 @@ sysprof_theme_manager_do_reload (gpointer data)
gtk_css_provider_load_from_resource (theme_resource->provider, theme_resource->resource);
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (theme_resource->provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION - 1);
GTK_STYLE_PROVIDER_PRIORITY_THEME+1);
}
}
else

View File

@ -110,9 +110,6 @@ static void
sysprof_application_startup (GApplication *application)
{
g_autoptr(GtkCssProvider) provider = NULL;
#ifdef DEVELOPMENT_BUILD
g_autoptr(GtkCssProvider) adwaita = NULL;
#endif
g_assert (SYSPROF_IS_APPLICATION (application));
@ -122,15 +119,7 @@ sysprof_application_startup (GApplication *application)
gtk_css_provider_load_from_resource (provider, "/org/gnome/sysprof/theme/shared.css");
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
#ifdef DEVELOPMENT_BUILD
adwaita = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (adwaita, "/org/gnome/sysprof/theme/Adwaita-shared.css");
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (adwaita),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
#endif
GTK_STYLE_PROVIDER_PRIORITY_THEME+1);
for (guint i = 0; default_accels[i].action_name; i++)
gtk_application_set_accels_for_action (GTK_APPLICATION (application),
@ -138,14 +127,31 @@ sysprof_application_startup (GApplication *application)
default_accels[i].accels);
}
static void
sysprof_application_window_added (GtkApplication *application,
GtkWindow *window)
{
g_assert (SYSPROF_IS_APPLICATION (application));
g_assert (GTK_IS_WINDOW (window));
#ifdef DEVELOPMENT_BUILD
gtk_widget_add_css_class (GTK_WIDGET (window), "devel");
#endif
GTK_APPLICATION_CLASS (sysprof_application_parent_class)->window_added (application, window);
}
static void
sysprof_application_class_init (SysprofApplicationClass *klass)
{
GApplicationClass *app_class = G_APPLICATION_CLASS (klass);
GtkApplicationClass *gtk_app_class = GTK_APPLICATION_CLASS (klass);
app_class->open = sysprof_application_open;
app_class->startup = sysprof_application_startup;
app_class->activate = sysprof_application_activate;
gtk_app_class->window_added = sysprof_application_window_added;
}
static void

View File

@ -7,7 +7,6 @@
<!-- Theme overrides -->
<file compressed="true">theme/shared.css</file>
<file compressed="true">theme/Adwaita-shared.css</file>
</gresource>
<gresource prefix="/org/gnome/sysprof/ui">

View File

@ -1,16 +1,3 @@
popover list row {
padding: 6px 10px 6px 10px;
border-bottom: 1px solid alpha(@borders, 0.2);
}
popover list row:last-child {
border-bottom: none;
}
popover scrolledwindow {
border-top: 1px solid alpha(@borders, 0.75);
}
visualizers list {
background: @theme_bg_color;
}