1. Cameron Grey-Caminiti
  2. PowerBuilder
  3. Tuesday, 5 September 2023 06:57 AM UTC

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.



Ronnie Po Accepted Answer Pending Moderation
  1. Friday, 8 September 2023 18:31 PM UTC
  2. PowerBuilder
  3. # 1

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.

 

 

Attachments (4)
Comment
  1. Cameron Grey-Caminiti
  2. Wednesday, 20 September 2023 01:05 AM UTC
Afternoon Ronnie



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



  1. Helpful
  1. Ronnie Po
  2. Wednesday, 20 September 2023 16:18 PM UTC
Hi Cameron,



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
  1. Helpful
  1. Cameron Grey-Caminiti
  2. Thursday, 21 September 2023 00:44 AM UTC
Hi Ronnie,



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
  1. Helpful
There are no comments made yet.
kitty he @Appeon Accepted Answer Pending Moderation
  1. Friday, 8 September 2023 01:59 AM UTC
  2. PowerBuilder
  3. # 2

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

Comment
  1. Cameron Grey-Caminiti
  2. Wednesday, 20 September 2023 01:07 AM UTC
Hey Miguel,



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
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 20 September 2023 01:49 AM UTC
What you can do is have no text in your checkbox, make it as small as the check is and use a separate text on the side of the checkbox to show a label.
  1. Helpful
  1. Cameron Grey-Caminiti
  2. Wednesday, 20 September 2023 02:48 AM UTC
Thank you Miguel for the timely response and continuing to help me in this matter.



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
  1. Helpful
There are no comments made yet.
kitty he @Appeon Accepted Answer Pending Moderation
  1. Thursday, 7 September 2023 08:26 AM UTC
  2. PowerBuilder
  3. # 3

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

Comment
  1. Cameron Grey-Caminiti
  2. Thursday, 7 September 2023 23:40 PM UTC
Hi Kitty thank you for replying.



Are there any alternatives? Is there a way i can set the checkbox bakground color to transparent?



Cheers,

Cameron
  1. Helpful
There are no comments made yet.
Cameron Grey-Caminiti Accepted Answer Pending Moderation
  1. Wednesday, 6 September 2023 22:52 PM UTC
  2. PowerBuilder
  3. # 4

Bumping question as it's still an issue and i cannot find a solution

 

Cheers,
Cameron

Comment
  1. kitty he @Appeon
  2. Friday, 8 September 2023 05:26 AM UTC
Hi Cameron,

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

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.