skylot / jadx

Dex to Java decompiler
Apache License 2.0
41.04k stars 4.81k forks source link

[feature] Sync editor and application themes #1763

Open SnowVolf opened 1 year ago

SnowVolf commented 1 year ago

Describe your idea: Since the jadx-gui uses FlatIJLookAndFeelInfo as the application themes, it is possible to synchronize the app themes and the code editor themes.

FlatIJLookAndFeelInfo(Name, ThemeClass, isDark)

How I see it

You just need to add 2 new constants currentDarkTheme responsible for storing the values of the current dark theme of the editor and currentLightTheme, respectively

if (flatIJLookAndFeelInfo.isDark()){
    editorTheme = currentDarkTheme;
} else {
    editorTheme = currentLightTheme;
}

And update the UI accordingly

I would like to add this myself, but I am an Android developer, and have no experience with Swing and desktop applications at all I would be glad if it would be added

skylot commented 1 year ago

@SnowVolf sorry but I don't actually get your idea. Because there are several dark and several light editor themes available, so we can't define such constants and should add these to preferences, but for me, it is weird to force user to select two themes instead only one. Also, it is not hard to change editor theme if you change UI theme. Your idea may be reasonable if jadx provide some kind of auto-detection of system theme and switch dark/light theme depends on that (can be done using https://github.com/Dansoftowner/jSystemThemeDetector). Anyway, maybe you can describe your use case, i.e. why you need such feature.

SnowVolf commented 1 year ago

@skylot Yes. In the end, everything should come to the automatic definition of the system theme (as in intellij IDEA). I use the AutoDarkMode for Windows to switch themes depending time on the day. Another question is that this will require duplicating syntax highlighting on a light and dark theme. I'll try to see about it on the weekend