[gtk+/gtk-3-22] Revert move of .flat from frame > border to frame



commit 31832f86484430c7ef5759e0427ffb2f8509d4d7
Author: Daniel Boles <dboles src gnome org>
Date:   Sun Mar 5 17:56:23 2017 +0000

    Revert move of .flat from frame > border to frame
    
    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 retains the change in HighContrast of "frame border" to "frame
    > border". Not using the direct child selector contradicted Adwaita &
    could conceivably have unwanted results on nested nodes named border.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778905

 gtk/gtkframe.c                                   |   12 +++++++-----
 gtk/theme/Adwaita/_common.scss                   |    7 ++-----
 gtk/theme/Adwaita/gtk-contained-dark.css         |    7 +++----
 gtk/theme/Adwaita/gtk-contained.css              |    7 +++----
 gtk/theme/HighContrast/_common.scss              |    6 +-----
 gtk/theme/HighContrast/gtk-contained-inverse.css |    7 +++----
 gtk/theme/HighContrast/gtk-contained.css         |    7 +++----
 7 files changed, 22 insertions(+), 31 deletions(-)
---
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index c6e38f9..f5d92de 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -81,9 +81,11 @@
  *
  * 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]);
     }
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index a1f3643..8c0fd64 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -3388,12 +3388,9 @@ frame > border,
   border-radius: 0;
   border: 1px solid $borders_color;
 
-  &:backdrop { border-color: $backdrop_borders_color; }
-}
+  &.flat { border-style: none; }
 
-frame.flat > border,
-.frame.flat {
-  border-style: none;
+  &:backdrop { border-color: $backdrop_borders_color; }
 }
 
 actionbar > revealer >  box {
diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css
index e9141ed..a7e811a 100644
--- a/gtk/theme/Adwaita/gtk-contained-dark.css
+++ b/gtk/theme/Adwaita/gtk-contained-dark.css
@@ -3848,14 +3848,13 @@ frame > border,
   padding: 0;
   border-radius: 0;
   border: 1px solid #1b1f20; }
+  frame > border.flat,
+  .frame.flat {
+    border-style: none; }
   frame > border:backdrop,
   .frame:backdrop {
     border-color: #202425; }
 
-frame.flat > border,
-.frame.flat {
-  border-style: none; }
-
 actionbar > revealer > box {
   padding: 6px;
   border-top: 1px solid #1b1f20; }
diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css
index d72e845..78c5f8a 100644
--- a/gtk/theme/Adwaita/gtk-contained.css
+++ b/gtk/theme/Adwaita/gtk-contained.css
@@ -3879,14 +3879,13 @@ frame > border,
   padding: 0;
   border-radius: 0;
   border: 1px solid #b6b6b3; }
+  frame > border.flat,
+  .frame.flat {
+    border-style: none; }
   frame > border:backdrop,
   .frame:backdrop {
     border-color: #c0c0bd; }
 
-frame.flat > border,
-.frame.flat {
-  border-style: none; }
-
 actionbar > revealer > box {
   padding: 6px;
   border-top: 1px solid #b6b6b3; }
diff --git a/gtk/theme/HighContrast/_common.scss b/gtk/theme/HighContrast/_common.scss
index 09a10be..56cc79f 100644
--- a/gtk/theme/HighContrast/_common.scss
+++ b/gtk/theme/HighContrast/_common.scss
@@ -2579,15 +2579,11 @@ levelbar {
 frame > border,
 .frame {
   border: 1px solid $borders_color;
+  &.flat { border-style: none; }
   &:backdrop { border-color: $backdrop_borders_color; }
   padding: 0;
 }
 
-frame.flat > border,
-.frame.flat {
-  border-style: none;
-}
-
 actionbar > revealer > box {
   padding: 6px;
   border-width: 1px 0 0;
diff --git a/gtk/theme/HighContrast/gtk-contained-inverse.css 
b/gtk/theme/HighContrast/gtk-contained-inverse.css
index b1ead08..7d85af9 100644
--- a/gtk/theme/HighContrast/gtk-contained-inverse.css
+++ b/gtk/theme/HighContrast/gtk-contained-inverse.css
@@ -2616,14 +2616,13 @@ frame > border,
 .frame {
   border: 1px solid gray;
   padding: 0; }
+  frame > border.flat,
+  .frame.flat {
+    border-style: none; }
   frame > border:backdrop,
   .frame:backdrop {
     border-color: #737373; }
 
-frame.flat > border,
-.frame.flat {
-  border-style: none; }
-
 actionbar > revealer > box {
   padding: 6px;
   border-width: 1px 0 0;
diff --git a/gtk/theme/HighContrast/gtk-contained.css b/gtk/theme/HighContrast/gtk-contained.css
index 71f161f..108ba28 100644
--- a/gtk/theme/HighContrast/gtk-contained.css
+++ b/gtk/theme/HighContrast/gtk-contained.css
@@ -2623,14 +2623,13 @@ frame > border,
 .frame {
   border: 1px solid gray;
   padding: 0; }
+  frame > border.flat,
+  .frame.flat {
+    border-style: none; }
   frame > border:backdrop,
   .frame:backdrop {
     border-color: #8d8d8d; }
 
-frame.flat > border,
-.frame.flat {
-  border-style: none; }
-
 actionbar > revealer > box {
   padding: 6px;
   border-width: 1px 0 0;


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