mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
css: adjust priority and remove old css
Also set "devel" css when necessary.
This commit is contained in:
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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">
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user