Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode "windows mode" and defaults options #12466

Closed

Conversation

ozone10
Copy link
Contributor

@ozone10 ozone10 commented Nov 5, 2022

Add additional options to dark mode

  • enableWindowsMode – values "no" and "yes"
    • enableWindowsMode="yes" will enable "Windows mode", dark mode depends on OS, supported only on Windows 10 and later
  • defaults:
    • darkThemeName, lightThemeName
      • "filename of theme"
      • "" – for default theme in respective mode
        • default values: darkThemeName="DarkModeDefault.xml", lightThemeName=""
    • darkToolBarIconSet, lightToolBarIconSet
      • "0" – Fluent small
      • "1" – Fluent big
      • "2" – Fluent small filled
      • "3" – Fluent big filled
      • "4" – Standard
        • default values: darkToolBarIconSet="0", lightToolBarIconSet="4"
    • darkTabIconSet, lightTabIconSet
      • "0" – Standard (floppy disk)
      • "1" – Alternate
      • "2" – Dark
        • default values: darkTabIconSet="2", lightTabIconSet="0"
    • darkTabUseTheme, lightTabUseTheme - currently hidden option
      • "no" – don't use theme
      • "yes" – use theme colors for active tab text, inactive tab background and inactive tab text
        • default values: darkTabUseTheme="no", lightTabUseTheme="yes"

example (relevant part in confix.xml):

<GUIConfig name="DarkMode" enable="yes" colorTone="0" customColorTop="2105376" customColorMenuHotTrack="4210752" customColorActive="4210752" customColorMain="2105376" customColorError="176" customColorText="14737632" customColorDarkText="12632256" customColorDisabledText="8421504" customColorLinkText="65535" customColorEdge="6579300" customColorHotEdge="10197915" customColorDisabledEdge="4737096" enableWindowsMode="no" darkThemeName="Obsidian.xml" darkToolBarIconSet="2" darkTabIconSet="1" darkTabUseTheme="no" lightThemeName="" lightToolBarIconSet="4" lightTabIconSet="0" lightTabUseTheme="yes" />

closes #9183
closes #9992
closes #10153
closes #10239
closes #10544
closes #10644
closes #11867
closes #10239
closes #12427

@ArkadiuszMichalski
Copy link
Contributor

Such switch can't be add directly in Preferences (there is some space)? What is the profit of creating separate xml files for a single option?

@ozone10
Copy link
Contributor Author

ozone10 commented Nov 7, 2022

@ArkadiuszMichalski
this is something i did long time ago to test dark mode.

I want to rework this PR so Notepad++ use setting file with advanced option for dark mode: disabling dark mode support for plugin globally, which theme and icons to set when toggling dark mode, and maybe more.

I've thought I've got some free time, but urgent IRL stuff came instead. I will close this PR for now.

@ozone10 ozone10 closed this Nov 7, 2022
@ozone10 ozone10 reopened this Nov 7, 2022
@ozone10 ozone10 marked this pull request as draft November 7, 2022 20:33
@ozone10
Copy link
Contributor Author

ozone10 commented Nov 7, 2022

Had some time to do rework.

@ArkadiuszMichalski
Copy link
Contributor

@ozone10 This option disableTabIconsChange not work. Also how can we set default theme (stylers.model.xml)?
Nice options, I wish in some day we have Dark Mode Advanced tab on Prefs for them :) But if that is not an option then a separate file is better than no control at all.

@donho
Copy link
Member

donho commented Nov 8, 2022

@ozone10
Why those options should be in a separated xml file?

@ozone10
Copy link
Contributor Author

ozone10 commented Nov 8, 2022

@ArkadiuszMichalski
disableTabIconsChange for now only prevent disabling alternate icons when turning on dark mode.
For default theme you can use "" or any wrong name 😎.

@donho
I don't have much free time now so consider this as draft/test now, more like proof of concept.

I can move them to main config later. Currently it makes testing easier.

@ArkadiuszMichalski
Copy link
Contributor

disableTabIconsChange for now only prevent disabling alternate icons when turning on dark mode.
For default theme you can use "" or any wrong name 😎.

Ok, for default theme empty "" works fine, but any wrong name do nothing.

@ozone10
Copy link
Contributor Author

ozone10 commented Nov 8, 2022

@ArkadiuszMichalski

Ok, for default theme empty "" works fine, but any wrong name do nothing.

You are right I forgot that I did not commit that. But now I see this might be better (less code).

btw about tab icons did you mean allow icon set with floppy disk to be used in dark mode. I don't think dark set should be used in light mode.

@ArkadiuszMichalski
Copy link
Contributor

ArkadiuszMichalski commented Nov 8, 2022

btw about tab icons did you mean allow icon set with floppy disk to be used in dark mode. I don't think dark set should be used in light mode.

Yes, if my actual icon set is floppy then don't change them as disableTabIconsChange suggest. Why not use this icon when dark mode is on? Are they somehow less visible than these alternates? Anyway, I can't find out because they switch.
Another option is the tabIconSet argument for DarkModeDefaults/LightModeDefaults with 3 values (0-disk, 1-alter, 2-dark) to force it.

@ozone10 ozone10 changed the title Add guard file to disable changing theme, tab and toolbar icons when toggling dark mode Dark mode advanced options Nov 10, 2022
@ozone10
Copy link
Contributor Author

ozone10 commented Nov 10, 2022

@ArkadiuszMichalski
I have implemented settings for tab icons, there might be some inconsistent behavior. I did not test it thoroughly.

Next time (week?) I will try to implement setting for tab background and text colors, use colors from style configurator (currently default in light mode) or use default ones (currently background in dark mode, text color is "inverted")

@chcg chcg added the dark mode Dark mode related issues, fixes label Nov 10, 2022
@ozone10 ozone10 force-pushed the DarkModeNoThemeIconChange branch 2 times, most recently from 96761f4 to f0a2272 Compare November 12, 2022 18:52
@ozone10 ozone10 marked this pull request as ready for review November 12, 2022 18:56
@donho donho self-assigned this Nov 13, 2022
@ozone10
Copy link
Contributor Author

ozone10 commented Nov 13, 2022

@donho
sorry for another commit. But I will be away and I think "windows mode" is really nice feature.
Unfortunately currently this PR doesn't allow forcing theme at start (I don't have time to implement it).

Also some issue with portability because of absolute path for theme.

<GUIConfig name="stylerTheme" path="D:\test\Notepad++\themes\Hello Kitty.xml" />

@ozone10 ozone10 closed this Nov 13, 2022
@ozone10 ozone10 reopened this Nov 13, 2022
@ozone10
Copy link
Contributor Author

ozone10 commented Nov 13, 2022

Closing and reopening to force appveyor to cancel all previous commit build and start with latest.

@ozone10 ozone10 force-pushed the DarkModeNoThemeIconChange branch 2 times, most recently from bd7d74f to 6a207db Compare November 13, 2022 20:45
@ozone10 ozone10 closed this Nov 13, 2022
@ozone10 ozone10 reopened this Nov 13, 2022
@donho
Copy link
Member

donho commented Nov 21, 2022

Amazing! Thank you for your help @ozone10 !

It seems all work perfectly now. The only hidden option are 2 tabUseTheme - the default values darkTabUseTheme="no", lightTabUseTheme="yes" seems reasonable to me so let's keep them non-GUI way.

The PR is ready to merge into master if you don't see any other things.

@ozone10
Copy link
Contributor Author

ozone10 commented Nov 21, 2022

@donho
missing force theme at start

and maybe change to OS mode immediately after selecting "Follow Windows" option in preference
consider comments below

@ArkadiuszMichalski
Copy link
Contributor

@ozone10 DarkModeAdvancedOptions (what we see on the top #12466 (comment)) exist anywhere? All of these settings are kept in DarkMode.

@ozone10
Copy link
Contributor Author

ozone10 commented Nov 21, 2022

@ArkadiuszMichalski

DarkModeAdvancedOptions (what we see on the top #12466 (comment)) exist anywhere? All of these settings are kept in DarkMode.

after moving to main config not anymore, I just haven't remove it from OP yet, will do now

@ozone10 ozone10 changed the title Dark mode advanced options Dark mode "windows mode" and defaults options Nov 21, 2022
@ozone10
Copy link
Contributor Author

ozone10 commented Nov 21, 2022

@donho
consider
#12466 (comment)

and mainly, theme is still not forced on start
#12466 (comment)

Maybe it would be better to load theme in Parameter.cpp but I am not sure how to do it, and can not test/try it now

@donho
Copy link
Member

donho commented Nov 21, 2022

@ozone10
All done now. It works like a charm! Please let me know it's OK for you now, then it will go to in master.

@ozone10
Copy link
Contributor Author

ozone10 commented Nov 21, 2022

@donho

All done now. It works like a charm! Please let me know it's OK for you now, then it will go to in master.

I will check code later when I get time and might do small adjustments in another PR.
If it works now, then it's okay.
I will also wait for appveyor build to test it.

@donho
Copy link
Member

donho commented Nov 22, 2022

I will check code later when I get time and might do small adjustments in another PR.
If it works now, then it's okay.
I will also wait for appveyor build to test it.

@ozone10
OK, this PR will be merged now. Feel free to create an issue/PR for the fixing bugs or tuning code.
Thank you very much for psychic coding/debugging. It's very impressive, BTW.

@donho donho closed this in e2a1234 Nov 22, 2022
@ArkadiuszMichalski
Copy link
Contributor

ArkadiuszMichalski commented Nov 22, 2022

@ozone10 @donho How we can fast back to default value? We have to set them up ourselves or completely remove the <GUIConfig name="DarkMode"> from config.xml?

@donho
Copy link
Member

donho commented Nov 22, 2022

@ArkadiuszMichalski
Just like going back to other default values, the fastest way is removing the config.xml then Notepad++ will create one with all default values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment