Commit 1d984542 authored by Jehan's avatar Jehan
Browse files

Issue #2828: Scrolling up with a mouse within a drop-down list.

We were doing it all the wrong way, fixing one combo box object at a
time. So this commit basically reverses commits 68a33ab5, 6dfca83c
and a9a979b2 and instead runs the same code in the class code. This
way, all objects based on these base classes will have the fix from
scratch.
These improved various other drop-down lists (I found some of them, and
probably not all) as I fixed all GIMP custom widgets based on
GtkComboBox.

Note that it has to be run after filling the list apparently (I had the
problem especially with GimpIntComboBox if running in the _init() code,
then the list widget showed wrong).
parent 68a33ab5
...@@ -147,8 +147,6 @@ image_new_dialog_new (GimpContext *context) ...@@ -147,8 +147,6 @@ image_new_dialog_new (GimpContext *context)
"ellipsize", PANGO_ELLIPSIZE_NONE, "ellipsize", PANGO_ELLIPSIZE_NONE,
"focus-on-click", FALSE, "focus-on-click", FALSE,
NULL); NULL);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (private->combo), 1);
gtk_box_pack_start (GTK_BOX (hbox), private->combo, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), private->combo, TRUE, TRUE, 0);
gtk_widget_show (private->combo); gtk_widget_show (private->combo);
......
...@@ -170,6 +170,9 @@ gimp_scale_combo_box_constructed (GObject *object) ...@@ -170,6 +170,9 @@ gimp_scale_combo_box_constructed (GObject *object)
g_signal_connect (entry, "key-press-event", g_signal_connect (entry, "key-press-event",
G_CALLBACK (gimp_scale_combo_box_entry_key_press), G_CALLBACK (gimp_scale_combo_box_entry_key_press),
combo_box); combo_box);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (object), 1);
} }
static void static void
......
...@@ -223,7 +223,6 @@ gimp_statusbar_init (GimpStatusbar *statusbar) ...@@ -223,7 +223,6 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
store = gimp_unit_store_new (2); store = gimp_unit_store_new (2);
statusbar->unit_combo = gimp_unit_combo_box_new_with_model (store); statusbar->unit_combo = gimp_unit_combo_box_new_with_model (store);
g_object_unref (store); g_object_unref (store);
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (statusbar->unit_combo), 1);
gtk_widget_set_can_focus (statusbar->unit_combo, FALSE); gtk_widget_set_can_focus (statusbar->unit_combo, FALSE);
g_object_set (statusbar->unit_combo, "focus-on-click", FALSE, NULL); g_object_set (statusbar->unit_combo, "focus-on-click", FALSE, NULL);
......
...@@ -177,6 +177,9 @@ gimp_container_combo_box_init (GimpContainerComboBox *combo) ...@@ -177,6 +177,9 @@ gimp_container_combo_box_init (GimpContainerComboBox *combo)
combo); combo);
gtk_widget_set_sensitive (GTK_WIDGET (combo), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (combo), FALSE);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo), 1);
} }
static void static void
......
...@@ -62,6 +62,9 @@ gimp_language_combo_box_init (GimpLanguageComboBox *combo) ...@@ -62,6 +62,9 @@ gimp_language_combo_box_init (GimpLanguageComboBox *combo)
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer, gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
"text", GIMP_LANGUAGE_STORE_LABEL, "text", GIMP_LANGUAGE_STORE_LABEL,
NULL); NULL);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo), 1);
} }
/** /**
......
...@@ -143,10 +143,6 @@ gimp_layer_mode_combo_box_constructed (GObject *object) ...@@ -143,10 +143,6 @@ gimp_layer_mode_combo_box_constructed (GObject *object)
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo),
combo->priv->layer_mode); combo->priv->layer_mode);
/* Sure why this is needed to have the dropdown display properly.
* Probably some weird side effect. See issue #2642.
*/
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo), 1);
} }
static void static void
......
...@@ -155,6 +155,9 @@ gimp_color_profile_combo_box_init (GimpColorProfileComboBox *combo_box) ...@@ -155,6 +155,9 @@ gimp_color_profile_combo_box_init (GimpColorProfileComboBox *combo_box)
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (combo_box), gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (combo_box),
gimp_color_profile_row_separator_func, gimp_color_profile_row_separator_func,
NULL, NULL); NULL, NULL);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo_box), 1);
} }
static void static void
......
...@@ -902,6 +902,9 @@ gimp_int_combo_box_create_cells (GimpIntComboBox *combo_box) ...@@ -902,6 +902,9 @@ gimp_int_combo_box_create_cells (GimpIntComboBox *combo_box)
priv, NULL); priv, NULL);
} }
} }
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo_box), 1);
} }
static void static void
......
...@@ -158,6 +158,9 @@ gimp_string_combo_box_constructed (GObject *object) ...@@ -158,6 +158,9 @@ gimp_string_combo_box_constructed (GObject *object)
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), cell, gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), cell,
"text", priv->label_column, "text", priv->label_column,
NULL); NULL);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (object), 1);
} }
static void static void
......
...@@ -72,6 +72,9 @@ gimp_unit_combo_box_init (GimpUnitComboBox *combo) ...@@ -72,6 +72,9 @@ gimp_unit_combo_box_init (GimpUnitComboBox *combo)
g_signal_connect (combo, "notify::popup-shown", g_signal_connect (combo, "notify::popup-shown",
G_CALLBACK (gimp_unit_combo_box_popup_shown), G_CALLBACK (gimp_unit_combo_box_popup_shown),
NULL); NULL);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo), 1);
} }
static void static void
......
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