Hi,
Is it possible to set the background-color for a checkbox or a radiobutton from the theme.json file?
We have many screens and are currently looking at making a custom theme to apply across our application.
Please note following image where the Active checkbox is using the background if the datawindow column but i would prefer to set the colour to light blue to match the datawindow itself.
The structure basically looks like this,
"datawindow": {
background-color: light-blue
"dwo-column": {
background-color: white
"checkbox-type" : {
"background-color": light-blue
I've also tried setting "background-transparent": true, however no luck.
I've also tried setting the "checkbox" background-color to light-blue however no luck either.
Cheers,
Cameron
*Edit*
Apologies I don't think I was clear enough, i was primarily hoping to change the background colour of the text, to match the background colour of the datawindow.
For example, The text background here would be blue but the checkbox stay whatever the .bmp or .png is set to or just stay white.
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- Can i set a checkbox or radio button background-color to transparent in theme.json?
- Cameron Grey-Caminiti
- PowerBuilder
- Tuesday, 5 September 2023 06:57 AM UTC
- Wednesday, 6 September 2023 22:52 PM UTC
- PowerBuilder
- # 1
Bumping question as it's still an issue and i cannot find a solution
Cheers,
Cameron
- Thursday, 7 September 2023 08:26 AM UTC
- PowerBuilder
- # 2
Hi Cameron,
At present, the theme for dw column does not support setting the background color of checkbox type column separately. The background color can be set for all columns.
In addition: When customizing the JSON file, you can delete items that do not need to be customized, but you should not move or add items.
Regards,
Kitty
- Cameron Grey-Caminiti
- Thursday, 7 September 2023 23:40 PM UTC
Are there any alternatives? Is there a way i can set the checkbox bakground color to transparent?
Cheers,
Cameron
-
Helpful Loading... Helpful 0
- Friday, 8 September 2023 01:59 AM UTC
- PowerBuilder
- # 3
Hi Cameron,
The checkbox and radiobutton columns in DW themselves support background color transparency. Did you set this in the background color expression?
The logic of the UI theme is expression first. You can also use expressions to set the colors you want.
Regards,
Kitty
- Cameron Grey-Caminiti
- Wednesday, 20 September 2023 01:07 AM UTC
Could i also clarify if the text for the checkbox can be set to transparent? does it relate to the checkbox image at all? Like in my original post / picture i had the 'active' checkbox background is white but the background for the text is white also. I would like to make the text blue if possible
-
Helpful Loading... Helpful 0
- Miguel Leeuwe
- Wednesday, 20 September 2023 01:49 AM UTC
-
Helpful Loading... Helpful 0
- Cameron Grey-Caminiti
- Wednesday, 20 September 2023 02:48 AM UTC
Unfortunately we're trying to avoid workarounds like that, if we could update the background colour of the text for the checkbox, that would save us a lot of trouble. If you could please look at the edit i added to my question as it may explain better what i'm trying to achieve.
Appreciate the help
-
Helpful Loading... Helpful 0
- Friday, 8 September 2023 18:31 PM UTC
- PowerBuilder
- # 4
Yes, this is possible, but you'll have to replace some of the theme's stock images with custom PNGs having transparency.
Search for the various "box-images" sections under the "datawindow" section of theme.json, and change the values to reference your custom images.
"box-images":
{
"unchecked":{"file":"checkbox-box-normal-unchecked.png"},
"checked":{"file":"checkbox-box-normal-checked.png"},
"indeterminate":{"file":"checkbox-box-normal-indeterminate.png"}
}
I've attached a couple of example PNGs that you can try out. They will render transparent, showing the underlying background color of the row.
- Cameron Grey-Caminiti
- Wednesday, 20 September 2023 01:05 AM UTC
Could i please confirm that using these pngs would also make the text background transparent for the checkbox - text.
For instance where you have 50s and 60s using different text backgrounds. So in my original message the text is white and the checkbox is white, is there a way to make the text go blue too?
Much appreciated,
Cheers,
Cameron
-
Helpful Loading... Helpful 0
- Ronnie Po
- Wednesday, 20 September 2023 16:18 PM UTC
Actually, there's no need to use themes at all. Just set the background color of the column control to transparent. You can still use a theme to customize the appearance, but it should have no effect on the transparency of the label portion of the checkbox control. For an example, see the additional images that I've attached.
Ronnie
-
Helpful Loading... Helpful 0
- Cameron Grey-Caminiti
- Thursday, 21 September 2023 00:44 AM UTC
Appreciate the help although the application already has hundreds of windows and going through each one, one by one, to update checkboxes and radiobuttons to transparent would take a considerable amount of time.
Preferably if i can do it via using themes, that would be the best outcome and i would be very happy with it.
Cheers,
Cameron
-
Helpful Loading... Helpful 0
- Page :
- 1
However, you are not allowed to reply to this question.
We’ll record this as a requirement and consider implementing it first when we enhance the UI theme feature in the later versions.
Regards,
Kitty