Revert move of .flat from frame > border to frame
authorDaniel Boles <dboles@src.gnome.org>
Sun, 5 Mar 2017 20:19:04 +0000 (20:19 +0000)
committerMichael Biebl <biebl@debian.org>
Tue, 14 Mar 2017 00:38:30 +0000 (00:38 +0000)
Changing code to agree with docs, which said frame.flat, was backwards.
Mea culpa. Theme authors ran with the actual behaviour, not the docs. As
stability is more important, let’s go back to frame > border.flat, and
fix the docs to reflect what the code does and how to set .flat in code.

N.B. This drops the > from the frame border selector in the CSS files,
because in the patches being reverted here, that was only changed in the
generated CSS files, not the source SCSS. It is more correct not to
include that change in the CSS files until it reaches their source SCSS.

https://bugzilla.gnome.org/show_bug.cgi?id=778905

Gbp-Pq: Name Revert-move-of-.flat-from-frame-border-to-frame.patch

gtk/gtkframe.c
gtk/theme/Adwaita/gtk-contained-dark.css
gtk/theme/Adwaita/gtk-contained.css
gtk/theme/HighContrast/gtk-contained-inverse.css
gtk/theme/HighContrast/gtk-contained.css

index c6e38f980c5b0a61c83753a40d2c581b02312973..f5d92de774785f81bfbdcc8a8910a81d4fc00800 100644 (file)
  *
  * GtkFrame has a main CSS node with name frame and a subnode with
  * name border. The border node is used to render the visible border.
- * The main frame node can be given the style class .flat, which disables
- * drawing of the border, equivalent to calling gtk_frame_set_shadow_type() with
- * GTK_SHADOW_NONE.
+ *
+ * The border node can be given the style class .flat, which is used by themes
+ * to disable drawing of the border. To do this from code, call
+ * gtk_frame_set_shadow_type() with GTK_SHADOW_NONE to add the .flat class or
+ * any other shadow type to remove it.
  */
 
 
@@ -684,9 +686,9 @@ gtk_frame_set_shadow_type (GtkFrame      *frame,
       priv->shadow_type = type;
 
       if (type == GTK_SHADOW_NONE)
-        gtk_css_gadget_add_class (priv->gadget, GTK_STYLE_CLASS_FLAT);
+        gtk_css_gadget_add_class (priv->border_gadget, GTK_STYLE_CLASS_FLAT);
       else
-        gtk_css_gadget_remove_class (priv->gadget, GTK_STYLE_CLASS_FLAT);
+        gtk_css_gadget_remove_class (priv->border_gadget, GTK_STYLE_CLASS_FLAT);
 
       g_object_notify_by_pspec (G_OBJECT (frame), frame_props[PROP_SHADOW_TYPE]);
     }
index 5f68aec24728f4ace8b06c1c52fcfcd3e5c72e80..da5c453d4087b7e5bf8b46aee573e23e4167f8bf 100644 (file)
@@ -3789,7 +3789,7 @@ frame > border,
   padding: 0;
   border-radius: 0;
   border: 1px solid #1b1f20; }
-  frame.flat > border,
+  frame > border.flat,
   .frame.flat {
     border-style: none; }
   frame > border:backdrop,
index 7830a16779d0db4c1d2a76ae502a0f14622274dd..c0f43698d0faa80e970d94d5141579955e2fcd25 100644 (file)
@@ -3820,7 +3820,7 @@ frame > border,
   padding: 0;
   border-radius: 0;
   border: 1px solid #b6b6b3; }
-  frame.flat > border,
+  frame > border.flat,
   .frame.flat {
     border-style: none; }
   frame > border:backdrop,
index 0a6dea1564d37e25c4b99594fee3f0dbf8e2847e..da9ab5bc243343f1ee451307b267578773241ce7 100644 (file)
@@ -2616,7 +2616,7 @@ frame border,
 .frame {
   border: 1px solid gray;
   padding: 0; }
-  frame.flat > border,
+  frame border.flat,
   .frame.flat {
     border-style: none; }
   frame border:backdrop,
index 8adbd5a957a6d682c5afd84dd1385004aedcaaf1..045cc08885d110c000edae979907f1eafe6bf048 100644 (file)
@@ -2623,7 +2623,7 @@ frame border,
 .frame {
   border: 1px solid gray;
   padding: 0; }
-  frame.flat > border,
+  frame border.flat,
   .frame.flat {
     border-style: none; }
   frame border:backdrop,