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 678960 - Make window size be limited by contents
Make window size be limited by contents
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks: 686781
 
 
Reported: 2012-06-27 09:57 UTC by Alexander Larsson
Modified: 2016-03-31 14:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make window size be limited by UI contents (6.48 KB, patch)
2012-06-27 09:59 UTC, Alexander Larsson
none Details | Review
Make window size be limited by UI contents (11.27 KB, patch)
2012-06-27 13:00 UTC, Alexander Larsson
none Details | Review
Put selection toolbar in the right place in the UI (1.05 KB, patch)
2013-01-24 12:14 UTC, Alexander Larsson
committed Details | Review
Don't allow smaller window than the UI requires (1.09 KB, patch)
2013-01-24 12:14 UTC, Alexander Larsson
committed Details | Review
Ensure all potentially long labels are ellipsized (2.62 KB, patch)
2013-02-22 09:06 UTC, Alexander Larsson
committed Details | Review

Description Alexander Larsson 2012-06-27 09:57:14 UTC
Right now the toplevel window size is not constrained at all, i.e. you can make its small enough to not even fit the toolbar.

Clutter-gtk now has support for the use-layout-size property on the GtkClutterEmbed to fix this. However, just enabling leads to some issues with the current codebase.

Boxes does almost all UI inside the main window (i.e. not in dialogs), which means that some pretty large UIs sometimes appear in the window, like the new box Wizard. This is problematic if the toplevel window currently is smaller than the new UI state. There are two solutions here, we can grow the window, or we can ensure that the window will never be smaller than needed for the largest UI needs in its minimal state (even if its currently not showing the largest UI). I've discussed this with the designers, and the least bad approach is the second, so that we don't unexpectedly change the size of the toplevel.

We implement this by enabling use-layout-size, and ensuring that all clutter actors that affect the toplevel layout are always "visible", i.e. we hide them by setting opacity to 0 rather than hiding the actors.

We also do some tweaking of the Wizard layout to make the minimal size smaller as that now affects the toplevel window minimal size.
Comment 1 Alexander Larsson 2012-06-27 09:59:55 UTC
Created attachment 217379 [details] [review]
Make window size be limited by UI contents

Right now the toplevel window size is not constrained at all, i.e. you can make
its small enough to not even fit the toolbar.

Clutter-gtk now has support for the use-layout-size property on the
GtkClutterEmbed to fix this. However, just enabling leads to some issues with
the current codebase.

Boxes does almost all UI inside the main window (i.e. not in dialogs), which
means that some pretty large UIs sometimes appear in the window, like the new
box Wizard. This is problematic if the toplevel window currently is smaller
than the new UI state. There are two solutions here, we can grow the window, or
we can ensure that the window will never be smaller than needed for the largest
UI needs in its minimal state (even if its currently not showing the largest
UI). I've discussed this with the designers, and the least bad approach is the
second, so that we don't unexpectedly change the size of the toplevel.

We implement this by enabling use-layout-size, and ensuring that all clutter
actors that affect the toplevel layout are always "visible", i.e. we hide them
by setting opacity to 0 rather than hiding the actors.

We also do some tweaking of the Wizard layout to make the minimal size smaller
as that now affects the toplevel window minimal size.
Comment 2 Marc-Andre Lureau 2012-06-27 11:16:01 UTC
for some reason, the OSD/selectionbar is not properly centered after the patch.

I also noted that sometime, only the first row of the collection can be clicked, but I don't know if this is because of this patch yet. (could there be hidden actors above?)
Comment 3 Alexander Larsson 2012-06-27 11:34:58 UTC
Its because the selectionbar is packed inside the bin to the right of the sidebar
needs to be in the same place as the collection view.
Comment 4 Alexander Larsson 2012-06-27 11:38:55 UTC
Ok, so reactive actors with opacity 0 will still be picked for mouse events. We need to make them transparent as well as non-reactive.
Comment 5 Alexander Larsson 2012-06-27 13:00:37 UTC
Created attachment 217396 [details] [review]
Make window size be limited by UI contents

Right now the toplevel window size is not constrained at all, i.e. you can make
its small enough to not even fit the toolbar.

Clutter-gtk now has support for the use-layout-size property on the
GtkClutterEmbed to fix this. However, just enabling leads to some issues with
the current codebase.

Boxes does almost all UI inside the main window (i.e. not in dialogs), which
means that some pretty large UIs sometimes appear in the window, like the new
box Wizard. This is problematic if the toplevel window currently is smaller
than the new UI state. There are two solutions here, we can grow the window, or
we can ensure that the window will never be smaller than needed for the largest
UI needs in its minimal state (even if its currently not showing the largest
UI). I've discussed this with the designers, and the least bad approach is the
second, so that we don't unexpectedly change the size of the toplevel.

We implement this by enabling use-layout-size, and ensuring that all clutter
actors that affect the toplevel layout are always "visible", i.e. we hide them
by setting opacity to 0 and reactive to false rather than hiding the actors.

We also do some tweaking of the Wizard layout to make the minimal size smaller
as that now affects the toplevel window minimal size.
Comment 6 Alexander Larsson 2013-01-24 12:14:05 UTC
Created attachment 234299 [details] [review]
Put selection toolbar in the right place in the UI

The selection toolbar is over the CollectionView which is in
below_bin, so put the toolbar there too. Without this the
selection toolbar is centered over the area to the right of the
sidebar, rather than over the whole icon view.
Comment 7 Alexander Larsson 2013-01-24 12:14:08 UTC
Created attachment 234300 [details] [review]
Don't allow smaller window than the UI requires

We activate the GtkClutter.Embed use-layout-size mode to ensure this.

With this it may happen that the window size grows when you switch
to a new mode, like the wizard. However, since the UI packing is
pretty good these days this really only happens for really tiny
window sizes which are not very common. And any way, its far better
than just cutting off the UI.
Comment 8 Alexander Larsson 2013-01-24 12:15:37 UTC
Rebased the patch and dropped all the weird code that tried to allocate space always for all possible elements. It complicated the code quite a bit for something that in practice (at least with the current UI) almost never happens.
Comment 9 Christophe Fergeau 2013-01-24 17:31:49 UTC
Review of attachment 234300 [details] [review]:

If you have an ISO unknown to libosinfo with a very long name, this enlarges the window (needs to be ellipsized I guess)
Comment 10 Christophe Fergeau 2013-01-24 17:31:57 UTC
Review of attachment 234300 [details] [review]:

If you have an ISO unknown to libosinfo with a very long name, this enlarges the window (needs to be ellipsized I guess)
Comment 11 Christophe Fergeau 2013-01-24 17:33:54 UTC
Review of attachment 234300 [details] [review]:

Same if you give a very long name to the VM in the properties
Comment 12 Christophe Fergeau 2013-01-24 17:35:25 UTC
Review of attachment 234299 [details] [review]:

ack
Comment 13 Alexander Larsson 2013-01-25 14:43:04 UTC
Comment on attachment 234299 [details] [review]
Put selection toolbar in the right place in the UI

Attachment 234299 [details] pushed as b986951 - Put selection toolbar in the right place in the UI
Comment 14 Alexander Larsson 2013-02-22 09:06:51 UTC
Created attachment 237152 [details] [review]
Ensure all potentially long labels are ellipsized
Comment 15 Alexander Larsson 2013-02-22 09:30:29 UTC
With the last two patches i have no problem with overlong strings making the window wide.
Comment 16 Christophe Fergeau 2013-02-22 10:45:42 UTC
Yeah works nicely for me too, ACK to the remaining patches in this bug. Potential bikeshedding on PANGO_ELLIPSIZE_MIDDLE vs PANGO_ELLIPSIZE_END as I tend to prefer the former, but _END is not bad either.
Comment 17 Alexander Larsson 2013-02-22 12:10:58 UTC
Attachment 234300 [details] pushed as 4bcdb19 - Don't allow smaller window than the UI requires
Attachment 237152 [details] pushed as a529d83 - Ensure all potentially long labels are ellipsized