Flex - Custom tooltip style for a single component - css

How can we customize the background and font color of a single instance of a tooltip for one component? (Without changing all tooltips in the application.)
This is needed for the HALO component set (4.1 SDK), not Spark (css methods preferred).

Created a named style, using styles that are applicable to the ToolTip component; and when you create the ToolTip specify that style.
You can read these instructions for customizing a ToolTip.
Basically, listen to the toolTipShown event and set the styleName on the toolTip.

Related

Qt Designer button image change while keeping windows style?

I can change the image or any other style of a QPushButton in the designer by changing the stylesheet, but any change in the style sheet changes all the other properties.
For instance, when I change the border image everything else is changed and it does not inherit the rest of the properties from the parent (or windows style).
How can I keep the windows style while changing only the image?
From How can I set Styles to a QTabwidget without overwriting existing styles in QT ?:
A style sheet is all or nothing. so if u all apply style sheet, it
might sort of reset the look for some widgets and to fix that, you
must supply a full stylesheet.
The key parts are:
A style sheet is all or nothing.
you must supply a full stylesheet.
You can set an image for the QPushButton from the code or by using QtDesigner like this:
Select the button
In the properties window set the image and the
size (properties icon and iconSize).
Did you try set style to the single push button:
your_push_button_pointer->setStyleSheet(
"QPushButton{background-image: url(:/images/call_up.bmp);}"
"QPushButton:hover{background-image: url(:/images/call_hov.bmp);}"
"QPushButton:pressed{background-image: url(:/images/call_down.bmp);}");

Dynamically change QStyle at runtime?

I want to tweak the existing style at runtime, specifically QStyle::PM_ToolBarIconSize. Can this be done? As far as I can tell, you can only inherit QStyle and override pixelMetric().
Edit 1: In the specific case of QStyle::PM_ToolBarIconSize, I could use QToolBar::setIconSize, but that would set the icon size for just a single toolbar instance. I want to change the underlying style hint to affect all toolbars everywhere with one fell swoop. And QStyle::PM_ToolBarIconSize may not be the only style I want to tweak, it's just the first one I'm looking at that just so happens to have a "change this instance's icon size" function.
Edit 2: I can't just make a new style subclass because the current style is already a custom style based on style sheets. There are several styles that a user can choose from. I don't want to create a bunch of new styles just so I can tweak a couple of toolbar icon or menu height size settings.
This is the exact purpose of QProxyStyle.
Why not overriding QStyle then? Your subclass would return an icon size (via pixelMetric) which depends on a settable parameter of your QStyle.
As Qt does not have a dynamic QStyle mechanism, it is better to create a new style instance with the changed icon size, then set it to the QApplication, rather than altering the current style.

How to customize flex tree icon programatically

I can modify the icons of mx.controls.Tree component using setStyle
tree.setStyle("disclosureOpenIcon",myIcon1);
tree.setStyle("disclosureClosedIcon",myIcon2);
tree.setStyle("folderClosedIcon",myIcon3);
tree.setStyle("folderOpenIcon",myIcon4);
tree.setStyle("defaultLeafIcon",myIcon5);
Where myIconx is of class "Class" which is embedded images.
But i need to customize the icons in a way that icons should be drawn using actionscript, we can use a component extended from sprite/uicomponent for showing an actionscript drawing. But how we can use that as a tree icon?
Make a custom item renderer, read documentation http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/treeClasses/TreeItemRenderer.html ,

How to customize accordion and panel look

I want to increase the (height) size and change the color of a spark accordion header, similarly I want to change the color of a spark panel header. Can I do this through mxml properties and css or will I need to use a custom skin?
I recommend creating a custom skin. That was the way Spark was designed to be customized. Specific styles and the sort are almost an afterthought.

Flex combobox custom icon

Trying to set the up and down state icons of a Flex Combobox to images. I see the property for changing the color of the icon, but no property to skin it. How can I do this?
The "properties" are actually styles on ComboBase: upSkin, downSkin, overSkin, disabledSkin.
The default is ComboBoxArrowSkin--take a look at the source code to get more details about overriding or customizing it.

Resources