Darkmode Scrollbars

  1. 3 weeks ago

    Jeff T

    Jan 26 Midlands of England, Europe

    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?

  2. Markus W

    Jan 26 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...

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

  3. Roger C

    Jan 26 Lewis Center, OH

    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.

  4. Jeff T

    Jan 26 Midlands of England, Europe

    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.

  5. Markus W

    Jan 26 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...

    Compare the two projects with Arbed?

  6. Jeff T

    Jan 26 Midlands of England, Europe

    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

  7. Markus W

    Jan 26 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...
    Edited 3 weeks ago

    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.

  8. Markus W

    Jan 26 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...
    Edited 3 weeks ago

    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.

  9. Greg O

    Jan 26 Xojo Inc

    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.

  10. Greg O

    Jan 26 Xojo Inc

    @Jeff T , have you tried 2018r4?

  11. Markus W

    Jan 26 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...
    Edited 3 weeks ago

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

    Went back to 2012 R1, works as well.

  12. Jeff T

    Jan 27 Midlands of England, Europe

    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.

    Thank you for looking into that.
    I'll give this a try later today (just woke up)

    @Jeff Tullin , have you tried 2018r4?

    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

  13. Jeff T

    Jan 27 Midlands of England, Europe
    Edited 3 weeks ago

    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. :(

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

  14. Markus W

    Jan 27 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...
    Edited 3 weeks ago

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

  15. Jeff T

    Jan 27 Midlands of England, Europe

    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

  16. Greg O

    Jan 27 Xojo Inc

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

  17. Jeff T

    Jan 27 Midlands of England, Europe

    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

or Sign Up to reply!