Author Topic: Toolbar Color Bug?  (Read 5648 times)

Offline BigAngryDog

  • Multiple posting newcomer
  • *
  • Posts: 75
    • BigAngryDog.com
Toolbar Color Bug?
« on: June 02, 2006, 06:36:12 am »
This maybe well known, but...

When using C::B in the Windows Classic Theme with various color schemes (including the "Standard" scheme) the toolbars seem to show incorrect background colors.

I often switch between color schemes, and C::B seems to showing background colours from the "Maple" scheme, which is the color scheme I had when I installed it.

Almost trivial, but looks kinda ugly. Suggests there is a color problem with the toolbars. Would it be easy to fix?

If a screen-shot would help, let me know.
BigAngryDog.com

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Toolbar Color Bug?
« Reply #1 on: June 02, 2006, 07:08:22 am »
Works fine here...

Offline BigAngryDog

  • Multiple posting newcomer
  • *
  • Posts: 75
    • BigAngryDog.com
Re: Toolbar Color Bug?
« Reply #2 on: June 02, 2006, 08:38:55 pm »
Screenshot below:

BigAngryDog.com

Offline HeroreV

  • Single posting newcomer
  • *
  • Posts: 6
Re: Toolbar Color Bug?
« Reply #3 on: June 04, 2006, 09:07:45 am »
It looks even worse when installing with "Windows Classic style" and switching to "Windows XP style".



(build 20060525)

Offline Vampyre_Dark

  • Regular
  • ***
  • Posts: 255
  • Hello!
    • Somewhere Over The Rainbow...
Re: Toolbar Color Bug?
« Reply #4 on: June 04, 2006, 10:07:51 am »
Odd. I've often switched my schemes back and forth with C::B opened at the time and nothing like that ever happened.
C::B Wishlist
~BOYCOTT THE EVIL YELLOW BOXES~

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Toolbar Color Bug?
« Reply #5 on: June 04, 2006, 10:09:55 am »
"Problem": wxDefaultDockArt initializes colours and brushes based on platform and saves them in member variables, so if you change the Windows' theme those variables won't be updated, reason it'll paint a few things with the old colours.

At least for the Gripper, the problem can be found at line 451 of wxAUI/manager.cpp.

To solve this problem, instead of initializing those members in the constructor and using them in the Draw* member functions directly, a function call should be made to set the right brush and colour. This function should be inlined and take care of all those platform dependent issues (just like the constructor does).

That way the caching is removed (would be better to keep it, but you see what we get) so the right colour is always applied.

Another approach would be updating those colours when the theme changes, but how would we know it?

Now we know it's a wxAUI's bug and we even know the cause, it should be reported to the wxAUI's developers.

Offline Szabadember

  • Multiple posting newcomer
  • *
  • Posts: 75
  • That's me!
Re: Toolbar Color Bug?
« Reply #6 on: June 04, 2006, 10:28:55 am »
I don't know if you can use WinAPI with wxWidgets but if yes, then watch WM_SYSCOLORCHANGE messages.

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Toolbar Color Bug?
« Reply #7 on: June 04, 2006, 08:36:23 pm »
Szabadember: Looking for that message I found wxWidgets has events for it. Thanks :)

Macro: EVT_SYS_COLOUR_CHANGED(func)
Event: wxSysColourChangedEvent

A patch would be even easier that way now :)