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



commit 1d984542e9a4673dc81baa3d60d389e3bb3c2d03
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).

 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 8b25a40889..b589dc7903 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 104952d4cc..5523f7cbd8 100644
--- a/app/display/gimpscalecombobox.c
+++ b/app/display/gimpscalecombobox.c
@@ -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
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index 90d760ee07..c5f434bd4c 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -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);
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 6583ea78fe..2062486d19 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 fa6de162f8..99035c3de5 100644
--- a/libgimpwidgets/gimpcolorprofilecombobox.c
+++ b/libgimpwidgets/gimpcolorprofilecombobox.c
@@ -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
diff --git a/libgimpwidgets/gimpintcombobox.c b/libgimpwidgets/gimpintcombobox.c
index ec80b6be38..0616080df1 100644
--- a/libgimpwidgets/gimpintcombobox.c
+++ b/libgimpwidgets/gimpintcombobox.c
@@ -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
diff --git a/libgimpwidgets/gimpstringcombobox.c b/libgimpwidgets/gimpstringcombobox.c
index a25bc194dc..c817162e20 100644
--- a/libgimpwidgets/gimpstringcombobox.c
+++ b/libgimpwidgets/gimpstringcombobox.c
@@ -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
diff --git a/libgimpwidgets/gimpunitcombobox.c b/libgimpwidgets/gimpunitcombobox.c
index ac0840b9de..b648b5c000 100644
--- a/libgimpwidgets/gimpunitcombobox.c
+++ b/libgimpwidgets/gimpunitcombobox.c
@@ -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


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