I wanted to use a Scintilla text editor. That works fine, thanks to Christian.
But… the authors of Scintilla seem to ignore what is Dark mode…
I can change many colors but…
I don’t see how to change the background color of the markers’s margin.
I can’t change the color of the caret despite the fact we have properties to do that.
Is there someone who succeeded in using Scintilla in dark mode (with correct colors) ?
Yes. It’s still early days for me in a new project I’m playing with, but I’m able to have Scintilla switch between light & dark mode, on macOS (note: I don’t do windows).
If you’re switching between light & dark on the fly (whether through code, or System Settings > Appearance), I found that you have to “refresh” your colour assignments deliberately, because Scintilla doesn’t detect the change on it’s own.
In my case, I set the above two methods to the same colour value, because I don’t like the cross-hatch highlight background pattern. I also use the same colour for the line number background to make both gutters blend together (which I think is easier to look at).
Oh yes : Self.CaretForeColor = &c00000000 is the default setting
but if you want to set it in white Self.CaretForeColor = &cffffff (in DarkMode), well… it is still in black…
CaretForeColor = color.TextColor → still in black
CaretForeColor = whatever you want → still in black
In fact, whatever the caret property you set, it does absolutely nothing :
self.CaretStyle = DesktopScintillaControlMBS.kCaretStyleLine
self.CaretForeColor = &cff000000
self.CaretLineVisible = True
self.CaretLineBackColor = &c7f0000ff
self.CaretWidth = 4
the caret is still black, 1 pixel width and without background
Without seeing the code of your project it is hard to say why it’s not working. I suspect it is where/when you are setting these properties.
I slightly modified @Christian_Schmitz’s ScintillaTest example project to enable some of the Caret properties in the following download. See the SetupXojo() method - near the bottom of the code window.
Note: I used Xojo 2024r1.1 on macOS 14.6.1 to edit the example. I hope this helps.
Edited: I used MBS 24.3 to edit & test the example, but I’m also using Scintilla with MBS 24.4pr2 with Xojo 2024r2.1