GNOME Bugzilla – Bug 590495
handle many tray icons overflowing clock
Last modified: 2009-08-07 13:52:54 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.
Created attachment 139707 [details] [review] Dynamically adjust tray spacing to cope with many icons
- 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.
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.
*** This bug has been marked as a duplicate of 590429 ***
Are you sure about the duplicate marking? The patch in bg 590429 doesn't seem to change much about the panel layout.