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 676326 - actor: Add a :request-content-size property
actor: Add a :request-content-size property
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: ClutterActor
unspecified
Other All
: Normal enhancement
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2012-05-18 15:15 UTC by Bastian Winkler
Modified: 2014-12-15 17:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
actor: Add a :request-content-size property (7.64 KB, patch)
2012-05-18 15:15 UTC, Bastian Winkler
rejected Details | Review
actor: Add CLUTTER_REQUEST_CONTENT_SIZE mode (8.56 KB, patch)
2014-12-13 13:40 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Bastian Winkler 2012-05-18 15:15:19 UTC
This property optionally takes the preferred size of the actors ClutterContent
into account when calculating it's own preferred size. This will only happen
when the actor has no children.

Another possibility would be to take the MAX of the computed size by the
layout-manager and the size of the content.
Comment 1 Bastian Winkler 2012-05-18 15:15:21 UTC
Created attachment 214338 [details] [review]
actor: Add a :request-content-size property

Optionally take the preferred size of the actors content into account
when calculating the preferred width/height.
Comment 2 Emmanuele Bassi (:ebassi) 2012-07-17 20:27:09 UTC
I'm not entirely happy with this - it introduces a bunch of caveats (children handling, layout managers, explicit size), and it takes a simple principle (the Content follows the geometry of the Actor) and flips it on its head in a way that doesn't make me comfortable.

I reserve the right to think about it some more.
Comment 3 Emmanuele Bassi (:ebassi) 2014-12-13 13:40:09 UTC
Created attachment 292662 [details] [review]
actor: Add CLUTTER_REQUEST_CONTENT_SIZE mode

Some actors want to have a preferred size driven by their content, not
by their children or by their fixed size.

In order to achieve that, we can extend the ClutterRequestMode
enumeration so that clutter_actor_get_preferred_size() defers to the
ClutterContent's own preferred size.
Comment 4 Emmanuele Bassi (:ebassi) 2014-12-13 13:43:07 UTC
instead of adding a new property and overriding get_preferred_width() and get_preferred_height(), I opted to add a new ClutterRequestMode enumeration value.

extending enumerations is always a bit tricky, but I vastly prefer this approach, since it keeps existing code working without any change in semantics, and allows people to opt in fairly easily.
Comment 5 Emmanuele Bassi (:ebassi) 2014-12-15 17:13:36 UTC
Attachment 292662 [details] pushed as 300aa46 - actor: Add CLUTTER_REQUEST_CONTENT_SIZE mode
Comment 6 Emmanuele Bassi (:ebassi) 2014-12-15 17:16:31 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.