OpenFile displayed in light mode

I’ve just noticed that when my system is set to Dark mode (macOS 12.6.3), calling the SaveAsDialog opens the dialog in Light mode instead of Dark Mode. Since other, non-Xojo apps open it in Dark mode, I can only assume this is an issue in the Xojo framework.

Is there a flag I’ve missed in my code to initialize the dialog:

Dim dlg As SaveAsDialog
Dim f As FolderItem
Dim filepath As String
// get folder/file path code
// ...
//
dlg = New SaveAsDialog
dlg.Filter = "application/x-bru"
dlg.Title = "Specify BRU Archive Disk File"
dlg.InitialDirectory = f
dlg.SuggestedFileName = GetPrefString("DefaultDiskFilename", "PE Archive.bru")
dlg.PromptText = "Please Enter a filename for BRU to save the Archive data into."
f = dlg.ShowModalWithin(win)

Have I missed something, or is this a framework issue?

I’ve not been able to reproduce this issue using your code. However, my application is API2. I’m also using macOS 13.3 beta, so not a great comparison. I’ve never had to do anything special to make the dialogs obey dark mode.

Here’s what I see -

This is Pages -

Which all looks good. The only change I made to your code is as follows:

Dim dlg As SaveAsDialog
Dim f As FolderItem
Dim filepath As String
// get folder/file path code
// ...
//
dlg = New SaveAsDialog
dlg.Filter = "application/x-bru"
dlg.Title = "Specify BRU Archive Disk File"
dlg.InitialDirectory = f
'dlg.SuggestedFileName = GetPrefString("DefaultDiskFilename", "PE Archive.bru")
dlg.PromptText = "Please Enter a filename for BRU to save the Archive data into."
f = dlg.ShowModal(Self)

Commented out the SuggestedFileName because it used a function not provided and changed ShowModalWith to ShowModal because I’m using a DesktopWindow rather than a Window.

The titlebar on that window is also light mode. Did you set Supports Dark Mode to True in the Shared build settings?

2 Likes

There’s something else going on there. In your screenshot, the pop up menus are also not in dark mode.

2 Likes