GNOME Bugzilla – Bug 676326
actor: Add a :request-content-size property
Last modified: 2014-12-15 17:16:31 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.
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.
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.
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.
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.
Attachment 292662 [details] pushed as 300aa46 - actor: Add CLUTTER_REQUEST_CONTENT_SIZE mode
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.