After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 408154 - [PATCH] Change GtkEntryCompletion max-items to style property
[PATCH] Change GtkEntryCompletion max-items to style property
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.10.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-02-15 08:16 UTC by Xan Lopez
Modified: 2008-09-17 15:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Change max-items value to style property (2.07 KB, patch)
2007-02-15 08:17 UTC, Xan Lopez
none Details | Review
This actually applies against GTK+ 2.10.6. Really. (2.07 KB, patch)
2007-02-15 11:18 UTC, Xan Lopez
rejected Details | Review
Calculate size dynamically (1.47 KB, patch)
2008-06-05 07:50 UTC, Christian Dywan
committed Details | Review
Clamp the maximum size based on the actions (1.64 KB, patch)
2008-09-17 10:11 UTC, Ross Burton
committed Details | Review

Description Xan Lopez 2007-02-15 08:16:16 UTC
Right now it's hardcoded into the source code, this patch changes it to a style property. Patch against 2.10.6.
Comment 1 Xan Lopez 2007-02-15 08:17:09 UTC
Created attachment 82585 [details] [review]
Change max-items value to style property
Comment 2 Xan Lopez 2007-02-15 11:18:21 UTC
Created attachment 82597 [details] [review]
This actually applies against GTK+ 2.10.6. Really.
Comment 3 Matthias Clasen 2007-02-16 20:53:58 UTC
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.
Comment 4 Xan Lopez 2007-02-16 21:01:41 UTC
Would be ok to change the algorithm so the treeview requests the MAX between items*height or the maximum available height?
Comment 5 Xan Lopez 2007-02-16 21:56:08 UTC
That was the MIN, of course :)
Comment 6 Tim Janik 2007-02-20 14:14:11 UTC
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).
Comment 7 Xan Lopez 2007-12-26 12:45:17 UTC
(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.
Comment 8 Sven Herzberg 2008-02-11 14:39:51 UTC
Sounds like that, to me.
Comment 9 Reinout van Schouwen 2008-02-13 00:27:57 UTC
Xan?
Comment 10 Christian Dywan 2008-06-05 07:50:57 UTC
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.
Comment 11 Matthias Clasen 2008-06-08 03:29:22 UTC
Seems to work fine, thanks. Please commit.
Comment 12 Michael Natterer 2008-06-12 11:18:40 UTC
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).
Comment 13 Ross Burton 2008-09-17 09:22:19 UTC
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.
Comment 14 Ross Burton 2008-09-17 10:11:35 UTC
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.
Comment 15 Matthias Clasen 2008-09-17 15:27:33 UTC
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