[gtk/1422-gtkentry-s-minimum-width-is-hardcoded-to-150px-GTK3-combo-workaround] gtkcombobox: in has-entry case, allow entry be shorter that 150px
- From: Nelson Benítez León <nbenitez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/1422-gtkentry-s-minimum-width-is-hardcoded-to-150px-GTK3-combo-workaround] gtkcombobox: in has-entry case, allow entry be shorter that 150px
- Date: Sun, 21 Oct 2018 17:30:16 +0000 (UTC)
commit 9493e94376eb2173fa67c1b78f86f0d8213d6754
Author: Nelson Benítez León <nbenitezl gmail com>
Date: Sun Oct 21 22:20:09 2018 +0500
gtkcombobox: in has-entry case, allow entry be shorter that 150px
When "has-entry" is true (GtkCombobox has an editable GtkEntry)
allow the GtkEntry to be shorter than 150px and thus match the
ComboBox width when this is shorter than 150px.
This fixes evince#1002 by work around the issue gtk#1422 for the
GtkComboBox case.
gtk/gtkcombobox.c | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index e6589b4c90..966b30e7fc 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -1629,6 +1629,10 @@ gtk_combo_box_create_child (GtkComboBox *combo_box)
entry = gtk_entry_new ();
gtk_widget_show (entry);
+ /* This sets GtkEntry's minimum-width to be 1 char long, short enough
+ * to workaround gtk issue gtk#1422 . Also fixes evince#1002 */
+ gtk_entry_set_width_chars (GTK_ENTRY (entry), 1);
+
gtk_container_add (GTK_CONTAINER (combo_box), entry);
context = gtk_widget_get_style_context (GTK_WIDGET (entry));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]