Hi again,
...answering parts of my own question here:
I've managed to make a *workaround* for my issue by placing this code
---------------------------------------------------------------------
// Default fallback-width: 16 pixel
treeItem.getChildControl("icon").setWidth(
qx.util.ResourceManager.getInstance().getImageWidth(vIcon) || 16
);
---------------------------------------------------------------------
into the '__createTreeFile' method (see below)
But the question is:
Shouldn't this be done in the qx.ui.tree.TreeFile#setIcon method?
At least it seems to be that it was done "back in the old 1.2.1 days" ;)
For completeness, here's the code including my workaround:
---------------------------------------------------------------------
__createTreeFile : function (iconUrl)
{
var treeItem = new qx.ui.tree.TreeFile();
treeItem.addIcon();
treeItem.setIcon(iconUrl);
// **WA** Default fallback-width: 16 pixel
treeItem.getChildControl("icon").setWidth(
qx.util.ResourceManager.getInstance().getImageWidth(vIcon) || 16
);
// **WA-End**
var checkbox = new qx.ui.form.CheckBox();
checkbox.setFocusable(false);
checkbox.setTriState(true);
treeItem.addWidget(checkbox);
treeItem.addLabel(vLabel);
return treeItem;
}
---------------------------------------------------------------------
I hope (something like) this will be included into qx.ui.tree.TreeFile#setIcon
or qx.ui.tree.TreeFile#addIcon so I can remove this work-around
Thanks and regards,
Peter
> Hello devs,
>
> I've come across an issue with custom tree items that contain (combined)
> icons.
> The combined images are not 'cut'...
>
> You can see what I mean in the attached images:
>
> tree-20.png : Tree with qooxdoo 2.1.2
> tree-30.png : tree with qooxdoo 3.0.1
>
> To give you an impression of the combined icon image the 3rd attachment gives
> an example.
>
>
> The code currently used is something like this:
>
> ----------------------------------------------------------------------------
>
> // iconUrl is e.g. "app/tree/driver.png", "app/tree/fleet-pool.png",
> // "app/tree/fleet-user.png",... all from 'tree' resource folder
> // (from the combined image)
>
> __createTreeFile : function (iconUrl)
> {
> var treeItem = new qx.ui.tree.TreeFile();
>
> treeItem.addIcon();
> treeItem.setIcon(iconUrl);
>
> var checkbox = new qx.ui.form.CheckBox();
> checkbox.setFocusable(false);
> checkbox.setTriState(true);
> treeItem.addWidget(checkbox);
>
> treeItem.addLabel(vLabel);
>
> return treeItem;
> }
>
> // Folder icon is static from qx
> __createTreeFolder : function ()
> {
> var treeItem = new qx.ui.tree.TreeFolder();
> treeItem.addOpenButton();
>
> treeItem.addIcon();
> treeItem.setIcon("icon/16/places/folder.png");
>
> var checkbox = new qx.ui.form.CheckBox();
> checkbox.setFocusable(false);
> checkbox.setTriState(true);
> treeItem.addWidget(checkbox);
>
> treeItem.addLabel(vLabel);
>
> return treeItem;
> }
> ----------------------------------------------------------------------------
>
>
> Regards,
> Peter
--
***********************************************
Achtung, wir sind umgezogen!
Unsere neue Adresse:
TIS GmbH
Müller-Armack-Str. 8
46397 Bocholt
***********************************************
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel