Bug 698540 - [regression] Combo boxes "popup-fixed-width" property is broken
[regression] Combo boxes "popup-fixed-width" property is broken
Status: NEEDINFO
Product: gtk+
Classification: Platform
Component: Widget: GtkComboBox
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-04-22 06:25 UTC by Tristan Van Berkom
Modified: 2017-08-30 12:35 UTC (History)
2 users (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments

Description Tristan Van Berkom 2013-04-22 06:25:38 UTC
Normally comboboxes are supposed to have the popup treemenu popup at the
allocated width of the combo-box itself, this helps the UI look consistent
by not having the combo box's meny overlap any widgets on the left or right
of the combo.

Now it seems they are popping up at a different width.

This is visible why running ./tests/testheightforwidth and
popping up the "Combo Boxes and Menus" test.
Comment 1 Tristan Van Berkom 2013-04-28 21:18:16 UTC
Changing title to reflect the problem more accurately,
"popup-fixed-width" is actually default behaviour though.
Comment 2 Daniel Boles 2017-08-30 12:34:50 UTC
Is this still reproducible?


(In reply to Tristan Van Berkom from comment #0)
> Now it seems they are popping up at a different width.

Were they wider or narrower than the button?


> This is visible why running ./tests/testheightforwidth and
> popping up the "Combo Boxes and Menus" test.

This looks fine to me; the popup is the same width as the button. So, I guess it's obsolete?


fwiw, the code does this:

              if (priv->popup_fixed_width)
                gtk_widget_get_preferred_width (priv->popup_widget, &menu_width, NULL);
              else
                gtk_widget_get_preferred_width (priv->popup_widget, NULL, &menu_width);

              gtk_widget_set_size_request (priv->popup_widget,
                                           MAX (allocation->width, menu_width), -1);

which basically says that in all cases, the menu is at least as wide as the box, but it can get wider up to its min-width if :popup-fixed-width but its nat-width if not.

That seems like a very subtle difference, so the property doesn't seem tremendously useful... In no case can the menu be smaller than the button, and it either case it might be wider if its contents demand so.

Note You need to log in before you can comment on or make changes to this bug.