[metacity] theme: Set object-name on style contexts



commit e2e9529e7ac1b160b4fb42ff1bfd2412fbabbebc
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Oct 27 09:18:32 2015 +0100

    theme: Set object-name on style contexts
    
    The default theme started to use them in GTK+ commit 371f50, so
    we need to update the style contexts to keep matching the style
    of client-side decorations.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757101

 src/ui/theme.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 362833d..f0dcd7c 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -5991,6 +5991,7 @@ static GtkStyleContext *
 create_style_context (GType            widget_type,
                       GtkStyleContext *parent_style,
                       GtkCssProvider  *provider,
+                      const char      *object_name,
                       const char      *first_class,
                       ...)
 {
@@ -6009,6 +6010,9 @@ create_style_context (GType            widget_type,
 
   gtk_widget_path_append_type (path, widget_type);
 
+  if (object_name)
+    gtk_widget_path_iter_set_object_name (path, -1, object_name);
+
   va_start (ap, first_class);
   for (name = first_class; name; name = va_arg (ap, const char *))
     gtk_widget_path_iter_add_class (path, -1, name);
@@ -6051,6 +6055,7 @@ meta_theme_create_style_info (GdkScreen   *screen,
     create_style_context (META_TYPE_FRAMES,
                           NULL,
                           provider,
+                          "decoration",
                           GTK_STYLE_CLASS_BACKGROUND,
                           "window-frame",
                           compositing_manager ? "ssd" : "solid-csd",
@@ -6059,6 +6064,7 @@ meta_theme_create_style_info (GdkScreen   *screen,
     create_style_context (GTK_TYPE_HEADER_BAR,
                           style_info->styles[META_STYLE_ELEMENT_FRAME],
                           provider,
+                          NULL,
                           GTK_STYLE_CLASS_TITLEBAR,
                           GTK_STYLE_CLASS_HORIZONTAL,
                           "default-decoration",
@@ -6068,12 +6074,14 @@ meta_theme_create_style_info (GdkScreen   *screen,
     create_style_context (GTK_TYPE_LABEL,
                           style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
                           provider,
+                          NULL,
                           GTK_STYLE_CLASS_TITLE,
                           NULL);
   style_info->styles[META_STYLE_ELEMENT_BUTTON] =
     create_style_context (GTK_TYPE_BUTTON,
                           style_info->styles[META_STYLE_ELEMENT_TITLEBAR],
                           provider,
+                          NULL,
                           GTK_STYLE_CLASS_BUTTON,
                           "titlebutton",
                           NULL);
@@ -6081,6 +6089,7 @@ meta_theme_create_style_info (GdkScreen   *screen,
     create_style_context (GTK_TYPE_IMAGE,
                           style_info->styles[META_STYLE_ELEMENT_BUTTON],
                           provider,
+                          NULL,
                           NULL);
 
   return style_info;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]