[gtk+] gtk3-demo: Show more button styles



commit fab9c17b89341c294f69f3d320e87481dbd15301
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 25 22:36:50 2016 -0400

    gtk3-demo: Show more button styles
    
    Add examples for suggested-action and destructive-action
    buttons in the style classes example.

 demos/gtk-demo/theming.ui              |   37 +++++++++++++++++++++++++++++++-
 demos/gtk-demo/theming_style_classes.c |    1 +
 2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/demos/gtk-demo/theming.ui b/demos/gtk-demo/theming.ui
index 7455e6d..617a2f7 100644
--- a/demos/gtk-demo/theming.ui
+++ b/demos/gtk-demo/theming.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <object class="GtkGrid" id="grid">
-    <property name="row-spacing">6</property>
+    <property name="row-spacing">10</property>
     <property name="orientation">vertical</property>
     <child>
       <object class="GtkToolbar">
@@ -271,5 +271,40 @@
         </child>
       </object>
     </child>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">1</property>
+        <property name="spacing">10</property>
+        <property name="orientation">horizontal</property>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Plain</property>
+            <property name="halign">end</property>
+          </object>
+          <packing>
+            <property name="expand">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Destructive</property>
+            <style>
+              <class name="destructive-action"/>
+            </style>
+          </object>
+        </child>
+        <child>
+          <object class="GtkButton">
+            <property name="visible">1</property>
+            <property name="label">Suggested</property>
+            <style>
+              <class name="suggested-action"/>
+            </style>
+          </object>
+        </child>
+      </object>
+    </child>
   </object>
 </interface>
diff --git a/demos/gtk-demo/theming_style_classes.c b/demos/gtk-demo/theming_style_classes.c
index dcb1a90..63fea3b 100644
--- a/demos/gtk-demo/theming_style_classes.c
+++ b/demos/gtk-demo/theming_style_classes.c
@@ -24,6 +24,7 @@ do_theming_style_classes (GtkWidget *do_widget)
       gtk_window_set_screen (GTK_WINDOW (window),
                              gtk_widget_get_screen (do_widget));
       gtk_window_set_title (GTK_WINDOW (window), "Style Classes");
+      gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
       gtk_container_set_border_width (GTK_CONTAINER (window), 12);
       g_signal_connect (window, "destroy",
                         G_CALLBACK (gtk_widget_destroyed), &window);


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