Commit f3110e41 authored by Lars Uebernickel's avatar Lars Uebernickel

Rename GtkSidebar to GtkStackSidebar

GtkSidebar is too generic and doesn't fully convey what the widget does.

https://bugzilla.gnome.org/show_bug.cgi?id=744094
parent ac497c6e
......@@ -19,6 +19,8 @@ Overview of Changes in GTK+ 3.15.5
* GtkScrolledWindow has gained a new ::edge-reached signal, which
triggers when the edge of the scrollable area is reached.
* GtkSidebar was renamed to GtkStackSidebar to better convey what it does
* CSS:
- Performance improvements
......
/* Sidebar
/* Stack Sidebar
*
* GtkSidebar provides an automatic sidebar widget to control navigation
* of a GtkStack object. This widget automatically updates it content
* based on what is presently available in the GtkStack object, and
* using the "title" child property to set the display labels.
* GtkStackSidebar provides an automatic sidebar widget to control
* navigation of a GtkStack object. This widget automatically updates it
* content based on what is presently available in the GtkStack object,
* and using the "title" child property to set the display labels.
*/
#include <glib/gi18n.h>
......@@ -21,7 +21,7 @@ do_sidebar (GtkWidget *do_widget)
GtkWidget *header;
const gchar* pages[] = {
"Welcome to GTK+",
"GtkSidebar Widget",
"GtkStackSidebar Widget",
"Automatic navigation",
"Consistent appearance",
"Scrolling",
......@@ -43,18 +43,18 @@ do_sidebar (GtkWidget *do_widget)
header = gtk_header_bar_new ();
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR(header), TRUE);
gtk_window_set_titlebar (GTK_WINDOW(window), header);
gtk_window_set_title (GTK_WINDOW(window), "Sidebar demo");
gtk_window_set_title (GTK_WINDOW(window), "Stack Sidebar demo");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
sidebar = gtk_sidebar_new ();
sidebar = gtk_stack_sidebar_new ();
gtk_box_pack_start (GTK_BOX (box), sidebar, FALSE, FALSE, 0);
stack = gtk_stack_new ();
gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN);
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
/* Separator between sidebar and stack */
widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
......
......@@ -3400,7 +3400,7 @@ microphone-sensitivity-medium-symbolic</property>
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkSidebar">
<object class="GtkStackSidebar">
<property name="visible">True</property>
<property name="stack">sidebar_stack</property>
</object>
......
......@@ -76,7 +76,7 @@
<xi:include href="xml/gtkflowbox.xml" />
<xi:include href="xml/gtkstack.xml" />
<xi:include href="xml/gtkstackswitcher.xml" />
<xi:include href="xml/gtksidebar.xml" />
<xi:include href="xml/gtkstacksidebar.xml" />
<xi:include href="xml/gtkactionbar.xml" />
<xi:include href="xml/gtkheaderbar.xml" />
<xi:include href="xml/gtkoverlay.xml" />
......
......@@ -8214,24 +8214,24 @@ gtk_gesture_zoom_get_type
</SECTION>
<SECTION>
<FILE>gtksidebar</FILE>
GtkSidebar
GtkSidebarClass
gtk_sidebar_new
gtk_sidebar_set_stack
gtk_sidebar_get_stack
<FILE>gtkstacksidebar</FILE>
GtkStackSidebar
GtkStackSidebarClass
gtk_stack_sidebar_new
gtk_stack_sidebar_set_stack
gtk_stack_sidebar_get_stack
<SUBSECTION Standard>
GTK_TYPE_SIDEBAR
GTK_SIDEBAR
GTK_SIDEBAR_CLASS
GTK_STACK_SIDEBAR
GTK_STACK_SIDEBAR_CLASS
GTK_IS_SIDEBAR
GTK_IS_SIDEBAR_CLASS
GTK_SIDEBAR_GET_CLASS
GTK_STACK_SIDEBAR_GET_CLASS
<SUBSECTION Private>
GtkSidebarPrivate
gtk_sidebar_get_type
GtkStackSidebarPrivate
gtk_stack_sidebar_get_type
</SECTION>
<SECTION>
......
......@@ -173,7 +173,7 @@ gtk_separator_get_type
gtk_separator_menu_item_get_type
gtk_separator_tool_item_get_type
gtk_settings_get_type
gtk_sidebar_get_type
gtk_stack_sidebar_get_type
gtk_size_group_get_type
@ENABLE_ON_X11@gtk_socket_get_type
gtk_spin_button_get_type
......
......@@ -144,7 +144,7 @@
<link linkend="GtkStackSwitcher">
<inlinegraphic fileref="stackswitcher.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkSidebar">
<link linkend="GtkStackSidebar">
<inlinegraphic fileref="sidebar.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkTreeView">
......
......@@ -1407,8 +1407,8 @@ create_sidebar (void)
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));
sidebar = gtk_stack_sidebar_new ();
gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
frame = gtk_frame_new (NULL);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
......
......@@ -269,7 +269,7 @@ gtk_public_h_sources = \
gtkseparatortoolitem.h \
gtksettings.h \
gtkshow.h \
gtksidebar.h \
gtkstacksidebar.h \
gtksizegroup.h \
gtksizerequest.h \
gtksocket.h \
......@@ -787,7 +787,7 @@ gtk_base_c_sources = \
gtksizerequest.c \
gtksizerequestcache.c \
gtkshow.c \
gtksidebar.c \
gtkstacksidebar.c \
gtkspinbutton.c \
gtkspinner.c \
gtkstack.c \
......
......@@ -165,7 +165,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSeparator, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSeparatorMenuItem, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSeparatorToolItem, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSettings, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSidebar, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStackSidebar, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSizeGroup, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSpinButton, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSpinner, g_object_unref)
......
......@@ -184,7 +184,7 @@
#include <gtk/gtkseparatortoolitem.h>
#include <gtk/gtksettings.h>
#include <gtk/gtkshow.h>
#include <gtk/gtksidebar.h>
#include <gtk/gtkstacksidebar.h>
#include <gtk/gtksizegroup.h>
#include <gtk/gtksizerequest.h>
#include <gtk/gtkspinbutton.h>
......
This diff is collapsed.
......@@ -19,8 +19,8 @@
* Ikey Doherty <michael.i.doherty@intel.com>
*/
#ifndef __GTK_SIDEBAR_H__
#define __GTK_SIDEBAR_H__
#ifndef __GTK_STACK_SIDEBAR_H__
#define __GTK_STACK_SIDEBAR_H__
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
......@@ -31,23 +31,23 @@
G_BEGIN_DECLS
#define GTK_TYPE_SIDEBAR (gtk_sidebar_get_type ())
#define GTK_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SIDEBAR, GtkSidebar))
#define GTK_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SIDEBAR))
#define GTK_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SIDEBAR, GtkSidebarClass))
#define GTK_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SIDEBAR))
#define GTK_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SIDEBAR, GtkSidebarClass))
#define GTK_TYPE_STACK_SIDEBAR (gtk_stack_sidebar_get_type ())
#define GTK_STACK_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_STACK_SIDEBAR, GtkStackSidebar))
#define GTK_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_STACK_SIDEBAR))
#define GTK_STACK_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_STACK_SIDEBAR, GtkStackSidebarClass))
#define GTK_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_STACK_SIDEBAR))
#define GTK_STACK_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_STACK_SIDEBAR, GtkStackSidebarClass))
typedef struct _GtkSidebar GtkSidebar;
typedef struct _GtkSidebarPrivate GtkSidebarPrivate;
typedef struct _GtkSidebarClass GtkSidebarClass;
typedef struct _GtkStackSidebar GtkStackSidebar;
typedef struct _GtkStackSidebarPrivate GtkStackSidebarPrivate;
typedef struct _GtkStackSidebarClass GtkStackSidebarClass;
struct _GtkSidebar
struct _GtkStackSidebar
{
GtkBin parent;
};
struct _GtkSidebarClass
struct _GtkStackSidebarClass
{
GtkBinClass parent_class;
......@@ -59,15 +59,15 @@ struct _GtkSidebarClass
};
GDK_AVAILABLE_IN_3_16
GType gtk_sidebar_get_type (void) G_GNUC_CONST;
GType gtk_stack_sidebar_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_16
GtkWidget * gtk_sidebar_new (void);
GtkWidget * gtk_stack_sidebar_new (void);
GDK_AVAILABLE_IN_3_16
void gtk_sidebar_set_stack (GtkSidebar *sidebar,
GtkStack *stack);
void gtk_stack_sidebar_set_stack (GtkStackSidebar *sidebar,
GtkStack *stack);
GDK_AVAILABLE_IN_3_16
GtkStack * gtk_sidebar_get_stack (GtkSidebar *sidebar);
GtkStack * gtk_stack_sidebar_get_stack (GtkStackSidebar *sidebar);
G_END_DECLS
#endif /* __GTK_SIDEBAR_H__ */
#endif /* __GTK_STACK_SIDEBAR_H__ */
......@@ -233,7 +233,7 @@
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkSidebar">
<object class="GtkStackSidebar">
<property name="visible">True</property>
<property name="stack">object_details</property>
</object>
......
......@@ -283,7 +283,7 @@ gtk_OBJECTS = \
gtkseparatortoolitem.obj \
gtksettings.obj \
gtkshow.obj \
gtksidebar.obj \
gtkstacksidebar.obj \
gtksizegroup.obj \
gtksizerequest.obj \
gtkspinbutton.obj \
......@@ -476,7 +476,7 @@ gtk_public_h_sources = \
gtkseparatortoolitem.h \
gtksettings.h \
gtkshow.h \
gtksidebar.h \
gtkstacksidebar.h \
gtksizegroup.h \
gtksizerequest.h \
gtksocket.h \
......
......@@ -230,7 +230,7 @@ gtk/gtkselection.c
gtk/gtkseparator.c
gtk/gtkseparatortoolitem.c
gtk/gtksettings.c
gtk/gtksidebar.c
gtk/gtkstacksidebar.c
gtk/gtksizegroup.c
gtk/gtksocket.c
gtk/gtkspinbutton.c
......
......@@ -231,7 +231,7 @@ gtk/gtkselection.c
gtk/gtkseparator.c
gtk/gtkseparatortoolitem.c
gtk/gtksettings.c
gtk/gtksidebar.c
gtk/gtkstacksidebar.c
gtk/gtksizegroup.c
gtk/gtksizerequest.c
gtk/gtksocket.c
......
......@@ -137,8 +137,8 @@ main (gint argc,
gtk_widget_set_halign (stack, GTK_ALIGN_START);
/* Add sidebar before stack */
sidebar = gtk_sidebar_new ();
gtk_sidebar_set_stack (GTK_SIDEBAR (sidebar), GTK_STACK (stack));
sidebar = gtk_stack_sidebar_new ();
gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack));
layout = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (layout), sidebar, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (layout), stack, TRUE, TRUE, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment