[gimp/gimp-2-10] Issue #2828: Scrolling up with a mouse within a drop-down list.



commit 10aa988afa5587e209b8fed908a149fac8c907cb
Author: Jehan <jehan girinstud io>
Date:   Sun Jan 20 13:08:36 2019 +0100

    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).
    
    (cherry picked from commit 1d984542e9a4673dc81baa3d60d389e3bb3c2d03)

 app/dialogs/image-new-dialog.c            | 2 --
 app/display/gimpscalecombobox.c           | 3 +++
 app/display/gimpstatusbar.c               | 1 -
 app/widgets/gimpcontainercombobox.c       | 3 +++
 app/widgets/gimplanguagecombobox.c        | 3 +++
 app/widgets/gimplayermodecombobox.c       | 4 ----
 libgimpwidgets/gimpcolorprofilecombobox.c | 3 +++
 libgimpwidgets/gimpintcombobox.c          | 3 +++
 libgimpwidgets/gimpstringcombobox.c       | 3 +++
 libgimpwidgets/gimpunitcombobox.c         | 3 +++
 10 files changed, 21 insertions(+), 7 deletions(-)
---
diff --git a/app/dialogs/image-new-dialog.c b/app/dialogs/image-new-dialog.c
index 30f9c60ecf..db709ef29b 100644
--- a/app/dialogs/image-new-dialog.c
+++ b/app/dialogs/image-new-dialog.c
@@ -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);
 
diff --git a/app/display/gimpscalecombobox.c b/app/display/gimpscalecombobox.c
index 3a5bba0ebe..bbce45026f 100644
--- a/app/display/gimpscalecombobox.c
+++ b/app/display/gimpscalecombobox.c
@@ -186,6 +186,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
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index 874cfefe15..8f51b5f63d 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -234,7 +234,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);
diff --git a/app/widgets/gimpcontainercombobox.c b/app/widgets/gimpcontainercombobox.c
index 87e2af8eac..8c34384c06 100644
--- a/app/widgets/gimpcontainercombobox.c
+++ b/app/widgets/gimpcontainercombobox.c
@@ -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
diff --git a/app/widgets/gimplanguagecombobox.c b/app/widgets/gimplanguagecombobox.c
index 428277408e..5a2e13b457 100644
--- a/app/widgets/gimplanguagecombobox.c
+++ b/app/widgets/gimplanguagecombobox.c
@@ -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);
 }
 
 /**
diff --git a/app/widgets/gimplayermodecombobox.c b/app/widgets/gimplayermodecombobox.c
index 2d8714cd9e..0483c4d859 100644
--- a/app/widgets/gimplayermodecombobox.c
+++ b/app/widgets/gimplayermodecombobox.c
@@ -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
diff --git a/libgimpwidgets/gimpcolorprofilecombobox.c b/libgimpwidgets/gimpcolorprofilecombobox.c
index 348136530d..c3f6dcc51e 100644
--- a/libgimpwidgets/gimpcolorprofilecombobox.c
+++ b/libgimpwidgets/gimpcolorprofilecombobox.c
@@ -151,6 +151,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
diff --git a/libgimpwidgets/gimpintcombobox.c b/libgimpwidgets/gimpintcombobox.c
index 6cd890935b..e22c22b5fa 100644
--- a/libgimpwidgets/gimpintcombobox.c
+++ b/libgimpwidgets/gimpintcombobox.c
@@ -930,6 +930,9 @@ gimp_int_combo_box_create_cells (GimpIntComboBox *combo_box)
       for (; attached_menus; attached_menus = g_list_next (attached_menus))
         queue_resize_cell_view (attached_menus->data);
     }
+
+  /* See issues #2828 and #2642. */
+  gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (combo_box), 1);
 }
 
 static void
diff --git a/libgimpwidgets/gimpstringcombobox.c b/libgimpwidgets/gimpstringcombobox.c
index 56208a385b..87fd3e36b3 100644
--- a/libgimpwidgets/gimpstringcombobox.c
+++ b/libgimpwidgets/gimpstringcombobox.c
@@ -159,6 +159,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
diff --git a/libgimpwidgets/gimpunitcombobox.c b/libgimpwidgets/gimpunitcombobox.c
index fff5577482..3919461edf 100644
--- a/libgimpwidgets/gimpunitcombobox.c
+++ b/libgimpwidgets/gimpunitcombobox.c
@@ -83,6 +83,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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]