[gtk+] widget-factory: Add a sidebar example
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget-factory: Add a sidebar example
- Date: Fri, 3 Oct 2014 05:05:33 +0000 (UTC)
commit 3b18ea71c329d921ca9e32ec3c28791b9e0493bb
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Oct 3 01:03:52 2014 -0400
widget-factory: Add a sidebar example
demos/widget-factory/widget-factory.c | 8 ++
demos/widget-factory/widget-factory.ui | 189 ++++++++++++++++++++++++++++++++
2 files changed, 197 insertions(+), 0 deletions(-)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index 3e90033..53a044b 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -851,6 +851,7 @@ activate (GApplication *app)
GtkWidget *stack;
GtkWidget *dialog;
GtkAdjustment *adj;
+ GtkCssProvider *provider;
static GActionEntry win_entries[] = {
{ "dark", NULL, NULL, "false", change_theme_state },
{ "search", activate_search, NULL, NULL, NULL },
@@ -870,6 +871,13 @@ activate (GApplication *app)
g_type_ensure (my_text_view_get_type ());
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider, ".circular-button { border-radius: 20px; outline-radius: 20px;
}", -1, NULL);
+ gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
+ g_object_unref (provider);
+
builder = gtk_builder_new_from_resource ("/org/gtk/WidgetFactory/widget-factory.ui");
gtk_builder_add_callback_symbol (builder, "on_entry_icon_release", (GCallback)on_entry_icon_release);
gtk_builder_add_callback_symbol (builder, "on_scale_button_value_changed",
(GCallback)on_scale_button_value_changed);
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index decb1e2..158f90f 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -3200,6 +3200,7 @@ microphone-sensitivity-medium-symbolic</property>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
+ <property name="spacing">10</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@@ -3313,6 +3314,194 @@ microphone-sensitivity-medium-symbolic</property>
</child>
</object>
</child>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">True</property>
+ <style>
+ <class name="image-button"/>
+ <class name="circular-button"/>
+ </style>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon-size">1</property>
+ <property name="icon-name">emblem-system-symbolic</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkFrame">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <child>
+ <object class="GtkSidebar">
+ <property name="visible">True</property>
+ <property name="stack">sidebar_stack</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkStack" id="sidebar_stack">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="margin">20</property>
+ <property name="spacing">10</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkEntry">
+ <property name="visible">True</property>
+ <property name="placeholder-text">First Name</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEntry">
+ <property name="visible">True</property>
+ <property name="placeholder-text">Last Name</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="name">id</property>
+ <property name="title">Identity</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="margin">20</property>
+ <property name="spacing">10</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkComboBoxText">
+ <property name="visible">True</property>
+ <items>
+ <item>1</item>
+ <item>2</item>
+ <item>3</item>
+ <item>4</item>
+ <item>5</item>
+ <item>6</item>
+ <item>7</item>
+ <item>8</item>
+ <item>9</item>
+ <item>10</item>
+ <item>11</item>
+ <item>12</item>
+ <item>13</item>
+ <item>14</item>
+ <item>15</item>
+ <item>16</item>
+ <item>17</item>
+ <item>18</item>
+ <item>19</item>
+ <item>20</item>
+ <item>21</item>
+ <item>22</item>
+ <item>23</item>
+ <item>24</item>
+ <item>25</item>
+ <item>26</item>
+ <item>27</item>
+ <item>28</item>
+ <item>29</item>
+ <item>30</item>
+ <item>31</item>
+ </items>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBoxText">
+ <property name="visible">True</property>
+ <items>
+ <item>January</item>
+ <item>February</item>
+ <item>March</item>
+ <item>April</item>
+ <item>May</item>
+ <item>June</item>
+ <item>July</item>
+ <item>August</item>
+ <item>September</item>
+ <item>October</item>
+ <item>November</item>
+ <item>December</item>
+ </items>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEntry">
+ <property name="visible">True</property>
+ <property name="placeholder-text">Year</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="name">bd</property>
+ <property name="title">Birthdate</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="margin">20</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="linked"/>
+ </style>
+ <child>
+ <object class="GtkEntry">
+ <property name="visible">True</property>
+ <property name="placeholder-text">Street</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEntry">
+ <property name="visible">True</property>
+ <property name="placeholder-text">City</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEntry">
+ <property name="visible">True</property>
+ <property name="placeholder-text">Province</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="name">ad</property>
+ <property name="title">Address</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]