1. Giuseppe moglia
  2. PowerBuilder
  3. Wednesday, 10 February 2021 09:31 AM UTC

Hi Guys

 

anyone has already developed a window to manage the theme? So any user can modiify it's own theme safely?

 

thanks

Benjamin Gaesslein Accepted Answer Pending Moderation
  1. Friday, 12 February 2021 13:30 PM UTC
  2. PowerBuilder
  3. # 1

It's certainly possible to "roll your own" but it does indeed involve some work. I wouldn't say "too much" work, nothing a little elbow grease won't fix. Probably the easiest way would be to create a theme.json with placeholders for colors that can be replaced with user-defined colors at runtime by applying a global replace function on the entire file for each placeholder.

Or you could properly parse and edit the json file using the various json objects PB supplies. No placeholders needed and not as brute-force-y as the previous approach but more difficult to pull off.

I just wish PB themes would support:

1. transparent and partially transparent image files instead of strictly solid-color bitmaps for the control menu buttons

2. seperate files for active and inactive window buttons in hover state.

I've written a simple bitmap color replacer that got me around issue #1 but not the second. When active and inactive windows have different titlebar colors, hovering over the inactive buttons creates a color mismatch. It's not too bad when the colors aren't too different but if you go crazy and have, say, orange active titlebars and green inactive ones, it would be a rather jarring effect. Even more jarring than an orange/green theme would inherently be, that is.

Support for semitransparent greyscale pngs would alleviate this.

Comment
  1. Giuseppe moglia
  2. Friday, 12 February 2021 13:46 PM UTC
I totally agree
  1. Helpful
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Wednesday, 10 February 2021 23:55 PM UTC
  2. PowerBuilder
  3. # 2

What I did was create a window where you can pick any of the standard themes (where you could also add in an option for new custom themes you have created) along with a selection to go back to no theme.  As others have mentioned it would be too much work to allow custom configuration on the fly and could get very messy.  Always best to control the choices to what you have developed or come out of the box.

 

My $.02

Kevin

Comment
There are no comments made yet.
Ronnie Po Accepted Answer Pending Moderation
  1. Wednesday, 10 February 2021 17:03 PM UTC
  2. PowerBuilder
  3. # 3

This could be opening a can of worms...you might also need to replace graphic elements like the minimize and maximize buttons, for example, to match colors with window title bar colors.

Themes can be a great tool to take control AWAY from the users, so they can't make things look silly by changing Windows settings, e.g.

Comment
  1. Ronnie Po
  2. Wednesday, 10 February 2021 17:32 PM UTC
Maybe you can rig up a simple color picker dialog that allows the user to pick values for just those properties (background, font, etc.), and have your app modify the JSON files based on their selections. Or maybe that was your original question - whether someone had already done this!
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 10 February 2021 21:32 PM UTC
Hi Ronnie;

My STD Framework does this and allows any App user to colourize and set the font / zoom perspective as they see fit. the framework then sets the Window controls and DWO's accordingly. The main colour settings are given in the App's initial INI file. Then the App user's modifications (over-rides) are saved in the INI & restored back 100% upon App restart..

I just created a multimedia player that uses Themes but also uses the framework's colourization to help "tweak" the look & feel here & there. However personally, letting the App colourize itself based on the business users visual acuity needs is the best IMHO. Also, borders stay nice and grab-able and from I have found since the PowerSoft days, this self tuning feature always works in the next PB release. In my case, also now PB/PS 2021 as well. ;-)

Regards ... Chris
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 10 February 2021 21:35 PM UTC
Hi Ronnie;

PB has a built in Colour chooser feature (from the PowerSoft days) . Just use the ChooseColor() command. ;-)

HTH - Regards ... Chris
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 10 February 2021 14:31 PM UTC
  2. PowerBuilder
  3. # 4

You mean like a visual editor to create the JSON for UI Themes?

Comment
  1. Armeen Mazda @Appeon
  2. Wednesday, 10 February 2021 15:07 PM UTC
I seriously doubt anybody created this because the amount of work is significant to make this so it works well.

Unfortunately, it is not on our roadmap for next 2 versions to ad visual editor for this, so please be careful when you type the JSON. ;-)

  1. Helpful
  1. Giuseppe moglia
  2. Wednesday, 10 February 2021 15:19 PM UTC
I'm careful but I cannot say it for my customers trying to change it ;-)
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Wednesday, 10 February 2021 15:50 PM UTC
I know... not everybody is so careful. Unfortunately, I'm not aware of any tool exactly designed for UI Themes, but there are basic JSON validators/editors that might reduce silly mistakes. You can Google for such JSON tools and see if they are useful for your situation.
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.