GNOME Bugzilla – Bug 408154
[PATCH] Change GtkEntryCompletion max-items to style property
Last modified: 2008-09-17 15:27:33 UTC
Right now it's hardcoded into the source code, this patch changes it to a style property. Patch against 2.10.6.
Created attachment 82585 [details] [review] Change max-items value to style property
Created attachment 82597 [details] [review] This actually applies against GTK+ 2.10.6. Really.
I'm not convinced this makes a lot of sense as a style property. What motiviation does a theme have to modify this ? If the main motivation here is to make it "fit on small screens", should this be a setting, rather than a style property ? It would be even better to make GtkEntryCompletion smart about handling screen size limitations, rather than forcing a fixed number of entries.
Would be ok to change the algorithm so the treeview requests the MAX between items*height or the maximum available height?
That was the MIN, of course :)
Matthias is completely right. the number of items shouldn't be limited at all, and the popup window needs to be constrained to monitor width/height like every other popup (e.g. menus).
(In reply to comment #6) > Matthias is completely right. > the number of items shouldn't be limited at all, and the popup window needs to > be constrained to monitor width/height like every other popup (e.g. menus). > Isn't that essentially what I said in comment #4 (and #5)? Can make a patch if so.
Sounds like that, to me.
Xan?
Created attachment 112193 [details] [review] Calculate size dynamically This patch removes the hardcoded number of items and instead the number of items that can be displayed on screen is computed. So the popup can expand to the entire space between the entry and the top or bottom of the monitor, which ever is further away.
Seems to work fine, thanks. Please commit.
Fixed in SVN: 2008-06-12 Michael Natterer <mitch@imendio.com> * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): limit the number of displayed items by the actual screen height instead of some arbitrary value (Bug #408154, Xan Lopez and Christian Dywan).
This patch breaks the case where there are many matches and several actions. For example, in Epiphany I have four search bookmarks (actions). If I type "amazon" into the URL bar there are about 300 matches, which expands to fill the screen. Then the actions are added, which go off the bottom of the list.
Created attachment 118869 [details] [review] Clamp the maximum size based on the actions The maximum size of the completion should take into account the number of actions being displayed.
2008-09-17 Matthias Clasen <mclasen@redhat.com> Bug 408154 – [PATCH] Change GtkEntryCompletion max-items to style property * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): Take actions into account when finding the available space for matches. Patch by Ross Burton