Hi All,
Is there any reason qx.ui.decoration.Background doesn't have a property
to set the background-position?
I can easily define my own decorator class extending from
qx.ui.decoration.Background but I feel this functionality should be part
of the framework.
I've attached a patch for Background.js, any chance of seeing this commited?
Thanks,
Matt
Index: framework/source/class/qx/ui/decoration/Background.js
===================================================================
--- framework/source/class/qx/ui/decoration/Background.js (revision 17038)
+++ framework/source/class/qx/ui/decoration/Background.js (working copy)
@@ -80,6 +80,25 @@
check : "Color",
nullable : true,
apply : "_applyStyle"
+ },
+
+ backgroundPositionX :
+ {
+ check : ["left", "center", "right"],
+ nullable : true,
+ apply : "_applyStyle"
+ },
+
+ backgroundPositionY :
+ {
+ check : ["top", "center", "bottom"],
+ nullable : true,
+ apply : "_applyStyle"
+ },
+
+ backgroundPosition :
+ {
+ group : ["backgroundPositionY", "backgroundPositionX"]
}
},
@@ -117,7 +136,14 @@
}
// Generate markup
- var html =
qx.ui.decoration.Util.generateBackgroundMarkup(this.getBackgroundImage(),
this.getBackgroundRepeat(), "position:absolute;top:0;left:0;");
+ var style = "position:absolute;top:0;left:0;";
+ var posx = this.getBackgroundPositionX();
+ var posy = this.getBackgroundPositionY();
+ if (posy || posx)
+ {
+ style += "background-position:" + (posy || "center") + " " + (posx ||
"center");
+ }
+ var html =
qx.ui.decoration.Util.generateBackgroundMarkup(this.getBackgroundImage(),
this.getBackgroundRepeat(), style);
// Store
return this.__markup = html;
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel