summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-10-22 01:11:34 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-10-22 01:13:00 -0400
commit5ee7445048548e34c88b5237891fe46b057794a9 (patch)
tree40691d33cf564ab7030e71e32d6a0e9c384f70e8 /docs
parent247f2c91926e6d090554aac1d0092f044aece790 (diff)
downloadgtk+-5ee7445048548e34c88b5237891fe46b057794a9.tar.gz
Add GtkSidebar to the widget gallery
Diffstat (limited to 'docs')
-rw-r--r--docs/reference/gtk/Makefile.am1
-rw-r--r--docs/reference/gtk/images/sidebar.pngbin8465 -> 4140 bytes
-rw-r--r--docs/tools/widgets.c36
3 files changed, 37 insertions, 0 deletions
diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am
index f1b067d1b5..38bedac91b 100644
--- a/docs/reference/gtk/Makefile.am
+++ b/docs/reference/gtk/Makefile.am
@@ -238,6 +238,7 @@ HTML_IMAGES = \
$(srcdir)/images/search-bar.png \
$(srcdir)/images/search-entry.png \
$(srcdir)/images/separator.png \
+ $(srcdir)/images/sidebar.png \
$(srcdir)/images/spinbutton.png \
$(srcdir)/images/spinner.png \
$(srcdir)/images/stack.png \
diff --git a/docs/reference/gtk/images/sidebar.png b/docs/reference/gtk/images/sidebar.png
index d7be78fc08..ab7700eb88 100644
--- a/docs/reference/gtk/images/sidebar.png
+++ b/docs/reference/gtk/images/sidebar.png
Binary files differ
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index dc455e241b..c6d1afb1e1 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -1387,6 +1387,41 @@ create_stack_switcher (void)
}
static WidgetInfo *
+create_sidebar (void)
+{
+ GtkWidget *stack;
+ GtkWidget *sidebar;
+ GtkWidget *hbox;
+ GtkWidget *view;
+ GtkWidget *frame;
+
+ stack = gtk_stack_new ();
+ gtk_widget_set_size_request (stack, 120, 120);
+ view = gtk_label_new ("Sidebar");
+ gtk_style_context_add_class (gtk_widget_get_style_context (view), "view");
+ gtk_widget_set_halign (view, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (view, GTK_ALIGN_FILL);
+ gtk_widget_show (view);
+ gtk_stack_add_titled (GTK_STACK (stack), view, "page1", "Page 1");
+ view = gtk_text_view_new ();
+ gtk_widget_show (view);
+ gtk_stack_add_titled (GTK_STACK (stack), view, "page2", "Page 2");
+
+ sidebar = gtk_sidebar_new ();
+ gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
+
+ frame = gtk_frame_new (NULL);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+
+ gtk_box_pack_start (GTK_BOX (hbox), sidebar, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), gtk_separator_new (GTK_ORIENTATION_VERTICAL), FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), stack, TRUE, TRUE, 0);
+ gtk_container_add (GTK_CONTAINER (frame), hbox);
+
+ return new_widget_info ("sidebar", frame, ASIS);
+}
+
+static WidgetInfo *
create_list_box (void)
{
GtkWidget *widget;
@@ -1564,6 +1599,7 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_level_bar ());
retval = g_list_prepend (retval, create_info_bar ());
retval = g_list_prepend (retval, create_gl_area ());
+ retval = g_list_prepend (retval, create_sidebar ());
return retval;
}