[gtk+] Unbreak GtkComboBox::button-sensitivity
- From: Kristian Rietveld <kristian src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Unbreak GtkComboBox::button-sensitivity
- Date: Wed, 9 Sep 2009 19:31:07 +0000 (UTC)
commit fef3c88e8959598553de87cc6ac89bfc5bb02c1f
Author: Kristian Rietveld <kris gtk org>
Date: Wed Sep 9 09:43:30 2009 +0200
Unbreak GtkComboBox::button-sensitivity
Fixed the button-sensivity patch done to GtkComboBox to account for
changes in appearance (changes to the appears-as-list style property).
Also, in list-mode, the event box that has been created below the cell
view also needs to have its sensitivity updated.
gtk/gtkcombobox.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index bda2a92..b2886d6 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -379,6 +379,8 @@ static gboolean gtk_combo_box_menu_button_press (GtkWidget *widget,
gpointer user_data);
static void gtk_combo_box_menu_item_activate (GtkWidget *item,
gpointer user_data);
+
+static void gtk_combo_box_update_sensitivity (GtkComboBox *combo_box);
static void gtk_combo_box_menu_row_inserted (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
@@ -2862,6 +2864,7 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box,
gtk_combo_box_sync_cells (combo_box, GTK_CELL_LAYOUT (priv->column));
gtk_combo_box_update_title (combo_box);
+ gtk_combo_box_update_sensitivity (combo_box);
}
static void
@@ -3215,6 +3218,10 @@ gtk_combo_box_update_sensitivity (GtkComboBox *combo_box)
}
gtk_widget_set_sensitive (combo_box->priv->button, sensitive);
+
+ /* In list-mode, we also need to update sensitivity of the event box */
+ if (GTK_IS_TREE_VIEW (combo_box->priv->tree_view))
+ gtk_widget_set_sensitive (combo_box->priv->box, sensitive);
}
static void
@@ -3755,6 +3762,8 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box)
combo_box);
gtk_widget_show (priv->tree_view);
+
+ gtk_combo_box_update_sensitivity (combo_box);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]