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 590495 - handle many tray icons overflowing clock
handle many tray icons overflowing clock
Status: RESOLVED DUPLICATE of bug 590429
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-08-02 02:14 UTC by Colin Walters
Modified: 2009-08-07 13:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Dynamically adjust tray spacing to cope with many icons (4.12 KB, patch)
2009-08-02 02:14 UTC, Colin Walters
none Details | Review

Description Colin Walters 2009-08-02 02:14:31 UTC
This patch attempts to adjust if we have many tray icons; if the space
required for the tray takes over 20% of the bar, we start dropping
space between them, down to a minimum of 4.

It doesn't stop us from going over that 20%, and we should not
completely fail in pathological cases (prioritize by most-used, have
a more dropdown?)  but this patch should help fix the case of <= 10 on
non-netbook laptop screens.
Comment 1 Colin Walters 2009-08-02 02:14:40 UTC
Created attachment 139707 [details] [review]
Dynamically adjust tray spacing to cope with many icons
Comment 2 Owen Taylor 2009-08-03 19:36:04 UTC
- Patch has left-over log statements

- I don't think it's OK to use actor.width when you care about the difference between requisition and allocation, since it can return either one depending on the circumstances - see clutter_actor_get_width() code. IMO, muc clearer to call actor.get_preferred_width() directly.

- A problem I think is that the sizing of the newly added icon will be asynchronous - could be verified with log statements, but I think icons will take a while to negotiate the proper width, and will typically have a width of 1 when added (or some other arbitrary size). The only way to handle things properly is likely with a custom container. A "Squeezeable  box", say.

- The max width percentage of 1/5th seems a little arbitrary.

- This, of course, still doesn't really fix the problem that if there are too man icons, it could overflow the clock.

Maybe a simpler approach would be simply to say:

 6 or less icons - spacing of 14 pixels
 more than 6 icons - spacing of 8 pixels

Or something like that. Given the right numbers, I think it will behave about the same as what you have, but more predictably.

 
Comment 3 Colin Walters 2009-08-04 00:38:43 UTC
Yep, much simpler.  Implemented and pushed.  Going to leave this bug open though for the icons overflowing the clock.  We need a custom container for that I think.
Comment 4 Colin Walters 2009-08-07 04:44:24 UTC

*** This bug has been marked as a duplicate of 590429 ***
Comment 5 Owen Taylor 2009-08-07 13:52:54 UTC
Are you sure about the duplicate marking? The patch in bg 590429 doesn't seem to change much about the panel layout.