GNOME Bugzilla – Bug 641879
Shrink workspace thumbnails to prevent overflow
Last modified: 2011-02-17 16:35:50 UTC
As more workspaces are created than would fit in the allocated area, the thumbnails should scale down to fit. See: http://git.gnome.org/browse/gnome-shell-design/plain/mockups/static/overview-window-picker-9-workspaces.png
Created attachment 180672 [details] [review] Make a separate class for workspace thumbnails box Add WorkspaceThumbnail.ThumbnailsBox to handle managing the array of workspace thumbnails; the logic will get more complex as we add scaling and animation.
Created attachment 180673 [details] [review] Improve allocation of workspace controls Fix a bug in the computation of the zoomed-out scale and use a StBin and instead of an unnecessary StBoxLayout. Using the StBin will allow correct width-for-height behavior for the controls.
Created attachment 180674 [details] [review] Use a fixed width for visible portion of workspace thumbnails We will change the workspace thumbnail size as we get more thumbnails; it doesn't really make sense to always show 1/5 of the thumbnails how big or small they are, so instead show a CSS-configurable length.
Created attachment 180675 [details] [review] workspacesView: Update zoom scale when controls are reallocated The scale we zoom to in the "zoomed out" mode depends on the width of the controls area. Once we rescale the workspaces dynamically, we'll need to update the zoom scale as we add and remove workspaces.
Created attachment 180676 [details] [review] Scale thumbnails to fit in the vertical space When we have more thumbnails than can fit in the vertical space, scale them down. This is implemented by using a generic container so we can compute positions and sizes on the fly and do the appropriate width-for-height behavior. The usage of clutter constraints to position the indicator is droppped since it less complicated to just position the indicator in the right place ourselves.
Created attachment 180691 [details] [review] Scale thumbnails to fit in the vertical space Tiny fix to size allocation logic
Comment on attachment 180676 [details] [review] Scale thumbnails to fit in the vertical space Attachment 180676 [details] has been updated, marking obsolete.
*** Bug 642520 has been marked as a duplicate of this bug. ***
Review of attachment 180672 [details] [review]: Looks good.
Review of attachment 180673 [details] [review]: Looks good, except for a typo in the commit message: "use a StBin and instead of"
Review of attachment 180674 [details] [review]: Looks good.
Review of attachment 180675 [details] [review]: Yup.
Review of attachment 180691 [details] [review]: Looks good as well. ::: js/ui/workspaceThumbnail.js @@ +464,3 @@ + let y1 = Math.round(y); + let y2 = Math.round(y + thumbnailHeight); + let thisScale = (y2 - y1) / screenHeight; Mmmh, variable names starting with "this" are slightly confusing in JS ...
(In reply to comment #13) > Review of attachment 180691 [details] [review]: > > Looks good as well. > > ::: js/ui/workspaceThumbnail.js > @@ +464,3 @@ > + let y1 = Math.round(y); > + let y2 = Math.round(y + thumbnailHeight); > + let thisScale = (y2 - y1) / screenHeight; > > Mmmh, variable names starting with "this" are slightly confusing in JS ... Yeah. changed to roundedScale locally.
Attachment 180672 [details] pushed as ae5131f - Make a separate class for workspace thumbnails box Attachment 180673 [details] pushed as 630f0f0 - Improve allocation of workspace controls Attachment 180674 [details] pushed as 85ecd18 - Use a fixed width for visible portion of workspace thumbnails Attachment 180675 [details] pushed as fb8f3f1 - workspacesView: Update zoom scale when controls are reallocated Attachment 180691 [details] pushed as 0ef3f99 - Scale thumbnails to fit in the vertical space