From 597d757bf86c37edb31a59ba046af77d0f20ef1a Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Sat, 18 May 2019 13:58:22 -0700 Subject: [PATCH] libsysprof-ui: style environment editor --- .../css/SysprofEnvironEditor-shared.css | 13 +++++++++++++ src/libsysprof-ui/libsysprof-ui.gresource.xml | 1 + src/libsysprof-ui/sysprof-environ-editor.c | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 src/libsysprof-ui/css/SysprofEnvironEditor-shared.css diff --git a/src/libsysprof-ui/css/SysprofEnvironEditor-shared.css b/src/libsysprof-ui/css/SysprofEnvironEditor-shared.css new file mode 100644 index 00000000..89f1ed21 --- /dev/null +++ b/src/libsysprof-ui/css/SysprofEnvironEditor-shared.css @@ -0,0 +1,13 @@ +list.environ-editor row button.flat:last-child { + min-height: 16px; + min-width: 16px; + padding: 0; + margin: 3px; +} +list.environ-editor row button.flat:not(:hover) { + border-color: transparent; +} +list.environ-editor row button.flat image { + padding: 3; + margin: 0; +} diff --git a/src/libsysprof-ui/libsysprof-ui.gresource.xml b/src/libsysprof-ui/libsysprof-ui.gresource.xml index 95849177..1f438231 100644 --- a/src/libsysprof-ui/libsysprof-ui.gresource.xml +++ b/src/libsysprof-ui/libsysprof-ui.gresource.xml @@ -1,6 +1,7 @@ + css/SysprofEnvironEditor-shared.css css/SysprofVisualizerView-shared.css css/SysprofVisualizerView-Adwaita.css css/SysprofVisualizerView-Adwaita-dark.css diff --git a/src/libsysprof-ui/sysprof-environ-editor.c b/src/libsysprof-ui/sysprof-environ-editor.c index 8fe28828..58ef2f60 100644 --- a/src/libsysprof-ui/sysprof-environ-editor.c +++ b/src/libsysprof-ui/sysprof-environ-editor.c @@ -26,6 +26,7 @@ #include "sysprof-environ-editor.h" #include "sysprof-environ-editor-row.h" +#include "sysprof-theme-manager.h" struct _SysprofEnvironEditor { @@ -248,6 +249,7 @@ sysprof_environ_editor_class_init (SysprofEnvironEditorClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkListBoxClass *list_box_class = GTK_LIST_BOX_CLASS (klass); + SysprofThemeManager *theme_manager = sysprof_theme_manager_get_default (); object_class->get_property = sysprof_environ_editor_get_property; object_class->set_property = sysprof_environ_editor_set_property; @@ -264,12 +266,17 @@ sysprof_environ_editor_class_init (SysprofEnvironEditorClass *klass) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_properties (object_class, N_PROPS, properties); + + sysprof_theme_manager_register_resource (theme_manager, NULL, NULL, "/org/gnome/sysprof/css/SysprofEnvironEditor-shared.css"); } static void sysprof_environ_editor_init (SysprofEnvironEditor *self) { gtk_list_box_set_selection_mode (GTK_LIST_BOX (self), GTK_SELECTION_NONE); + + gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self)), + "environ-editor"); } GtkWidget *