Firemonkey how to change a style property in a Stylebook - css

I have created a Stylebook component that has a toolbarstyle. All toolbars in my app have this stylelookup. This style consists of a TLayout filled with a TRectangle that has the stylename "background" that has the color red by default.
I want to let the user set the color of the toolbar with a TComboColorBox.
So when they choose a Color I want all the toolbars to change to the color they have picked.
Now I already know how to change the style for a single toolbar, but I don't want to set the property for each individual toolbar. With the code below I can change the style color for a single toolbar.
ToolBar1.StylesData['background.Fill.Color'] := ComboColorBox1.Color;
How can I do the same for all my toolbars at once? I gues change the StyleBook but how. Also the stylebook from my MainForm get's loaded in all my other forms too, so I also don't need to change it on every form.

Related

how i can make smaller the checkmark of Angular Material Checkbox?

I have been two days searching if there's any way to change the checkmark size, I have read others post, about how to change the checkmark color https://stackoverflow.com/questions/59347989/changing-the-color-of-the-angular-material-checkbox-checkmark?r=SearchResults&s=1|153.9657, size of the checkbox Change the size of angular material checkbox (mat-checkbox), etc but I don't see how I could change checkmark size.
And every single property that I try to change in the web inspector or doesn't make any change or change also the checkbox size.

ExtJS change border color of focused elements

I am trying to change a default focus border color in my ExtJS app. At the moment I use ExtJS 6 and its default Theme-Triton...
Is there a way to modify CSS property to affect all elements and change focus border color from blue to red (for example)?
You can create your own custom theme that extends to "theme-triton" then you can create a SCSS file with your custom colors, like $form-field-focus-border-color: #ff1744 to change the border color of the focused items in a form
Checkout on how to create the custom theme here
Otherwise, if you don't want to create your own theme, you can try to edit the css classes that are applied to the element you want to edit:
.x-form-trigger-wrap-focus{
border-color:#ff1744 !important;
}

How to change color of a button component of an ionic app in appery

I am a newbie in Appery. Can some one tell me the steps to set custom color for a Button component using CSS.
all Appery Buttons are set by CSS, so you have three options
you can choose one of the drop downs when you select the button called Swatch by picking a letter you can select the precoded colors from the drop down based on the theme you are using.
you can create a new css sub sheet and just assign a specific value a color or a specific group of items (all buttons) a color
(I WOULD NOT ADVISE THIS) you can edit the general css sheet for the theme.

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.

jfxtras - CalendarPicker change button color

How can I change the color of every toggle button of a CalendarPicker?
For instance, one button "red", one button "yellow" and so on.
You should be able to, if you can create a CSS rule for it. The toggle buttons are just toggle buttons, so they have the same CSS styleable features. So a "#mypicker .toggle-button" css rule should select them.
However, selecting individual buttons would require the use of something like "nth-child", but I believe JavaFX does not support that. There is a backdoor; the day togglebuttons get an id assigned, "day0", "day1", ... This is irrespective of whether the button is hidden or not.
https://github.com/JFXtras/jfxtras/blob/8.0/jfxtras-controls/src/main/java/jfxtras/internal/scene/control/skin/CalendarPickerControlSkin.java line 366
But this is a shaky dependency. If you have a good use case, I can of course assign a special unique style class to each button.

Resources