Dietrich Streifert schrieb:
I had a look in QxColorCache.js where (I think so ) the transformation
to a style property or color value is done and had the impression that
the string would be handled correct because the type is detected as
QxConst.TYPEOF_STRING. This results in translating the color name
transparent into the color value "transparent".
This type detection will be used for the value with which QxColorCache
will be called. This value is the value the user sets up. This is always
"transparent". The array in the defintion is only used for
hex-transformations and so on and is IMHO needed as otherwise the code
which will work a an array there will get a string as a result and the
consequence is that it will fail.
Please just change it this way and try it out. Thank you.
Regards,
Sebastian
If I add the [-1,-1,-1] as 'alias' to transparent this would be detected
as QxConst.TYPEOF_OBJECT and this is then transfered by:
propKey = QxColor.RGBCSS_START +
propValue.join(QxConst.CORE_COMMA) + QxColor.RGBCSS_STOP;
which obviously is wrong.
In QxColor.js in the method _normalize the color is detected by:
case QxConst.TYPEOF_STRING:
vInValue = vInValue.toLowerCase();
if (QxColor.htmlNames[vInValue])
{
this._isHtmlColor = true;
}
so the code part
if (!this._isRgbColor)
{
this._red = this._green = this._blue = null;
this._style = this._isHtmlColor ? vInValue : null;
}
else
{
this._style = null;
if (!(this._red >= 0 && this._red <= 255 && this._green >= 0 &&
this._green <= 255 && this._blue >= 0 && this._blue <= 255)) {
throw invalid;
};
};
leads to the correct behaviour and sets this._style = "transparent".
Again having here [-1,-1,-1] would lead to the line "throw invalid;".
So my summary of all this is that the current patch does not break the
code.
Sebastian Werner schrieb:
Dietrich Streifert schrieb:
Here we go:
First I added the value "transparent" to the QxColor.htmlNames hash
in QxColorCore.js. Now the color value "transparent" is accepted by
the color management.
Then I set the background color "white" to the QxComboBox and
"transparent" to the textfield in QxComboBox.js.
Now It works as expected!
Here are the patches:
Well done - thank you.
One problem is there. You can't define a color in data structure (your
change in QxColorCore) which has no array as value. "transparent"
there could be problematic for other code. Does this also work if we
define the values as [-1,-1,-1] there. Yes I know a bit hacky, but I
don't want to add even more check routines to the color code to handle
this special color value, which could not be mapped to RGB.
Could you test it?
Could you submit a example, which I can add to the test-directory?
Thank you again.
Regards,
Sebastian
Dietrich Streifert schrieb:
Sebastian Werner schrieb:
I don't like this.
What's about to make the field iself transparent and setup the
background color of the combobox per default to "white". Then the
combobox should behave the same like other fields. I have not
implemented it yet. Any help (in form of a patchfile) is
appreciated for this.
Ah! That's a great idea. But nor QxColor neither
setBackgroundColor() do accept the value "transparent".
After digging a bit in QxColor it looks lik the color transparent is
not handled at all!
So I think the color transparent has to be implemented first in
QxColor.
Is this right?
------------------------------------------------------------------------
--- source/script/widgets/QxComboBox.js.orig Tue Nov 8 13:00:21 2005
+++ source/script/widgets/QxComboBox.js Tue Nov 8 13:01:12 2005
@@ -51,8 +51,8 @@
this.setWidth(120);
this.setHeight(QxConst.CORE_AUTO);
this.setBorder(QxBorderObject.presets.inset);
+ this.setBackgroundColor("white");
-
//
***********************************************************************
// LIST
//
***********************************************************************
@@ -102,7 +102,8 @@
f.setReadOnly(true);
f.setCursor(QxConst.CORE_DEFAULT);
f.setSelectable(false);
-
+ f.setBackgroundColor("transparent");
+ this.add(f);
------------------------------------------------------------------------
--- source/script/gui/QxColorCore.js.orig Tue Nov 8 12:52:25 2005
+++ source/script/gui/QxColorCore.js Tue Nov 8 12:52:39 2005
@@ -81,7 +81,8 @@
teal : [ 0,128,128 ],
black : [ 0,0,0 ],
silver : [ 192,192,192 ],
- gray : [ 128,128,128 ]
+ gray : [ 128,128,128 ],
+ transparent : "transparent"
};
// TODO: Add some IE related colors (IE 4.x)
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel