We're getting there, ChrisR - thanks for the latest updates, which solved most of my problems. Kudos! I'll separate the remaining issues with headings.
Issue #1
Your latest code still doesn't work for all my windows yet - one of them is a pop-up window (#win_popup that is between the For/Next loop below) and dark mode isn't applied to all the gadgets in it, despite doing the below. It works fine for the first window (#win_main).
Code: Select all
Global darkcolor=RGB(50,50,50)
For w=#win_main To #win_last
SetWindowColor(w,darkcolor)
SetObjectColor(w,#PB_All,darkcolor)
Next
Also, may I suggest that "SetWindowColor(w,darkcolor)" be done as part of SetObjectColor()?
Issue #2
I've noticed that your callback stops my own callback working - I'm not sure if a window can have more than one callback? My app loses a lot of functionality because your callback overrides mine, so I may not even be able to use your code after all due to this?
Issue #3
Do I have to pay for IceDesign to get the JellyButton code? I couldn't see the code on these forums anywhere.
Issue #4
There are no icons on Panel tabs in dark mode (see test code below). My app uses icons on every tab so I need to keep them.
Code: Select all
IncludeFile "ObjectColor.pbi"
Enumeration
#win_one
#win_two
EndEnumeration
Enumeration
#p1
#b1
#f1
#op1
#op2
EndEnumeration
Global darkcolor=RGB(50,50,50)
Global win_one=OpenWindow(#win_one,300,300,200,100,"One",#PB_Window_SystemMenu)
SetWindowColor(#win_one,darkcolor)
Global p1=PanelGadget(#p1,10,20,180,70)
AddGadgetItem(#p1,-1,"Tab 1",LoadIcon_(0,#IDI_EXCLAMATION)) ; No icon in dark mode. :(
Global b1=ButtonGadget(#b1,10,10,160,25,"Click me")
AddGadgetItem(#p1,-1,"Tab 2")
CloseGadgetList()
Global win_two=OpenWindow(#win_two,530,300,200,100,"Two",#PB_Window_SystemMenu|#PB_Window_Invisible)
SetWindowColor(#win_two,darkcolor)
Global frame=FrameGadget(#f1,10,10,180,70,"Frame")
Global op1=OptionGadget(#op1,20,30,100,20,"Option 1")
Global op2=OptionGadget(#op2,20,50,100,20,"Option 2")
SetDarkTheme()
SetObjectColor(#PB_All,#PB_All,darkcolor)
Repeat
ev=WaitWindowEvent()
If ev=#PB_Event_Gadget
Select EventGadget()
Case #b1 : HideWindow(#win_two,0)
EndSelect
EndIf
Until ev=#PB_Event_CloseWindow