Page 1 of 1

Finetuning Themes

Posted: Tue Dec 20, 2022 10:43 am
by jimwatterson
I've created a theme based on our corporate colors. I've selected a Primary color and they are both fairly dark blue shades. My issue is that when disabled the text is black which is unreadable and make the button look odd. In the details panel for the button the only setting I have is ThemeDrawStyle = 'MediumTitle'. I assume there is a way of overriding just part of this style. Anyone have any ideas?

Re: Finetuning Themes

Posted: Tue Dec 20, 2022 11:16 am
by BrendanB
Jim,

try creating a 'CustomDrawStyle' (2nd Tab at the top labelled 'Draw Styles' )

This will allow you to customise all the bits and pieces (ie. MouseOver,FocusInactive,SelectedInactive etc..)

then you set the ThemeDrawStyle to whatever the custom style was named.

It can be a bit fiddly though.... ;)

The 'advantage' of not creating custom draw styles:

all the styles you use are available REGARDLESS of the chosen theme....

as you have discovered, there are times when you need to adjust things further, so you will need to be able to 'add' bits...

you can also apply 'styles' to most controls (using the 'Styles' tab.... although this gets further away from the Theme bit...).

you can even do things like:

ThemeDrawStyle := 'MediumTitle+Text(255,255,255,1)'

Text,Back and Border accept RGBA values seperated by commas -- note, Border only sets the color, so you need to have applied something with a border already:

ThemeDrawStyle := 'Card+Border(255,0,0,1)'



Good Luck.

BB.

Re: Finetuning Themes

Posted: Tue Dec 20, 2022 1:52 pm
by jimwatterson
Thanks Brendan. I realize that I can create a CustomDrawStyle but it should be possible to override a single attribute of a style without reinventing the wheel. Plus using Themes allows us to get a consistent look and feel with a setting in one place. We want to instruct our developers to 'always select 'ACCENT' from the Default Buttons list for primary buttons and use 'ACCENT' from the flat button list for all others and not have to apply a custom format afterwards. This would allow us to switch to another theme and know it will display consistently.

A lot of work has gone into the Theme support as a replacement for Styles but I think the lack of documentation is a let down.

Re: Finetuning Themes

Posted: Thu Dec 22, 2022 3:29 am
by adale
Jim,
I am not sure this is what you are looking for, but an idea might be to use a bit of code to control the look of the button when it is not enabled, and then copy this code snippet as a template to re-use where needed.

In this snipped, #ShowError is a button I have in a test VL web view. You could adjust the theme value for your needs, such as a "50" setting of your theme color?

CASE Of_Field(#ShowError.Enabled)
WHEN Value_Is(*EQ 'False')
#ShowError.ThemeDrawStyle := 'MediumError+ForegroundLightPrimary'
OTHERWISE
#ShowError.ThemeDrawStyle := 'MediumError'
ENDCASE

Re: Finetuning Themes

Posted: Thu Dec 22, 2022 10:28 am
by jimwatterson
Thanks for the suggestion but I want the theme to do all the work so that all our applications are consistent and without developers having any need to mess with colors et cetera.

I've lodged a support ticket and I will share their response here.

Re: Finetuning Themes

Posted: Fri Aug 04, 2023 2:54 am
by adale
Jim,
Did you ever find/get a solution for a "disabled" ThemeDrawStyle without using Custom Style or other source edits?

Re: Finetuning Themes

Posted: Thu Aug 10, 2023 5:25 pm
by jimwatterson
I got an acknowledgement that this was a defect but no work around or indication that it would be fixed.