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 68a33ab5bd, 6dfca83c2a
and a9a979b2d0 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).
This commit is contained in:
Jehan 2019-01-20 13:08:36 +01:00
parent 68a33ab5bd
commit 1d984542e9
10 changed files with 21 additions and 7 deletions

View File

@ -147,8 +147,6 @@ image_new_dialog_new (GimpContext *context)
"ellipsize", PANGO_ELLIPSIZE_NONE,
"focus-on-click", FALSE,
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_widget_show (private->combo);

View File

@ -170,6 +170,9 @@ gimp_scale_combo_box_constructed (GObject *object)
g_signal_connect (entry, "key-press-event",
G_CALLBACK (gimp_scale_combo_box_entry_key_press),
combo_box);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (object), 1);
}
static void

View File

@ -223,7 +223,6 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
store = gimp_unit_store_new (2);
statusbar->unit_combo = gimp_unit_combo_box_new_with_model (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);
g_object_set (statusbar->unit_combo, "focus-on-click", FALSE, NULL);

View File

@ -177,6 +177,9 @@ gimp_container_combo_box_init (GimpContainerComboBox *combo)
combo);
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

View File

@ -62,6 +62,9 @@ gimp_language_combo_box_init (GimpLanguageComboBox *combo)
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
"text", GIMP_LANGUAGE_STORE_LABEL,
NULL);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo), 1);
}
/**

View File

@ -143,10 +143,6 @@ gimp_layer_mode_combo_box_constructed (GObject *object)
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo),
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

View File

@ -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),
gimp_color_profile_row_separator_func,
NULL, NULL);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo_box), 1);
}
static void

View File

@ -902,6 +902,9 @@ gimp_int_combo_box_create_cells (GimpIntComboBox *combo_box)
priv, NULL);
}
}
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo_box), 1);
}
static void

View File

@ -158,6 +158,9 @@ gimp_string_combo_box_constructed (GObject *object)
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), cell,
"text", priv->label_column,
NULL);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (object), 1);
}
static void

View File

@ -72,6 +72,9 @@ gimp_unit_combo_box_init (GimpUnitComboBox *combo)
g_signal_connect (combo, "notify::popup-shown",
G_CALLBACK (gimp_unit_combo_box_popup_shown),
NULL);
/* See issues #2828 and #2642. */
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo), 1);
}
static void