Finetuning Themes

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jimwatterson
Posts: 56
Joined: Thu Jul 09, 2020 8:31 am

Finetuning Themes

Post 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?
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

Re: Finetuning Themes

Post 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.
jimwatterson
Posts: 56
Joined: Thu Jul 09, 2020 8:31 am

Re: Finetuning Themes

Post 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.
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

Re: Finetuning Themes

Post 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
Arlyn Dale
Servias LLC
jimwatterson
Posts: 56
Joined: Thu Jul 09, 2020 8:31 am

Re: Finetuning Themes

Post 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.
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

Re: Finetuning Themes

Post by adale »

Jim,
Did you ever find/get a solution for a "disabled" ThemeDrawStyle without using Custom Style or other source edits?
Arlyn Dale
Servias LLC
jimwatterson
Posts: 56
Joined: Thu Jul 09, 2020 8:31 am

Re: Finetuning Themes

Post by jimwatterson »

I got an acknowledgement that this was a defect but no work around or indication that it would be fixed.
Post Reply