Add Solarized Light and Dark themes
ClosedPublic

Authored by acrouthamel on Sep 7 2018, 8:54 PM.

Details

Summary

This adds Solarized Light and Dark themes, with the same color scheme selected in Phabricator diff D15337. This includes the themes here in KSyntaxHighlighting for when KTextEditor themes are replaced.

Diff Detail

Repository
R216 Syntax Highlighting
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
acrouthamel created this revision.Sep 7 2018, 8:54 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptSep 7 2018, 8:54 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
acrouthamel requested review of this revision.Sep 7 2018, 8:54 PM
dhaumann accepted this revision.Sep 8 2018, 6:46 AM
dhaumann added a subscriber: dhaumann.

Looks good to me.

Related: in order to have better unit testing, would you be willing to add a unit test to https://github.com/KDE/syntax-highlighting/blob/master/autotests/theme_test.cpp called

void testJsonData() { ... }

This test would iterate over all themes via Qt Resources and check wether all 31 default text styles exist, and also check for the existence of the editor colors. This would help us to catch theme issues early in the future.

Feel free to commit this patch now.

This revision is now accepted and ready to land.Sep 8 2018, 6:46 AM
This revision was automatically updated to reflect the committed changes.

Looks good to me.

Related: in order to have better unit testing, would you be willing to add a unit test to https://github.com/KDE/syntax-highlighting/blob/master/autotests/theme_test.cpp called

void testJsonData() { ... }

This test would iterate over all themes via Qt Resources and check wether all 31 default text styles exist, and also check for the existence of the editor colors. This would help us to catch theme issues early in the future.

Feel free to commit this patch now.

Thanks! I would be glad to add that, but I honestly have no idea how to do so. I'm just starting out.

Btw, we forgot to add the themes to the Qt resource file, see also D15358

You can test the theme with the demo app in ksyntaxhighlighting: Go to the build-directory, then type ./bin/codeeditor <path-to-some-file-to-highlight>
Then, you can switch the theme with the context menu.

Thanks, I'll make sure to add to that file if I add more themes.

Btw, we forgot to add the themes to the Qt resource file, see also D15358

You can test the theme with the demo app in ksyntaxhighlighting: Go to the build-directory, then type ./bin/codeeditor <path-to-some-file-to-highlight>
Then, you can switch the theme with the context menu.

Could you give me a quick tutorial on how to build that? I tried cmake && make, but that's about as far as I got.

Sure, please use kdesrc-build as described here:
https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source

Once setup, you can build everything by invoking ./kdesrc-build
You can also pass a module to build:

./kdesrc-build syntax-highlighting

Ideally, you should build with dependencies:

./kdesrc-build --include-dependencies syntax-highlighting

If you need help, feel free to ask.

Sure, please use kdesrc-build as described here:
https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source

Once setup, you can build everything by invoking ./kdesrc-build
You can also pass a module to build:

./kdesrc-build syntax-highlighting

Ideally, you should build with dependencies:

./kdesrc-build --include-dependencies syntax-highlighting

If you need help, feel free to ask.

Thanks for the help! So I have kdesrc-build setup, I pulled and built syntax-highlighting. The only bin file is kate-syntax-highlighter. So I checked the help on that and tried running:

kate-syntax-highlighter ~/Development/kdesrc-build/kdesrc-build-test.pl -t 'Solarized Dark'

Unfortunately I do not get any colorized output in Konsole. Any tips? Is this the new "code-editor" or am I still missing something?

I just realized the output was HTML. Ok, I can see what is going on now. If you could let me know if I am missing the "code-editor" though, that would be great!