[gtk+] model button: Document iconic layout



commit 86ecdc7a4403c0e0e0355555b71e397f155111d2
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Dec 16 11:37:49 2015 -0500

    model button: Document iconic layout
    
    Document how the CSS nodes look if iconic is TRUE. Add
    a .model style class for this case and use it in Adwaita.

 gtk/gtkmodelbutton.c                     |   12 ++++++++++++
 gtk/theme/Adwaita/_common.scss           |    2 +-
 gtk/theme/Adwaita/gtk-contained-dark.css |    6 +++---
 gtk/theme/Adwaita/gtk-contained.css      |    6 +++---
 4 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index 727ea67..f536afe 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -133,6 +133,16 @@
  *
  * The subnode is positioned before or after the content nodes and gets the
  * .left or .right style class, depending on where it is located.
+ *
+ * |[<!-- language="plain" -->
+ * button.model
+ * ├── <child>
+ * ╰── check
+ * ]|
+ *
+ * Iconic model buttons (see #GtkModelButton::iconic) change the name of
+ * their main node to button and add a .model style class to it. The indicator
+ * subnode is invisible in this case.
  */
 
 struct _GtkModelButton
@@ -435,6 +445,7 @@ gtk_model_button_set_iconic (GtkModelButton *button,
   if (iconic)
     {
       gtk_css_node_set_name (widget_node, I_("button"));
+      gtk_css_gadget_add_class (button->gadget, "model");
       gtk_css_gadget_add_class (button->gadget, "image-button");
       gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NORMAL);
       gtk_css_node_set_visible (indicator_node, FALSE);
@@ -442,6 +453,7 @@ gtk_model_button_set_iconic (GtkModelButton *button,
   else
     {
       gtk_css_node_set_name (widget_node, I_("modelbutton"));
+      gtk_css_gadget_remove_class (button->gadget, "model");
       gtk_css_gadget_remove_class (button->gadget, "image-button");
       gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
       gtk_css_node_set_visible (indicator_node,
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index 94fadad..34c6101 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -1561,7 +1561,7 @@ popover.background {
     transition: none;
   }
 
-  button.image-button {
+  button.model.image-button {
     padding: 0px;
   }
 
diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css
index 840f19e..e60a047 100644
--- a/gtk/theme/Adwaita/gtk-contained-dark.css
+++ b/gtk/theme/Adwaita/gtk-contained-dark.css
@@ -2174,9 +2174,9 @@ popover.background {
   .titlebar popover.background button.titlebutton:hover {
     text-shadow: none;
     transition: none; }
-  popover.background button.image-button, popover.background headerbar button.titlebutton, headerbar 
popover.background button.titlebutton,
-  popover.background .titlebar button.titlebutton,
-  .titlebar popover.background button.titlebutton {
+  popover.background button.model.image-button, popover.background headerbar button.model.titlebutton, 
headerbar popover.background button.model.titlebutton,
+  popover.background .titlebar button.model.titlebutton,
+  .titlebar popover.background button.model.titlebutton {
     padding: 0px; }
   .csd popover.background.touch-selection, .csd popover.background.magnifier, 
popover.background.touch-selection, popover.background.magnifier {
     border: 1px solid rgba(255, 255, 255, 0.1); }
diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css
index d50b5d9..d9d5972 100644
--- a/gtk/theme/Adwaita/gtk-contained.css
+++ b/gtk/theme/Adwaita/gtk-contained.css
@@ -2180,9 +2180,9 @@ popover.background {
   .titlebar popover.background button.titlebutton:hover {
     text-shadow: none;
     transition: none; }
-  popover.background button.image-button, popover.background headerbar button.titlebutton, headerbar 
popover.background button.titlebutton,
-  popover.background .titlebar button.titlebutton,
-  .titlebar popover.background button.titlebutton {
+  popover.background button.model.image-button, popover.background headerbar button.model.titlebutton, 
headerbar popover.background button.model.titlebutton,
+  popover.background .titlebar button.model.titlebutton,
+  .titlebar popover.background button.model.titlebutton {
     padding: 0px; }
   .csd popover.background.touch-selection, .csd popover.background.magnifier, 
popover.background.touch-selection, popover.background.magnifier {
     border: 1px solid rgba(255, 255, 255, 0.1); }


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