abentele / Erbele

Erbele is a lightweight but powerful text editor for macOS.

Home Page:https://apps.apple.com/de/app/erbele/id1595456360?mt=12

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't see Line Numbers as Gutter Background is white on Mojave Dark Mode.

Namouk opened this issue · comments

To fix it change colorWithCalibratedWhite to 0.20 in Erbele>Classes>SubClasses>FRAGutterTextView.m

[self setBackgroundColor:[NSColor colorWithCalibratedWhite:0.20 alpha:1.0]];

Thanks for sharing, this fixed it for me too

It's not as simple.

To really support dark mode (and light mode as well):

  • the fix has to support both dark and light mode
  • the line numbers panel should have the same colors as the text edit view, or at least compatible colors; therefore when talking about a fix we have to consider foreground and background colors and also syntax highlighting colors of the editor can be changed in the settings
    => either the color settings must be editable for both dark and light mode, or the must be default settings for dark and light mode that can be enabled in the settings

There are several alternatives to solve it:

  • simply drop the settings: foreground and background colors of the text view; always use semantic foreground/background colors (defaults for text foreground/background from macOS) to support dark mode (i.e. black/white in bright mode); but there may be some people who already use the option to change colors...
  • add a feature "Themes". A theme defines a set of colors for the UI. There might be themes like "dark", "light", "green" etc., and the user can switch between these themes, ignoring the dark/light mode setting. Each theme includes colors for text editor foreground/background and syntax highlighting. And we could let the user decide which theme he wants to use for dark mode, and which theme for bright mode.

I'm open for discussions.
Please let me also know if you use the dark mode or not, to get an idea if it's worth to change something.

I use the dark mode, and a theme feature could be a good idea; anyway, to do things simpler you could simply add line numbers color in the Appearance setting panel.

Edit: I tried doing that, and it was working nicely, but adding the new fields to all the localizations took too long; so I converted the Appearance setting page to AutoLayout and Strings files, but didn't manage to do an auto layout working with all locales; so I gave up and made a simple code addition that you can see in the pull request posted below.

I just added a pull request with the code to fix the problem.

fix is ok.
The fix doesn't include tab bar and documents list size slider.
But it's an improvement to current implementation, so I merged it into abentele:master.
Thanks to @jawsoftware for contribution!

btw.: I've also migrated the project to Xcode 11.5 to be up-to-date.

additionally improved style for dark mode (tab bar, slider in documents list), see commit ea5be74

published release containing this improvement: https://github.com/abentele/Erbele/releases/tag/3.8.5

Thanks...!
I'm adding to preferences panels differentiated color choices for normal and Dark Mode; this requires editing some files, but it could solve other color problems of Dark Mode.