Commit 26698473 authored by Soeren Sandmann's avatar Soeren Sandmann Committed by Søren Sandmann Pedersen

Add new toolbar headers

Wed Jul  2 15:42:26 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtk.h: Add new toolbar headers

	* tests/testtoolbar.c: new file

	* tests/Makefile.am (noinst_PROGRAMS): Add testtoolbar.c

	* gtk/gtkexpander.c (gtk_expander_class_init): Make it compile

Tue Jul  1 22:49:25 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtktoolbar.c:
	(gtk_toolbar_remove_tool_item): Fix bug where list is changed
	inside a for loop (pointed out by Morten Welinder).
	(gtk_toolbar_focus_home_or_end): Minor formatting change

	Comments from Owen:

	* gtk/gtktoolbutton.c: remove copy of elide_underscores(). Use
	gtk_toolbar_elide_underscores instead.

	* gtk/gtktoolbar.c: rename signal from focus_ends to
	focus_home_or_end.
	(_gtk_toolbar_elide_underscores): export this as an internal
	function.
	(gtk_toolbar_move_focus): add comment explaining difference to
	gtk_toolbar_focus();
	(gtk_toolbar_list_children_in_focus_order): Make TAB_FORWARD and
	TAB_BACKWARD focus the right widgets in RTL mode

	* gtk/gtktoolbutton.c (gtk_tool_button_new): Change to take
	"label" and "icon" parameters

	* gtk/gtktoolbutton.[ch]: remove icon_set property.
parent 39f5280d
Wed Jul 2 15:42:26 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtk.h: Add new toolbar headers
* tests/testtoolbar.c: new file
* tests/Makefile.am (noinst_PROGRAMS): Add testtoolbar.c
* gtk/gtkexpander.c (gtk_expander_class_init): Make it compile
Tue Jul 1 22:49:25 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtktoolbar.c:
(gtk_toolbar_remove_tool_item): Fix bug where list is changed
inside a for loop (pointed out by Morten Welinder).
(gtk_toolbar_focus_home_or_end): Minor formatting change
Comments from Owen:
* gtk/gtktoolbutton.c: remove copy of elide_underscores(). Use
gtk_toolbar_elide_underscores instead.
* gtk/gtktoolbar.c: rename signal from focus_ends to
focus_home_or_end.
(_gtk_toolbar_elide_underscores): export this as an internal
function.
(gtk_toolbar_move_focus): add comment explaining difference to
gtk_toolbar_focus();
(gtk_toolbar_list_children_in_focus_order): Make TAB_FORWARD and
TAB_BACKWARD focus the right widgets in RTL mode
* gtk/gtktoolbutton.c (gtk_tool_button_new): Change to take
"label" and "icon" parameters
* gtk/gtktoolbutton.[ch]: remove icon_set property.
2003-07-01 Matthias Clasen <maclas@gmx.de>
* gtk/gtkspinbutton.c (gtk_spin_button_set_digits): Improve docs. (116364, Morten Welinder)
......@@ -64,20 +100,35 @@
Mon Jun 30 01:20:19 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkradiotoolbutton.c
* gtkradiotoolbutton.h
* gtktoggletoolbutton.c
* gtktoggletoolbutton.h
* gtktoolbutton.c
* gtktoolbutton.h
* gtktoolitem.c
* gtktoolitem.h
* gtktoolbar.c
* gtktoolbar.h
* gtkseparatortoolitem.c
* gtkseparatortoolitem.h
* gtkradiotoolbutton.c: new file
* gtkradiotoolbutton.h: "
* gtktoggletoolbutton.c: "
* gtktoggletoolbutton.h: "
* gtktoolbutton.c: "
* gtktoolbutton.h: "
* gtktoolitem.c: "
* gtktoolitem.h: "
* gtktoolbar.c: many changes
* gtktoolbar.h: many changes
* gtkseparatortoolitem.c: new file
* gtkseparatortoolitem.h "
New toolbar.
- Items on a toolbar are now separate widgets, instances of a
subclass of GtkToolItem.
- Items there aren't room for on the toolbar are unmapped, and an
overflow menu with a proxy menu item is added instead.
- The toolbar is keyboard navigatable. Press TAB to focus the
first item, then use arrow keys and Ctrl TAB to move around the
toolbar. TAB moves focus out of the toolbar.
- Bascially all of the old toolbar API is deprecated in favor of
new API in gtktoolbar.h, gtktoolitem.h, gtktoolbutton.h
- The toolbar is backwards compatible with the old toolbar.
2003-06-29 Matthias Clasen <maclas@gmx.de>
......
Wed Jul 2 15:42:26 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtk.h: Add new toolbar headers
* tests/testtoolbar.c: new file
* tests/Makefile.am (noinst_PROGRAMS): Add testtoolbar.c
* gtk/gtkexpander.c (gtk_expander_class_init): Make it compile
Tue Jul 1 22:49:25 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtktoolbar.c:
(gtk_toolbar_remove_tool_item): Fix bug where list is changed
inside a for loop (pointed out by Morten Welinder).
(gtk_toolbar_focus_home_or_end): Minor formatting change
Comments from Owen:
* gtk/gtktoolbutton.c: remove copy of elide_underscores(). Use
gtk_toolbar_elide_underscores instead.
* gtk/gtktoolbar.c: rename signal from focus_ends to
focus_home_or_end.
(_gtk_toolbar_elide_underscores): export this as an internal
function.
(gtk_toolbar_move_focus): add comment explaining difference to
gtk_toolbar_focus();
(gtk_toolbar_list_children_in_focus_order): Make TAB_FORWARD and
TAB_BACKWARD focus the right widgets in RTL mode
* gtk/gtktoolbutton.c (gtk_tool_button_new): Change to take
"label" and "icon" parameters
* gtk/gtktoolbutton.[ch]: remove icon_set property.
2003-07-01 Matthias Clasen <maclas@gmx.de>
* gtk/gtkspinbutton.c (gtk_spin_button_set_digits): Improve docs. (116364, Morten Welinder)
......@@ -64,20 +100,35 @@
Mon Jun 30 01:20:19 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkradiotoolbutton.c
* gtkradiotoolbutton.h
* gtktoggletoolbutton.c
* gtktoggletoolbutton.h
* gtktoolbutton.c
* gtktoolbutton.h
* gtktoolitem.c
* gtktoolitem.h
* gtktoolbar.c
* gtktoolbar.h
* gtkseparatortoolitem.c
* gtkseparatortoolitem.h
* gtkradiotoolbutton.c: new file
* gtkradiotoolbutton.h: "
* gtktoggletoolbutton.c: "
* gtktoggletoolbutton.h: "
* gtktoolbutton.c: "
* gtktoolbutton.h: "
* gtktoolitem.c: "
* gtktoolitem.h: "
* gtktoolbar.c: many changes
* gtktoolbar.h: many changes
* gtkseparatortoolitem.c: new file
* gtkseparatortoolitem.h "
New toolbar.
- Items on a toolbar are now separate widgets, instances of a
subclass of GtkToolItem.
- Items there aren't room for on the toolbar are unmapped, and an
overflow menu with a proxy menu item is added instead.
- The toolbar is keyboard navigatable. Press TAB to focus the
first item, then use arrow keys and Ctrl TAB to move around the
toolbar. TAB moves focus out of the toolbar.
- Bascially all of the old toolbar API is deprecated in favor of
new API in gtktoolbar.h, gtktoolitem.h, gtktoolbutton.h
- The toolbar is backwards compatible with the old toolbar.
2003-06-29 Matthias Clasen <maclas@gmx.de>
......
Wed Jul 2 15:42:26 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtk.h: Add new toolbar headers
* tests/testtoolbar.c: new file
* tests/Makefile.am (noinst_PROGRAMS): Add testtoolbar.c
* gtk/gtkexpander.c (gtk_expander_class_init): Make it compile
Tue Jul 1 22:49:25 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtktoolbar.c:
(gtk_toolbar_remove_tool_item): Fix bug where list is changed
inside a for loop (pointed out by Morten Welinder).
(gtk_toolbar_focus_home_or_end): Minor formatting change
Comments from Owen:
* gtk/gtktoolbutton.c: remove copy of elide_underscores(). Use
gtk_toolbar_elide_underscores instead.
* gtk/gtktoolbar.c: rename signal from focus_ends to
focus_home_or_end.
(_gtk_toolbar_elide_underscores): export this as an internal
function.
(gtk_toolbar_move_focus): add comment explaining difference to
gtk_toolbar_focus();
(gtk_toolbar_list_children_in_focus_order): Make TAB_FORWARD and
TAB_BACKWARD focus the right widgets in RTL mode
* gtk/gtktoolbutton.c (gtk_tool_button_new): Change to take
"label" and "icon" parameters
* gtk/gtktoolbutton.[ch]: remove icon_set property.
2003-07-01 Matthias Clasen <maclas@gmx.de>
* gtk/gtkspinbutton.c (gtk_spin_button_set_digits): Improve docs. (116364, Morten Welinder)
......@@ -64,20 +100,35 @@
Mon Jun 30 01:20:19 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkradiotoolbutton.c
* gtkradiotoolbutton.h
* gtktoggletoolbutton.c
* gtktoggletoolbutton.h
* gtktoolbutton.c
* gtktoolbutton.h
* gtktoolitem.c
* gtktoolitem.h
* gtktoolbar.c
* gtktoolbar.h
* gtkseparatortoolitem.c
* gtkseparatortoolitem.h
* gtkradiotoolbutton.c: new file
* gtkradiotoolbutton.h: "
* gtktoggletoolbutton.c: "
* gtktoggletoolbutton.h: "
* gtktoolbutton.c: "
* gtktoolbutton.h: "
* gtktoolitem.c: "
* gtktoolitem.h: "
* gtktoolbar.c: many changes
* gtktoolbar.h: many changes
* gtkseparatortoolitem.c: new file
* gtkseparatortoolitem.h "
New toolbar.
- Items on a toolbar are now separate widgets, instances of a
subclass of GtkToolItem.
- Items there aren't room for on the toolbar are unmapped, and an
overflow menu with a proxy menu item is added instead.
- The toolbar is keyboard navigatable. Press TAB to focus the
first item, then use arrow keys and Ctrl TAB to move around the
toolbar. TAB moves focus out of the toolbar.
- Bascially all of the old toolbar API is deprecated in favor of
new API in gtktoolbar.h, gtktoolitem.h, gtktoolbutton.h
- The toolbar is backwards compatible with the old toolbar.
2003-06-29 Matthias Clasen <maclas@gmx.de>
......
Wed Jul 2 15:42:26 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtk.h: Add new toolbar headers
* tests/testtoolbar.c: new file
* tests/Makefile.am (noinst_PROGRAMS): Add testtoolbar.c
* gtk/gtkexpander.c (gtk_expander_class_init): Make it compile
Tue Jul 1 22:49:25 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtktoolbar.c:
(gtk_toolbar_remove_tool_item): Fix bug where list is changed
inside a for loop (pointed out by Morten Welinder).
(gtk_toolbar_focus_home_or_end): Minor formatting change
Comments from Owen:
* gtk/gtktoolbutton.c: remove copy of elide_underscores(). Use
gtk_toolbar_elide_underscores instead.
* gtk/gtktoolbar.c: rename signal from focus_ends to
focus_home_or_end.
(_gtk_toolbar_elide_underscores): export this as an internal
function.
(gtk_toolbar_move_focus): add comment explaining difference to
gtk_toolbar_focus();
(gtk_toolbar_list_children_in_focus_order): Make TAB_FORWARD and
TAB_BACKWARD focus the right widgets in RTL mode
* gtk/gtktoolbutton.c (gtk_tool_button_new): Change to take
"label" and "icon" parameters
* gtk/gtktoolbutton.[ch]: remove icon_set property.
2003-07-01 Matthias Clasen <maclas@gmx.de>
* gtk/gtkspinbutton.c (gtk_spin_button_set_digits): Improve docs. (116364, Morten Welinder)
......@@ -64,20 +100,35 @@
Mon Jun 30 01:20:19 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkradiotoolbutton.c
* gtkradiotoolbutton.h
* gtktoggletoolbutton.c
* gtktoggletoolbutton.h
* gtktoolbutton.c
* gtktoolbutton.h
* gtktoolitem.c
* gtktoolitem.h
* gtktoolbar.c
* gtktoolbar.h
* gtkseparatortoolitem.c
* gtkseparatortoolitem.h
* gtkradiotoolbutton.c: new file
* gtkradiotoolbutton.h: "
* gtktoggletoolbutton.c: "
* gtktoggletoolbutton.h: "
* gtktoolbutton.c: "
* gtktoolbutton.h: "
* gtktoolitem.c: "
* gtktoolitem.h: "
* gtktoolbar.c: many changes
* gtktoolbar.h: many changes
* gtkseparatortoolitem.c: new file
* gtkseparatortoolitem.h "
New toolbar.
- Items on a toolbar are now separate widgets, instances of a
subclass of GtkToolItem.
- Items there aren't room for on the toolbar are unmapped, and an
overflow menu with a proxy menu item is added instead.
- The toolbar is keyboard navigatable. Press TAB to focus the
first item, then use arrow keys and Ctrl TAB to move around the
toolbar. TAB moves focus out of the toolbar.
- Bascially all of the old toolbar API is deprecated in favor of
new API in gtktoolbar.h, gtktoolitem.h, gtktoolbutton.h
- The toolbar is backwards compatible with the old toolbar.
2003-06-29 Matthias Clasen <maclas@gmx.de>
......
Wed Jul 2 15:42:26 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtk.h: Add new toolbar headers
* tests/testtoolbar.c: new file
* tests/Makefile.am (noinst_PROGRAMS): Add testtoolbar.c
* gtk/gtkexpander.c (gtk_expander_class_init): Make it compile
Tue Jul 1 22:49:25 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtktoolbar.c:
(gtk_toolbar_remove_tool_item): Fix bug where list is changed
inside a for loop (pointed out by Morten Welinder).
(gtk_toolbar_focus_home_or_end): Minor formatting change
Comments from Owen:
* gtk/gtktoolbutton.c: remove copy of elide_underscores(). Use
gtk_toolbar_elide_underscores instead.
* gtk/gtktoolbar.c: rename signal from focus_ends to
focus_home_or_end.
(_gtk_toolbar_elide_underscores): export this as an internal
function.
(gtk_toolbar_move_focus): add comment explaining difference to
gtk_toolbar_focus();
(gtk_toolbar_list_children_in_focus_order): Make TAB_FORWARD and
TAB_BACKWARD focus the right widgets in RTL mode
* gtk/gtktoolbutton.c (gtk_tool_button_new): Change to take
"label" and "icon" parameters
* gtk/gtktoolbutton.[ch]: remove icon_set property.
2003-07-01 Matthias Clasen <maclas@gmx.de>
* gtk/gtkspinbutton.c (gtk_spin_button_set_digits): Improve docs. (116364, Morten Welinder)
......@@ -64,20 +100,35 @@
Mon Jun 30 01:20:19 2003 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkradiotoolbutton.c
* gtkradiotoolbutton.h
* gtktoggletoolbutton.c
* gtktoggletoolbutton.h
* gtktoolbutton.c
* gtktoolbutton.h
* gtktoolitem.c
* gtktoolitem.h
* gtktoolbar.c
* gtktoolbar.h
* gtkseparatortoolitem.c
* gtkseparatortoolitem.h
* gtkradiotoolbutton.c: new file
* gtkradiotoolbutton.h: "
* gtktoggletoolbutton.c: "
* gtktoggletoolbutton.h: "
* gtktoolbutton.c: "
* gtktoolbutton.h: "
* gtktoolitem.c: "
* gtktoolitem.h: "
* gtktoolbar.c: many changes
* gtktoolbar.h: many changes
* gtkseparatortoolitem.c: new file
* gtkseparatortoolitem.h "
New toolbar.
- Items on a toolbar are now separate widgets, instances of a
subclass of GtkToolItem.
- Items there aren't room for on the toolbar are unmapped, and an
overflow menu with a proxy menu item is added instead.
- The toolbar is keyboard navigatable. Press TAB to focus the
first item, then use arrow keys and Ctrl TAB to move around the
toolbar. TAB moves focus out of the toolbar.
- Bascially all of the old toolbar API is deprecated in favor of
new API in gtktoolbar.h, gtktoolitem.h, gtktoolbutton.h
- The toolbar is backwards compatible with the old toolbar.
2003-06-29 Matthias Clasen <maclas@gmx.de>
......
......@@ -35,18 +35,18 @@
#include <gtk/gtkaccessible.h>
#include <gtk/gtkadjustment.h>
#include <gtk/gtkalignment.h>
#include <gtk/gtkaspectframe.h>
#include <gtk/gtkarrow.h>
#include <gtk/gtkaspectframe.h>
#include <gtk/gtkbbox.h>
#include <gtk/gtkbin.h>
#include <gtk/gtkbindings.h>
#include <gtk/gtkbox.h>
#include <gtk/gtkbbox.h>
#include <gtk/gtkbutton.h>
#include <gtk/gtkcalendar.h>
#include <gtk/gtkcellrenderer.h>
#include <gtk/gtkcellrendererpixbuf.h>
#include <gtk/gtkcellrenderertext.h>
#include <gtk/gtkcellrenderertoggle.h>
#include <gtk/gtkcellrendererpixbuf.h>
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtkcheckmenuitem.h>
#include <gtk/gtkclipboard.h>
......@@ -74,8 +74,8 @@
#include <gtk/gtkgamma.h>
#include <gtk/gtkgc.h>
#include <gtk/gtkhandlebox.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtkhbbox.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtkhpaned.h>
#include <gtk/gtkhruler.h>
#include <gtk/gtkhscale.h>
......@@ -115,6 +115,7 @@
#include <gtk/gtkprogressbar.h>
#include <gtk/gtkradiobutton.h>
#include <gtk/gtkradiomenuitem.h>
#include <gtk/gtkradiotoolbutton.h>
#include <gtk/gtkrange.h>
#include <gtk/gtkrc.h>
#include <gtk/gtkruler.h>
......@@ -124,14 +125,15 @@
#include <gtk/gtkselection.h>
#include <gtk/gtkseparator.h>
#include <gtk/gtkseparatormenuitem.h>
#include <gtk/gtkseparatortoolitem.h>
#include <gtk/gtksettings.h>
#include <gtk/gtksignal.h>
#include <gtk/gtksizegroup.h>
#include <gtk/gtksocket.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtkstatusbar.h>
#include <gtk/gtkstock.h>
#include <gtk/gtkstyle.h>
#include <gtk/gtkstatusbar.h>
#include <gtk/gtktable.h>
#include <gtk/gtktearoffmenuitem.h>
#include <gtk/gtktext.h>
......@@ -139,7 +141,11 @@
#include <gtk/gtktextview.h>
#include <gtk/gtktipsquery.h>
#include <gtk/gtktogglebutton.h>
#include <gtk/gtktoggletoolbutton.h>
#include <gtk/gtktoolbar.h>
#include <gtk/gtktoolbar.h>
#include <gtk/gtktoolbutton.h>
#include <gtk/gtktoolitem.h>
#include <gtk/gtktooltips.h>
#include <gtk/gtktree.h>
#include <gtk/gtktreednd.h>
......@@ -151,8 +157,8 @@
#include <gtk/gtktreeview.h>
#include <gtk/gtktreeviewcolumn.h>
#include <gtk/gtktypeutils.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkvbbox.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkversion.h>
#include <gtk/gtkviewport.h>
#include <gtk/gtkvpaned.h>
......
......@@ -246,9 +246,7 @@ gtk_expander_class_init (GtkExpanderClass *klass)
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkExpanderClass, activate),
NULL, NULL,
_gtk_marsha /**
l_VOID__VOID,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
......
......@@ -78,7 +78,7 @@ enum {
STYLE_CHANGED,
POPUP_CONTEXT_MENU,
MOVE_FOCUS,
FOCUS_ENDS,
FOCUS_HOME_OR_END,
LAST_SIGNAL
};
......@@ -147,10 +147,10 @@ static void gtk_toolbar_real_orientation_changed (GtkToolbar *toolbar,
static void gtk_toolbar_real_style_changed (GtkToolbar *toolbar,
GtkToolbarStyle style);
static gboolean gtk_toolbar_move_focus (GtkToolbar *toolbar,
GtkDirectionType dir);
static gboolean gtk_toolbar_focus_ends (GtkToolbar *toolbar,
gboolean home);
static gboolean gtk_toolbar_move_focus (GtkToolbar *toolbar,
GtkDirectionType dir);
static gboolean gtk_toolbar_focus_home_or_end (GtkToolbar *toolbar,
gboolean focus_home);
static gboolean gtk_toolbar_button_press (GtkWidget *toolbar,
GdkEventButton *event);
......@@ -343,11 +343,11 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
_gtk_marshal_BOOLEAN__ENUM,
G_TYPE_BOOLEAN, 1,
GTK_TYPE_DIRECTION_TYPE);
toolbar_signals[FOCUS_ENDS] =
_gtk_binding_signal_new ("focus_ends",
toolbar_signals[FOCUS_HOME_OR_END] =
_gtk_binding_signal_new ("focus_home_or_end",
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_CALLBACK (gtk_toolbar_focus_ends),
G_CALLBACK (gtk_toolbar_focus_home_or_end),
NULL, NULL,
_gtk_marshal_BOOLEAN__BOOLEAN,
G_TYPE_BOOLEAN, 1,
......@@ -468,20 +468,20 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
add_arrow_bindings (binding_set, GDK_Down, GTK_DIR_DOWN);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, 0,
"focus_ends", 1,
"focus_home_or_end", 1,
G_TYPE_BOOLEAN, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Home, 0,
"focus_ends", 1,
"focus_home_or_end", 1,
G_TYPE_BOOLEAN, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_End, 0,
"focus_ends", 1,
"focus_home_or_end", 1,
G_TYPE_BOOLEAN, FALSE);
gtk_binding_entry_add_signal (binding_set, GDK_End, 0,
"focus_ends", 1,
"focus_home_or_end", 1,
G_TYPE_BOOLEAN, FALSE);
add_ctrl_tab_bindings (binding_set, 0, GTK_DIR_RIGHT);
add_ctrl_tab_bindings (binding_set, GDK_SHIFT_MASK, GTK_DIR_LEFT);
add_ctrl_tab_bindings (binding_set, 0, GTK_DIR_TAB_FORWARD);
add_ctrl_tab_bindings (binding_set, GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
g_type_class_add_private (gobject_class, sizeof (GtkToolbarPrivate));
}
......@@ -1271,7 +1271,10 @@ gtk_toolbar_list_children_in_focus_order (GtkToolbar *toolbar,
GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
GList *result = NULL;
GList *list;
gboolean rtl;
/* generate list of children in reverse logical order */
for (list = priv->items; list != NULL; list = list->next)
{
GtkToolItem *item = list->data;
......@@ -1288,32 +1291,41 @@ gtk_toolbar_list_children_in_focus_order (GtkToolbar *toolbar,
}
result = g_list_prepend (result, priv->arrow_button);
if (dir == GTK_DIR_RIGHT || dir == GTK_DIR_DOWN || dir == GTK_DIR_TAB_FORWARD)
result = g_list_reverse (result);
if (gtk_widget_get_direction (GTK_WIDGET (toolbar)) == GTK_TEXT_DIR_RTL)
result = g_list_reverse (result);
rtl = (gtk_widget_get_direction (GTK_WIDGET (toolbar)) == GTK_TEXT_DIR_RTL);
/* move in logical order when
*
* - dir is TAB_FORWARD
*
* - in RTL mode and moving left or up
*
* - in LTR mode and moving right or down
*/
if (dir == GTK_DIR_TAB_FORWARD ||
(rtl && (dir == GTK_DIR_UP || dir == GTK_DIR_LEFT)) ||
(!rtl && (dir == GTK_DIR_DOWN || dir == GTK_DIR_RIGHT)))
{
result = g_list_reverse (result);
}
return result;
}
static gboolean
gtk_toolbar_focus_ends (GtkToolbar *toolbar,
gboolean home)
gtk_toolbar_focus_home_or_end (GtkToolbar *toolbar,
gboolean focus_home)
{
GList *children, *list;
GtkDirectionType dir = home? GTK_DIR_RIGHT : GTK_DIR_LEFT;
GtkDirectionType dir = focus_home? GTK_DIR_RIGHT : GTK_DIR_LEFT;
children = gtk_toolbar_list_children_in_focus_order (toolbar, dir);
if (gtk_widget_get_direction (GTK_WIDGET (toolbar)) == GTK_TEXT_DIR_RTL)
{
children = g_list_reverse (children);
if (dir == GTK_DIR_RIGHT)
dir = GTK_DIR_LEFT;
else
dir = GTK_DIR_RIGHT;
dir = (dir == GTK_DIR_RIGHT)? GTK_DIR_LEFT : GTK_DIR_RIGHT;
}
for (list = children; list != NULL; list = list->next)
......@@ -1332,13 +1344,25 @@ gtk_toolbar_focus_ends (GtkToolbar *toolbar,
return TRUE;
}
/* Keybinding handler. This function is called when the user presses
* Ctrl TAB or an arrow key.
*/
static gboolean
gtk_toolbar_move_focus (GtkToolbar *toolbar,
GtkDirectionType dir)
{
GList *list;
gboolean try_focus = FALSE;
GList *children = gtk_toolbar_list_children_in_focus_order (toolbar, dir);
GList *children;
GtkContainer *container = GTK_CONTAINER (toolbar);
if (container->focus_child &&
gtk_widget_child_focus (container->focus_child, dir))
{
return TRUE;
}
children = gtk_toolbar_list_children_in_focus_order (toolbar, dir);
for (list = children; list != NULL; list = list->next)
{
......@@ -1356,8 +1380,8 @@ gtk_toolbar_move_focus (GtkToolbar *toolbar,
return TRUE;
}
/* The focus handler for the toolbar. It called when the user presses TAB or otherwise
* tries to focus the toolbar.
/* The focus handler for the toolbar. It called when the user presses
* TAB or otherwise tries to focus the toolbar.
*/
static gboolean
gtk_toolbar_focus (GtkWidget *widget,
......@@ -2078,9 +2102,11 @@ gtk_toolbar_remove_tool_item (GtkToolbar *toolbar,
g_return_if_fail (GTK_IS_TOOL_ITEM (item));
priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
for (tmp = priv->items; tmp != NULL; tmp = tmp->next)
tmp = priv->items;
while (tmp)
{
GList *next = tmp->next;
GtkWidget *child = tmp->data;
if (child == GTK_WIDGET (item))
......@@ -2098,6 +2124,8 @@ gtk_toolbar_remove_tool_item (GtkToolbar *toolbar,
break;
}
tmp = next;
}
}
......@@ -2588,8 +2616,8 @@ gtk_toolbar_insert_element (GtkToolbar *toolbar,
icon, callback, user_data, position, FALSE);
}
static gchar *
elide_underscores (const gchar *original)
gchar *
_gtk_toolbar_elide_underscores (const gchar *original)
{
gchar *q, *result;
const gchar *p;
......@@ -2660,7 +2688,7 @@ gtk_toolbar_internal_insert_element (GtkToolbar *toolbar,
break;
case GTK_TOOLBAR_CHILD_BUTTON:
item = gtk_tool_button_new ();
item = gtk_tool_button_new (NULL, NULL);
child->widget = GTK_TOOL_BUTTON (item)->button;
break;
......@@ -2693,7 +2721,7 @@ gtk_toolbar_internal_insert_element (GtkToolbar *toolbar,
gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON (item), text);
gtk_stock_lookup (text, &stock_item);
label_text = elide_underscores (stock_item.label);
label_text = _gtk_toolbar_elide_underscores (stock_item.label);
child->label = GTK_WIDGET (gtk_label_new (label_text));
g_free (label_text);
}
......
......@@ -157,6 +157,9 @@ GtkIconSize gtk_toolbar_get_icon_size (GtkToolbar *toolbar);
gboolean gtk_toolbar_get_tooltips (GtkToolbar *toolbar);
GtkReliefStyle gtk_toolbar_get_relief_style (GtkToolbar *toolbar);
/* internal function */
gchar * _gtk_toolbar_elide_underscores (const gchar *original);
#ifndef GTK_DISABLE_DEPRECATED
/* Simple button items */
void gtk_toolbar_set_style (GtkToolbar *toolbar,
......
......@@ -30,6 +30,7 @@
#include "gtkstock.h"
#include "gtkvbox.h"
#include "gtkintl.h"
#include "gtktoolbar.h"
#include <string.h>
......@@ -46,7 +47,6 @@ enum {
PROP_USE_UNDERLINE,
PROP_LABEL_WIDGET,
PROP_STOCK_ID,
PROP_ICON_SET,
PROP_ICON_WIDGET,
};
......@@ -157,13 +157,6 @@ gtk_tool_button_class_init (GtkToolButtonClass *klass)
_("The stock icon displayed on the item"),
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_ICON_SET,
g_param_spec_boxed ("icon_set",
_("Icon set"),
_("Icon set to use to draw the item's icon"),
GTK_TYPE_ICON_SET,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_ICON_WIDGET,