Darkmode Scrollbars

Xojo 2018r3
New project, Supports darkmode = true
Drag a scrollbar onto a window, run, its black

Old project, supports darkmode = true
Listboxes are in dark mode.
Window is in dark mode
Panels
But the scrollbars remain light mode.

Any ideas why?

No, but quit Xojo and empty the cache, then try again?

There have been multiple reports of old projects not updating correctly in dark mode. Not sure what are the parameters which cause this nor whether anyone has found a solution.

Currently:
An ‘old’ document window with controls including 2 scrollbars, scrollbars and the window background stay white.
A second (newly created one) with scrollbars only, they go black

I have cleared the cache, I have no script in place.
I call no APIs on the problem window.
It has no custom color set
This happens to scrollbars I add to the problem window too.

Compare the two projects with Arbed?

I dont have a working project versus a non-working one
I have a working window versus a different non-working window in the same project.
Cant think of a way to compare that in Arbed

Make a Project with just a scrollbar in an old Xojo or even REAL.studio version.

Make a project with just a scrollbar in a newer Xojo version.

Compare the two in Arbed.

The left project was done in 2015 R4.1, the right project in Xojo 2018 R3

Window1.ScrollBar1.-.PartID ShortProp right only PtID = 2108508159

After loading the old project into 2018 R3, enabling dark mode, and saving again I get two different property values

Window1.ScrollBar1.-.PartID ShortProp differ Property 575320063 2108508159

So make a copy of your old project, load it into Arbed, and maybe replace 575320063 by 2108508159

Btw done on MacOS Sierra 10.12.6, not Mojave.

If someone has a project that does this reliably, I’d love to have it in a Feedback case so we can get it fixed.

@Jeff Tullin , have you tried 2018r4?

Hmmm, tried it on a Mojave system, both are dark.

Went back to 2012 R1, works as well.

[quote]So make a copy of your old project, load it into Arbed, and maybe replace 575320063 by 2108508159

Btw done on MacOS Sierra 10.12.6, not Mojave.[/quote]
Thank you for looking into that.
I’ll give this a try later today (just woke up)

Not yet.
Because of “KillerToolbar” issues, anything 2018 onwards has been no use to me.
I’ve spent some time removing it and creating a new toolbar replacement from more or less scratch (with a lot of help from Dave S)
Now that I can run the project in 2018x, I can dump the trial 2018 R1 and r3 , and start again with R4

Stripped a lot of windows and controls and code.
Opened in 2018r3, while not set to ‘supports dark mode’
A large canvas in the window turned black while the window stayed white ,but drew crazy corrupted lines when resized (the ‘has to be 4 pixel wide’ issue resurfacing??)

Started to generate a stripped down example:
Sadly, after removing all other windows, and all code, so that I ended up with only a handful of controls including the scrolls, darkmode started working. :frowning:

Theres a lot of stuff to unpick if I try to isolate control by control.

Is the scrollbar on another control? Could it be a problem with transparency?

Good thinking, but the window itself doesnt go dark.
Some controls do, the scrollbars were the most obvious ones that did not.
I just found that the window didnt , after resizing the controls to ensure no overlaps

Do you have any declares in your project for altering window appearance?

I had some, which I removed without apparently making a difference.
They are

#if TargetMacOS then
Declare Sub CGContextSetLineDash Lib “Cocoa” ( context As Integer, phase As Single, lengths As Ptr, count As UInt32)
#endif

#if TargetMacOS
Declare Sub setTitleWithRepresentedFilename Lib “Cocoa” Selector “setTitleWithRepresentedFilename:” _
(NSWindow As Ptr, filePath As CFStringRef)
//setTitleWithRepresentedFilename(Ptr(Handle), “abc.txt”)
#endif

#if TargetMacOS then
Declare Function collectionBehavior Lib “AppKit” Selector “collectionBehavior” ( obj As Integer ) As UInteger
Declare Sub setCollectionBehavior Lib “AppKit” Selector “setCollectionBehavior:” ( obj As Integer, value As UInteger )
Const NSWindowCollectionBehaviorFullScreenAuxiliary As UInteger = 256

Dim behavior As UInteger = collectionBehavior(self.Handle)
setCollectionBehavior(self.handle, behavior Or NSWindowCollectionBehaviorFullScreenAuxiliary)

#endif