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 703905 - environment: Add some convenience LayoutManager monkey-patching
environment: Add some convenience LayoutManager monkey-patching
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks: 703833
 
 
Reported: 2013-07-09 21:34 UTC by Florian Müllner
Modified: 2013-07-24 13:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
environment: Add some convenience LayoutManager monkey-patching (2.23 KB, patch)
2013-07-09 21:34 UTC, Florian Müllner
committed Details | Review
appDisplay: Use hookup_style() to bind app-view-controls spacing (1.93 KB, patch)
2013-07-09 21:34 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2013-07-09 21:34:13 UTC
See patch.
Comment 1 Florian Müllner 2013-07-09 21:34:17 UTC
Created attachment 248776 [details] [review]
environment: Add some convenience LayoutManager monkey-patching

Similar to our ClutterContainer monkey-patching, we can add some
convenience to existing ClutterLayoutManagers:

 - hookup_style() to bind layoutManager properties to CSS properties
 - child_set() to set child properties
Comment 2 Florian Müllner 2013-07-09 21:34:22 UTC
Created attachment 248777 [details] [review]
appDisplay: Use hookup_style() to bind app-view-controls spacing

With the monkey-patched ClutterBoxLayout, we no longer need this
code to hook up the 'spacing' property to CSS.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-07-09 23:32:07 UTC
Review of attachment 248776 [details] [review]:

::: js/ui/environment.js
@@ +43,3 @@
+function _patchLayoutClass(layoutClass, styleProps) {
+    if (styleProps)
+        layoutClass.prototype.hookup_style = function(container) {

Do you need to pass the container, considering that the layout manager has a reference to its actor?
Comment 4 Florian Müllner 2013-07-09 23:44:39 UTC
(In reply to comment #3)
> considering that the layout manager has a reference to its actor?

Where?
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-07-09 23:57:53 UTC
Oh, hm, I thought a ClutterLayoutManager was a ClutterActorMeta.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-07-10 00:37:23 UTC
Review of attachment 248776 [details] [review]:

Not sure on the value of child_set, but OK.
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-07-10 00:37:43 UTC
Review of attachment 248777 [details] [review]:

OK.
Comment 8 Florian Müllner 2013-07-24 13:25:39 UTC
Attachment 248776 [details] pushed as 6fd3c0f - environment: Add some convenience LayoutManager monkey-patching
Attachment 248777 [details] pushed as cb4e4bb - appDisplay: Use hookup_style() to bind app-view-controls spacing