summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog26
-rw-r--r--ChangeLog.pre-2-1026
-rw-r--r--ChangeLog.pre-2-426
-rw-r--r--ChangeLog.pre-2-626
-rw-r--r--ChangeLog.pre-2-826
-rw-r--r--gtk/gtkcheckmenuitem.c95
-rw-r--r--gtk/gtkcheckmenuitem.h11
-rw-r--r--gtk/gtkradiomenuitem.c80
-rw-r--r--gtk/gtktoggletoolbutton.c33
-rw-r--r--gtk/gtktoolbar.c57
-rw-r--r--gtk/gtktoolbutton.c2
11 files changed, 287 insertions, 121 deletions
diff --git a/ChangeLog b/ChangeLog
index 029c9b8544..d3905424db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+Fri Aug 29 20:32:07 2003 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * gtk/gtktoolbar.c: Only treat buttons as homogeneous when they
+ are narrower than 13 time the estimated character width of the
+ font. (#107781, David Bordoley)
+
+ * gtk/gtktoggletoolbutton.c (gtk_toggle_tool_button_init): Check
+ here if the GtkToggleButton is active. This may be the case if it
+ is a radio button.
+
+ * gtk/gtktoolbar.c: Clarify documentation wrt. GtkSignalFunc
+ vs. void (*) (GtkWidget, gpointer). (#107495, Mariano
+ Suarez-Alvarez).
+
+ * gtk/gtkcheckmenuitem.[ch]: new "draw_as_radio"
+ property. (#111207, David Bordoley).
+
+ * gtk/gtktoggletoolbutton.c
+ (gtk_toggle_tool_button_create_menu_proxy): use new
+ "draw_as_radio" property on the menu item when the item is a radio
+ tool button
+
+ * gtk/gtktoolbutton.c (gtk_tool_button_create_menu_proxy): Fixes
+ to only pay attention to the "use_underline" property when the
+ button label comes from the "label" property.
+
2003-08-29 Laurent Dhima <laurenti@alblinux.net>
* configure.in: Added "sq" to ALL_LINGUAS.
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 029c9b8544..d3905424db 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,29 @@
+Fri Aug 29 20:32:07 2003 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * gtk/gtktoolbar.c: Only treat buttons as homogeneous when they
+ are narrower than 13 time the estimated character width of the
+ font. (#107781, David Bordoley)
+
+ * gtk/gtktoggletoolbutton.c (gtk_toggle_tool_button_init): Check
+ here if the GtkToggleButton is active. This may be the case if it
+ is a radio button.
+
+ * gtk/gtktoolbar.c: Clarify documentation wrt. GtkSignalFunc
+ vs. void (*) (GtkWidget, gpointer). (#107495, Mariano
+ Suarez-Alvarez).
+
+ * gtk/gtkcheckmenuitem.[ch]: new "draw_as_radio"
+ property. (#111207, David Bordoley).
+
+ * gtk/gtktoggletoolbutton.c
+ (gtk_toggle_tool_button_create_menu_proxy): use new
+ "draw_as_radio" property on the menu item when the item is a radio
+ tool button
+
+ * gtk/gtktoolbutton.c (gtk_tool_button_create_menu_proxy): Fixes
+ to only pay attention to the "use_underline" property when the
+ button label comes from the "label" property.
+
2003-08-29 Laurent Dhima <laurenti@alblinux.net>
* configure.in: Added "sq" to ALL_LINGUAS.
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 029c9b8544..d3905424db 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,29 @@
+Fri Aug 29 20:32:07 2003 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * gtk/gtktoolbar.c: Only treat buttons as homogeneous when they
+ are narrower than 13 time the estimated character width of the
+ font. (#107781, David Bordoley)
+
+ * gtk/gtktoggletoolbutton.c (gtk_toggle_tool_button_init): Check
+ here if the GtkToggleButton is active. This may be the case if it
+ is a radio button.
+
+ * gtk/gtktoolbar.c: Clarify documentation wrt. GtkSignalFunc
+ vs. void (*) (GtkWidget, gpointer). (#107495, Mariano
+ Suarez-Alvarez).
+
+ * gtk/gtkcheckmenuitem.[ch]: new "draw_as_radio"
+ property. (#111207, David Bordoley).
+
+ * gtk/gtktoggletoolbutton.c
+ (gtk_toggle_tool_button_create_menu_proxy): use new
+ "draw_as_radio" property on the menu item when the item is a radio
+ tool button
+
+ * gtk/gtktoolbutton.c (gtk_tool_button_create_menu_proxy): Fixes
+ to only pay attention to the "use_underline" property when the
+ button label comes from the "label" property.
+
2003-08-29 Laurent Dhima <laurenti@alblinux.net>
* configure.in: Added "sq" to ALL_LINGUAS.
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 029c9b8544..d3905424db 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,29 @@
+Fri Aug 29 20:32:07 2003 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * gtk/gtktoolbar.c: Only treat buttons as homogeneous when they
+ are narrower than 13 time the estimated character width of the
+ font. (#107781, David Bordoley)
+
+ * gtk/gtktoggletoolbutton.c (gtk_toggle_tool_button_init): Check
+ here if the GtkToggleButton is active. This may be the case if it
+ is a radio button.
+
+ * gtk/gtktoolbar.c: Clarify documentation wrt. GtkSignalFunc
+ vs. void (*) (GtkWidget, gpointer). (#107495, Mariano
+ Suarez-Alvarez).
+
+ * gtk/gtkcheckmenuitem.[ch]: new "draw_as_radio"
+ property. (#111207, David Bordoley).
+
+ * gtk/gtktoggletoolbutton.c
+ (gtk_toggle_tool_button_create_menu_proxy): use new
+ "draw_as_radio" property on the menu item when the item is a radio
+ tool button
+
+ * gtk/gtktoolbutton.c (gtk_tool_button_create_menu_proxy): Fixes
+ to only pay attention to the "use_underline" property when the
+ button label comes from the "label" property.
+
2003-08-29 Laurent Dhima <laurenti@alblinux.net>
* configure.in: Added "sq" to ALL_LINGUAS.
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 029c9b8544..d3905424db 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,29 @@
+Fri Aug 29 20:32:07 2003 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * gtk/gtktoolbar.c: Only treat buttons as homogeneous when they
+ are narrower than 13 time the estimated character width of the
+ font. (#107781, David Bordoley)
+
+ * gtk/gtktoggletoolbutton.c (gtk_toggle_tool_button_init): Check
+ here if the GtkToggleButton is active. This may be the case if it
+ is a radio button.
+
+ * gtk/gtktoolbar.c: Clarify documentation wrt. GtkSignalFunc
+ vs. void (*) (GtkWidget, gpointer). (#107495, Mariano
+ Suarez-Alvarez).
+
+ * gtk/gtkcheckmenuitem.[ch]: new "draw_as_radio"
+ property. (#111207, David Bordoley).
+
+ * gtk/gtktoggletoolbutton.c
+ (gtk_toggle_tool_button_create_menu_proxy): use new
+ "draw_as_radio" property on the menu item when the item is a radio
+ tool button
+
+ * gtk/gtktoolbutton.c (gtk_tool_button_create_menu_proxy): Fixes
+ to only pay attention to the "use_underline" property when the
+ button label comes from the "label" property.
+
2003-08-29 Laurent Dhima <laurenti@alblinux.net>
* configure.in: Added "sq" to ALL_LINGUAS.
diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c
index 26f1b2a46b..7902944f67 100644
--- a/gtk/gtkcheckmenuitem.c
+++ b/gtk/gtkcheckmenuitem.c
@@ -39,7 +39,8 @@ enum {
enum {
PROP_0,
PROP_ACTIVE,
- PROP_INCONSISTENT
+ PROP_INCONSISTENT,
+ PROP_DRAW_AS_RADIO
};
static void gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass);
@@ -127,6 +128,14 @@ gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
FALSE,
G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_INCONSISTENT,
+ g_param_spec_boolean ("draw_as_radio",
+ _("Draw as radio menu item"),
+ _("Whether the menu item looks like a radio menu item"),
+ FALSE,
+ G_PARAM_READWRITE));
+
widget_class->expose_event = gtk_check_menu_item_expose;
menu_item_class->activate = gtk_check_menu_item_activate;
@@ -306,6 +315,48 @@ gtk_check_menu_item_get_inconsistent (GtkCheckMenuItem *check_menu_item)
return check_menu_item->inconsistent;
}
+/**
+ * gtk_check_menu_item_set_draw_as_radio:
+ * @check_menu_item: a #GtkCheckMenuItem
+ * @draw_as_radio: whether @check_menu_item is drawn like a #GtkRadioMenuItem
+ *
+ * Sets whether @check_menu_item is drawn like a #GtkRadioMenuItem
+ *
+ **/
+void
+gtk_check_menu_item_set_draw_as_radio (GtkCheckMenuItem *check_menu_item,
+ gboolean draw_as_radio)
+{
+ g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item));
+
+ draw_as_radio = draw_as_radio != FALSE;
+
+ if (draw_as_radio != check_menu_item->draw_as_radio)
+ {
+ check_menu_item->draw_as_radio = draw_as_radio;
+
+ gtk_widget_queue_draw (GTK_WIDGET (check_menu_item));
+
+ g_object_notify (G_OBJECT (check_menu_item), "draw_as_radio");
+ }
+}
+
+/**
+ * gtk_check_menu_item_get_draw_as_radio:
+ * @check_menu_item: a #GtkCheckMenuItem
+ *
+ * Returns whether @check_menu_item looks like a #GtkRadioMenuItem
+ *
+ * Return value: Whether @check_menu_item looks like a #GtkRadioMenuItem
+ **/
+gboolean
+gtk_check_menu_item_get_draw_as_radio (GtkCheckMenuItem *check_menu_item)
+{
+ g_return_val_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item), FALSE);
+
+ return check_menu_item->draw_as_radio;
+}
+
static void
gtk_check_menu_item_init (GtkCheckMenuItem *check_menu_item)
{
@@ -398,34 +449,30 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
{
state_type = GTK_WIDGET_STATE (widget);
- if (check_menu_item->always_show_toggle)
+ if (check_menu_item->inconsistent)
+ shadow_type = GTK_SHADOW_ETCHED_IN;
+ else if (check_menu_item->active)
+ shadow_type = GTK_SHADOW_IN;
+ else
+ shadow_type = GTK_SHADOW_OUT;
+
+ if (!GTK_WIDGET_IS_SENSITIVE (widget))
+ state_type = GTK_STATE_INSENSITIVE;
+
+ if (check_menu_item->draw_as_radio)
{
- shadow_type = GTK_SHADOW_OUT;
- if (check_menu_item->active)
- shadow_type = GTK_SHADOW_IN;
+ gtk_paint_option (widget->style, widget->window,
+ state_type, shadow_type,
+ area, widget, "option",
+ x, y, width, height);
}
else
{
- shadow_type = GTK_SHADOW_IN;
- if (check_menu_item->active &&
- (state_type == GTK_STATE_PRELIGHT))
- shadow_type = GTK_SHADOW_OUT;
+ gtk_paint_check (widget->style, widget->window,
+ state_type, shadow_type,
+ area, widget, "check",
+ x, y, width, height);
}
-
- if (check_menu_item->inconsistent)
- {
- shadow_type = GTK_SHADOW_ETCHED_IN;
- if (state_type == GTK_STATE_ACTIVE)
- state_type = GTK_STATE_NORMAL;
- }
-
- if (!GTK_WIDGET_IS_SENSITIVE (widget))
- state_type = GTK_STATE_INSENSITIVE;
-
- gtk_paint_check (widget->style, widget->window,
- state_type, shadow_type,
- area, widget, "check",
- x, y, width, height);
}
}
}
diff --git a/gtk/gtkcheckmenuitem.h b/gtk/gtkcheckmenuitem.h
index cdf16ce2f1..3572b7708a 100644
--- a/gtk/gtkcheckmenuitem.h
+++ b/gtk/gtkcheckmenuitem.h
@@ -55,6 +55,7 @@ struct _GtkCheckMenuItem
guint active : 1;
guint always_show_toggle : 1;
guint inconsistent : 1;
+ guint draw_as_radio : 1;
};
struct _GtkCheckMenuItemClass
@@ -74,17 +75,21 @@ struct _GtkCheckMenuItemClass
GType gtk_check_menu_item_get_type (void) G_GNUC_CONST;
+
GtkWidget* gtk_check_menu_item_new (void);
GtkWidget* gtk_check_menu_item_new_with_label (const gchar *label);
GtkWidget* gtk_check_menu_item_new_with_mnemonic (const gchar *label);
void gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item,
- gboolean is_active);
+ gboolean is_active);
gboolean gtk_check_menu_item_get_active (GtkCheckMenuItem *check_menu_item);
void gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item);
void gtk_check_menu_item_set_inconsistent (GtkCheckMenuItem *check_menu_item,
- gboolean setting);
+ gboolean setting);
gboolean gtk_check_menu_item_get_inconsistent (GtkCheckMenuItem *check_menu_item);
-
+void gtk_check_menu_item_set_draw_as_radio (GtkCheckMenuItem *check_menu_item,
+ gboolean draw_radio_indicator);
+gboolean gtk_check_menu_item_get_draw_as_radio (GtkCheckMenuItem *check_menu_item);
+
#ifndef GTK_DISABLE_DEPRECATED
void gtk_check_menu_item_set_show_toggle (GtkCheckMenuItem *menu_item,
diff --git a/gtk/gtkradiomenuitem.c b/gtk/gtkradiomenuitem.c
index 4d7ba5f7fa..2662923353 100644
--- a/gtk/gtkradiomenuitem.c
+++ b/gtk/gtkradiomenuitem.c
@@ -32,8 +32,6 @@ static void gtk_radio_menu_item_class_init (GtkRadioMenuItemClass *klass);
static void gtk_radio_menu_item_init (GtkRadioMenuItem *radio_menu_item);
static void gtk_radio_menu_item_destroy (GtkObject *object);
static void gtk_radio_menu_item_activate (GtkMenuItem *menu_item);
-static void gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
- GdkRectangle *area);
static GtkCheckMenuItemClass *parent_class = NULL;
@@ -185,25 +183,22 @@ gtk_radio_menu_item_class_init (GtkRadioMenuItemClass *klass)
{
GtkObjectClass *object_class;
GtkMenuItemClass *menu_item_class;
- GtkCheckMenuItemClass *check_menu_item_class;
object_class = (GtkObjectClass*) klass;
menu_item_class = (GtkMenuItemClass*) klass;
- check_menu_item_class = (GtkCheckMenuItemClass*) klass;
parent_class = g_type_class_peek_parent (klass);
object_class->destroy = gtk_radio_menu_item_destroy;
menu_item_class->activate = gtk_radio_menu_item_activate;
-
- check_menu_item_class->draw_indicator = gtk_radio_menu_item_draw_indicator;
}
static void
gtk_radio_menu_item_init (GtkRadioMenuItem *radio_menu_item)
{
radio_menu_item->group = g_slist_prepend (NULL, radio_menu_item);
+ gtk_check_menu_item_set_draw_as_radio (GTK_CHECK_MENU_ITEM (radio_menu_item), TRUE);
}
static void
@@ -294,77 +289,6 @@ gtk_radio_menu_item_activate (GtkMenuItem *menu_item)
if (toggled)
gtk_check_menu_item_toggled (check_menu_item);
- gtk_widget_queue_draw (GTK_WIDGET (radio_menu_item));
-}
-
-static void
-gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
- GdkRectangle *area)
-{
- GtkWidget *widget;
- GtkStateType state_type;
- GtkShadowType shadow_type;
- gint width, height;
- gint x, y;
- gint offset;
-
- g_return_if_fail (GTK_IS_RADIO_MENU_ITEM (check_menu_item));
-
- if (GTK_WIDGET_DRAWABLE (check_menu_item))
- {
- guint horizontal_padding;
- guint toggle_spacing;
- guint toggle_size;
-
- widget = GTK_WIDGET (check_menu_item);
-
- gtk_widget_style_get (GTK_WIDGET (check_menu_item),
- "toggle_spacing", &toggle_spacing,
- "horizontal_padding", &horizontal_padding,
- NULL);
-
- width = 8;
- height = 8;
- toggle_size = GTK_MENU_ITEM (check_menu_item)->toggle_size;
- offset = GTK_CONTAINER (check_menu_item)->border_width +
- widget->style->xthickness + 2;
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
- {
- x = widget->allocation.x + offset + horizontal_padding +
- (toggle_size - toggle_spacing - width) / 2;
- }
- else
- {
- x = widget->allocation.x + widget->allocation.width -
- offset - horizontal_padding - toggle_size + toggle_spacing +
- (toggle_size - toggle_spacing - width) / 2;
- }
-
- y = widget->allocation.y + (widget->allocation.height - height) / 2;
-
- if (check_menu_item->active ||
- check_menu_item->always_show_toggle ||
- (GTK_WIDGET_STATE (check_menu_item) == GTK_STATE_PRELIGHT))
- {
- state_type = GTK_WIDGET_STATE (widget);
- if (check_menu_item->active ||
- !check_menu_item->always_show_toggle)
- shadow_type = GTK_SHADOW_IN;
- else
- shadow_type = GTK_SHADOW_OUT;
-
- if (check_menu_item->inconsistent)
- shadow_type = GTK_SHADOW_ETCHED_IN;
-
- if (!GTK_WIDGET_IS_SENSITIVE (widget))
- state_type = GTK_STATE_INSENSITIVE;
-
- gtk_paint_option (widget->style, widget->window,
- state_type, shadow_type,
- area, widget, "option",
- x, y, width, height);
- }
- }
+ gtk_widget_queue_draw (GTK_WIDGET (radio_menu_item));
}
-
diff --git a/gtk/gtktoggletoolbutton.c b/gtk/gtktoggletoolbutton.c
index 81f7d61032..02c076feed 100644
--- a/gtk/gtktoggletoolbutton.c
+++ b/gtk/gtktoggletoolbutton.c
@@ -25,6 +25,7 @@
#include "gtktogglebutton.h"
#include "gtkstock.h"
#include "gtkintl.h"
+#include "gtkradiotoolbutton.h"
#define MENU_ID "gtk-toggle-tool-button-menu-id"
@@ -115,9 +116,17 @@ gtk_toggle_tool_button_class_init (GtkToggleToolButtonClass *klass)
static void
gtk_toggle_tool_button_init (GtkToggleToolButton *button)
{
+ GtkToolButton *tool_button = GTK_TOOL_BUTTON (button);
+ GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (_gtk_tool_button_get_button (tool_button));
+
button->priv = GTK_TOGGLE_TOOL_BUTTON_GET_PRIVATE (button);
-
- g_signal_connect_object (_gtk_tool_button_get_button (GTK_TOOL_BUTTON (button)),
+
+ /* If the real button is a radio button, it may have been
+ * active at the time it was created.
+ */
+ button->priv->active = gtk_toggle_button_get_active (toggle_button);
+
+ g_signal_connect_object (toggle_button,
"toggled", G_CALLBACK (button_toggled), button, 0);
}
@@ -129,24 +138,30 @@ gtk_toggle_tool_button_create_menu_proxy (GtkToolItem *item)
GtkWidget *menu_item = NULL;
GtkStockItem stock_item;
gboolean use_mnemonic = TRUE;
- const char *label = "";
+ const char *label;
GtkWidget *label_widget = gtk_tool_button_get_label_widget (tool_button);
const gchar *label_text = gtk_tool_button_get_label (tool_button);
- gboolean use_underline = gtk_tool_button_get_use_underline (tool_button);
const gchar *stock_id = gtk_tool_button_get_stock_id (tool_button);
if (label_widget && GTK_IS_LABEL (label_widget))
{
label = gtk_label_get_label (GTK_LABEL (label_widget));
+ use_mnemonic = gtk_label_get_use_underline (GTK_LABEL (label_widget));
}
else if (label_text)
{
label = label_text;
- use_mnemonic = use_underline;
+ use_mnemonic = gtk_tool_button_get_use_underline (tool_button);
}
else if (stock_id && gtk_stock_lookup (stock_id, &stock_item))
- label = stock_item.label;
+ {
+ label = stock_item.label;
+ }
+ else
+ {
+ label = "";
+ }
if (use_mnemonic)
menu_item = gtk_check_menu_item_new_with_mnemonic (label);
@@ -156,6 +171,12 @@ gtk_toggle_tool_button_create_menu_proxy (GtkToolItem *item)
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item),
toggle_tool_button->priv->active);
+ if (GTK_IS_RADIO_TOOL_BUTTON (toggle_tool_button))
+ {
+ gtk_check_menu_item_set_draw_as_radio (GTK_CHECK_MENU_ITEM (menu_item),
+ TRUE);
+ }
+
g_signal_connect_closure_by_id (menu_item,
g_signal_lookup ("activate", G_OBJECT_TYPE (menu_item)), 0,
g_cclosure_new_object (G_CALLBACK (menu_item_activated),
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 5ead9f7045..011db4b545 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -57,6 +57,11 @@
#define DEFAULT_ICON_SIZE GTK_ICON_SIZE_LARGE_TOOLBAR
#define DEFAULT_TOOLBAR_STYLE GTK_TOOLBAR_BOTH
+#define MAX_HOMOGENEOUS_N_CHARS 13 /* Items that are wider than this do not participate in
+ * the homogeneous game. In units of
+ * pango_font_get_estimated_char_width().
+ */
+
enum {
PROP_0,
PROP_ORIENTATION,
@@ -620,14 +625,29 @@ static gboolean
toolbar_item_is_homogeneous (GtkToolbar *toolbar,
GtkToolItem *item)
{
- gboolean result = FALSE;
+ gboolean result;
+ GtkWidget *widget = GTK_WIDGET (item);
+ GtkRequisition requisition;
+ PangoContext *context;
+ PangoFontMetrics *metrics;
+ int char_width;
+ gint max_homogeneous_pixels;
+
+ context = gtk_widget_get_pango_context (widget);
+ metrics = pango_context_get_metrics (context,
+ widget->style->font_desc,
+ pango_context_get_language (context));
+ char_width = pango_font_metrics_get_approximate_char_width (metrics);
+ max_homogeneous_pixels = PANGO_PIXELS (MAX_HOMOGENEOUS_N_CHARS * char_width);
+
+ result = gtk_tool_item_get_homogeneous (item) && !GTK_IS_SEPARATOR_TOOL_ITEM (item);
- if ((gtk_tool_item_get_homogeneous (item) && !GTK_IS_SEPARATOR_TOOL_ITEM (item)))
- result = TRUE;
+ gtk_widget_size_request (GTK_WIDGET (item), &requisition);
- if (gtk_tool_item_get_is_important (item) &&
- toolbar->style == GTK_TOOLBAR_BOTH_HORIZ &&
- toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
+ if ((gtk_tool_item_get_is_important (item) &&
+ toolbar->style == GTK_TOOLBAR_BOTH_HORIZ &&
+ toolbar->orientation == GTK_ORIENTATION_HORIZONTAL) ||
+ requisition.width > max_homogeneous_pixels)
{
result = FALSE;
}
@@ -1447,7 +1467,7 @@ gtk_toolbar_move_focus (GtkToolbar *toolbar,
g_list_free (children);
- return TRUE;
+ return FALSE;
}
/* The focus handler for the toolbar. It called when the user presses
@@ -2678,7 +2698,10 @@ gtk_toolbar_get_drop_index (GtkToolbar *toolbar,
*
* Inserts a new item into the toolbar. You must specify the position
* in the toolbar where it will be inserted.
- *
+ *
+ * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as
+ * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to #GtkSignalFunc.
+ *
* Return value: the new toolbar item as a #GtkWidget.
**/
GtkWidget *
@@ -2709,6 +2732,9 @@ gtk_toolbar_append_item (GtkToolbar *toolbar,
*
* Adds a new button to the beginning (top or left edges) of the given toolbar.
*
+ * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as
+ * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to #GtkSignalFunc.
+ *
* Return value: the new toolbar item as a #GtkWidget.
**/
GtkWidget *
@@ -2741,6 +2767,9 @@ gtk_toolbar_prepend_item (GtkToolbar *toolbar,
* Inserts a new item into the toolbar. You must specify the position in the
* toolbar where it will be inserted.
*
+ * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as
+ * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to #GtkSignalFunc.
+ *
* Return value: the new toolbar item as a #GtkWidget.
**/
GtkWidget *
@@ -2775,6 +2804,9 @@ gtk_toolbar_insert_item (GtkToolbar *toolbar,
* @stock_id is not a known stock item ID, it's inserted verbatim,
* except that underscores used to mark mnemonics are removed.
*
+ * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as
+ * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to #GtkSignalFunc.
+ *
* Returns: the inserted widget
*/
GtkWidget*
@@ -2965,6 +2997,9 @@ gtk_toolbar_insert_widget (GtkToolbar *toolbar,
* the radio group for the new element. In all other cases, @widget must
* be %NULL.
*
+ * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as
+ * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to #GtkSignalFunc.
+ *
* Return value: the new toolbar element as a #GtkWidget.
**/
GtkWidget*
@@ -3003,6 +3038,9 @@ gtk_toolbar_append_element (GtkToolbar *toolbar,
* the radio group for the new element. In all other cases, @widget must
* be %NULL.
*
+ * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as
+ * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to #GtkSignalFunc.
+ *
* Return value: the new toolbar element as a #GtkWidget.
**/
GtkWidget *
@@ -3042,6 +3080,9 @@ gtk_toolbar_prepend_element (GtkToolbar *toolbar,
* the radio group for the new element. In all other cases, @widget must
* be %NULL.
*
+ * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as
+ * arguments. Use the GTK_SIGNAL_FUNC() to cast the function to #GtkSignalFunc.
+ *
* Return value: the new toolbar element as a #GtkWidget.
**/
GtkWidget *
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
index 349fbda30b..5382b7d11d 100644
--- a/gtk/gtktoolbutton.c
+++ b/gtk/gtktoolbutton.c
@@ -554,12 +554,10 @@ gtk_tool_button_create_menu_proxy (GtkToolItem *item)
else if (button->priv->stock_id && gtk_stock_lookup (button->priv->stock_id, &stock_item))
{
label = stock_item.label;
- use_mnemonic = FALSE;
}
else
{
label = "";
- use_mnemonic = FALSE;
}
if (use_mnemonic)