danipen / TextMateSharp

A port of tm4e to bring TextMate grammars to dotnet ecosystem
MIT License
87 stars 15 forks source link

Expose "colors" dictionary #64

Closed Natestah closed 6 days ago

Natestah commented 1 week ago

My ultimate plan with this in Blitz Search is to provide "easy" theme selection. But I do think that AvaloniaEdit.TextMate should use the editor background to fix what I see as a bug in the AvaloniaEdit demonstration, where some themes don't look like they were meant for a dark background.

Having things like selection highlights and all that come from a place that's already authored will ease up a lot of UI work for me ( color pickers and what-not ).

Natestah commented 1 week ago

Just Changing the Background leads to dramatic improvement

2024-06-22_09-18-34

There are some issues with the theme's still but making progress towards useful themes.

danipen commented 1 week ago

Yes I agree.

We should also change the section foreground and some other colors in the demo app to demonstrate how to use colors.

Or even better we could add some API in AvaloniaEdit.TextMate to apply a theme to a given editor.

Natestah commented 1 week ago

Yes I agree.

We should also change the section foreground and some other colors in the demo app to demonstrate how to use colors.

Or even better we could add some API in AvaloniaEdit.TextMate to apply a theme to a given editor.

I'll keep you posted, turns out a lot of good comes out of just setting the "Window's" background property in Avalonia. It works on a mysterious "Accent" where the buttons and things there Get color too (In a magical good way). Can't tell if it's just having opacity or of there's more to it. It would have to be Opt in, which I will do in Blitz, since I really would like theme management to be as simple as possible ( for the user )

There's selection highlight that seems important and maybe a few others that will reveal what they are in wider context ( list box and things )

2024-06-23_06-47-13

Natestah commented 1 week ago

Have to Clean up my change a bit and maybe work through some "how to make the API right", but here's the updated walkthrough of all the themes looking better:

2024-06-23_08-28-11

Natestah commented 1 week ago

The Avalonia Textmate side looks like this (first time using a Gist):

https://gist.github.com/Natestah/aff8e57a8935d3fc1aea525ef756719f

Depends on this getting pushed and a Nuget update, Maybe I can locally apply this to Blitz to Tease out any other issues, but I don't anticipate much with regards to Doing more with this change.

Natestah commented 1 week ago

I had to wrestle some of my own things for a bit, but here's something I'm very excited about with this and was a big part of the draw towards Avalonia and AvaloniaEdit.. In order to create a more - integrated feel with these editors. Here we have VS Code in the backgroud, and Blitz Search in the foreground. Now at very least if people have one of these themes set in VS Code they will align nicely.

2024-06-25_10-49-16

I want to work out again how to style the title bar but here's some cycling through the themes in Blitz Search:

2024-06-25_11-04-04

Of course there are tones of colors and considerations but the path forward is very clear here. Love it! You don't want to know the nightmares of Stuff I went through with SharpDevelop and AvalonEdit to just get Dark theme working.

danipen commented 1 week ago

It's looking good 👍

Natestah commented 1 week ago

here's what the AvaloniaEdit updates are looking like after this makes its way:

https://github.com/AvaloniaUI/AvaloniaEdit/compare/master...Natestah:AvaloniaEdit:master

danipen commented 1 week ago

I'll publish a new nuget so we don't need to reference this project from AvaloniaEdit...

danipen commented 6 days ago

PR published in https://www.nuget.org/packages/TextMateSharp/1.0.58. Thanks for you contribution!

Natestah commented 5 days ago

I went ahead and updated the AvaloniaEdit pull request to change project to new nuget

Natestah commented 5 days ago

Demo https://youtu.be/pLaoanUtTIc?si=2uYOu4fMeOz38rey