GNOME Bugzilla – Bug 595023
activities icons not fully on screen
Last modified: 2009-09-25 01:51:15 UTC
Created attachment 143082 [details] Icons in upper left are hanging off side of screen. As shown in attached screenshot, the activities icons don't slide all the way in for me- some of them are off the left side of the screen. This is with trunk as of today (Sat.... something, I miss the popup calendar ;) plus F11, intel graphics.
This looks like a failure when we can't fit 4 columns onto the screen. In the output do you see a warning like "WellGrid: trying to allocate for width..."? I'm fairly shortly going to get a netbook with a similar resolution =)
No, nothing like that on the console. Note that I'm not running enough apps (AFAICT) to justify needing four columns?
Created attachment 143386 [details] [review] [AppWell] Fall back to fewer than 4 columns if space limited First eliminate the variable WELL_ITEM_HSPACING since it was 0 and thus effectively was not used. Add a new variable WELL_ITEM_MIN_HSPACING which is the minimum space between grid items we allow. When computing layout, allow for a number of columns less than 4 by using the minimum item size.
Created attachment 143859 [details] [review] [AppWell] Fall back to fewer than 4 columns if space limited This is Colin's patch, rebased to the latest on master. The patch looks good. One place that needs to be changed: + while (nColumns <= WELL_DEFAULT_COLUMNS && + nColumns <= children.length && + usedWidth <= forWidth) { + usedWidth += itemMinWidth; + nColumns++; + } + let minSizedHorizSpacingTotal = forWidth - (nColumns * itemMinWidth); + let allowedMinHorizSpacingTotal = Math.max(nColumns - 1, 0) * WELL_ITEM_MIN_HSPACING; + if (allowedMinHorizSpacingTotal > minSizedHorizSpacingTotal) + nColumns--; + } The while loop increments nColumns one extra time. However, the end result is fine because nColumns is just always adjusted in the code that follows the while loop. I think the code below should produce the same result and is shorter. I added a comment to compensate :). I was initially unsure why WELL_ITEM_MIN_HSPACING is only used in that one place, so thought that could use an explanation. while (nColumns < WELL_DEFAULT_COLUMNS && nColumns < children.length && usedWidth + itemMinWidth <= forWidth) { // By including WELL_ITEM_MIN_HSPACING in usedWidth, we are ensuring // that the number of columns we end up with will allow the spacing // between the columns to be at least that value. usedWidth += itemMinWidth + WELL_ITEM_MIN_HSPACING; nColumns++; }
Created attachment 143860 [details] [review] [AppWell] Fall back to fewer than 4 columns if space limited A patch with the change that I proposed in the previous comment.
Comment on attachment 143860 [details] [review] [AppWell] Fall back to fewer than 4 columns if space limited Sure.