diff options
author | Rodney Dawes <dobey@novell.com> | 2005-02-22 01:59:40 +0800 |
---|---|---|
committer | Rodney Dawes <dobey@src.gnome.org> | 2005-02-22 01:59:40 +0800 |
commit | beb84cf995092aa967e9702b73c58b4eac1d26fe (patch) | |
tree | a53c30019aa4f697fd2497f61e29d0b277cf85cc /widgets/misc | |
parent | 48d392dbf8a7cce29d1b4c8cc732dcdd332baaf3 (diff) | |
download | gsoc2013-evolution-beb84cf995092aa967e9702b73c58b4eac1d26fe.tar.gz gsoc2013-evolution-beb84cf995092aa967e9702b73c58b4eac1d26fe.tar.zst gsoc2013-evolution-beb84cf995092aa967e9702b73c58b4eac1d26fe.zip |
Fix the calculation of which shadow type to use to be more appropriate for
2005-02-21 Rodney Dawes <dobey@novell.com>
* e-combo-button.c (paint): Fix the calculation of which shadow type
to use to be more appropriate for the widget state and relief
Always call gtk_box_paint and not only in special cases like GtkButton
(e_combo_button_init): Change the arrow packing to pack_end
Fixes #54503
svn path=/trunk/; revision=28836
Diffstat (limited to 'widgets/misc')
-rw-r--r-- | widgets/misc/ChangeLog | 9 | ||||
-rw-r--r-- | widgets/misc/e-combo-button.c | 35 |
2 files changed, 28 insertions, 16 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 29a90b9663..52bde2708d 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,12 @@ +2005-02-21 Rodney Dawes <dobey@novell.com> + + * e-combo-button.c (paint): Fix the calculation of which shadow type + to use to be more appropriate for the widget state and relief + Always call gtk_box_paint and not only in special cases like GtkButton + (e_combo_button_init): Change the arrow packing to pack_end + + Fixes #54503 + 2005-02-02 Li Yuan <li.yuan@sun.com> * e-url-entry.c: (init): diff --git a/widgets/misc/e-combo-button.c b/widgets/misc/e-combo-button.c index f48c4f3c68..5d5d38ea7d 100644 --- a/widgets/misc/e-combo-button.c +++ b/widgets/misc/e-combo-button.c @@ -101,7 +101,15 @@ paint (EComboButton *combo_button, int x, y, width, height; int border_width; - shadow_type = GTK_BUTTON (widget)->depressed ? GTK_SHADOW_IN : GTK_SHADOW_OUT; + if (GTK_BUTTON (widget)->depressed || priv->menu_popped_up) { + shadow_type = GTK_SHADOW_IN; + gtk_widget_set_state (widget, GTK_STATE_ACTIVE); + } else if (GTK_BUTTON (widget)->relief == GTK_RELIEF_NONE && + (GTK_WIDGET_STATE (widget) == GTK_STATE_NORMAL || + GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)) + shadow_type = GTK_SHADOW_NONE; + else + shadow_type = GTK_SHADOW_OUT; border_width = GTK_CONTAINER (widget)->border_width; @@ -134,19 +142,14 @@ paint (EComboButton *combo_button, height -= 2 * (focus_width + focus_pad); } - if ((GTK_BUTTON (widget)->relief != GTK_RELIEF_NONE) || - ((GTK_WIDGET_STATE(widget) != GTK_STATE_NORMAL) && - (GTK_WIDGET_STATE(widget) != GTK_STATE_ACTIVE || GTK_BUTTON (widget)->depressed) && - (GTK_WIDGET_STATE(widget) != GTK_STATE_INSENSITIVE))) { - gtk_paint_box (widget->style, widget->window, - GTK_WIDGET_STATE (widget), shadow_type, - area, widget, "button", - x, y, separator_x, height); - gtk_paint_box (widget->style, widget->window, - GTK_WIDGET_STATE (widget), shadow_type, - area, widget, "button", - separator_x, y, width - separator_x, height); - } + gtk_paint_box (widget->style, widget->window, + GTK_WIDGET_STATE (widget), shadow_type, + area, widget, "button", + x, y, separator_x, height); + gtk_paint_box (widget->style, widget->window, + GTK_WIDGET_STATE (widget), shadow_type, + area, widget, "button", + separator_x, y, width - separator_x, height); if (GTK_WIDGET_HAS_FOCUS (widget)) { if (interior_focus) { @@ -441,8 +444,8 @@ e_combo_button_init (EComboButton *combo_button) gtk_widget_show (priv->label); priv->arrow_image = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); - gtk_box_pack_start (GTK_BOX (priv->hbox), priv->arrow_image, TRUE, TRUE, - GTK_WIDGET (combo_button)->style->xthickness); + gtk_box_pack_end (GTK_BOX (priv->hbox), priv->arrow_image, TRUE, TRUE, + GTK_WIDGET (combo_button)->style->xthickness); gtk_widget_show (priv->arrow_image); priv->icon = NULL; |