orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
640 stars 38 forks source link

Colour of the caret on command entry #365

Closed GreedyTactician closed 1 year ago

GreedyTactician commented 1 year ago

It seems everything else about the command entry mini buffer can change colour from the theme, but I can't seem to find anything that changes the colour of the caret. It is hard to see the black caret on a dark theme.

In addition, is there anyway of changing the search and replace UI or is that just provided by GTK?

orbitalquark commented 1 year ago

Have you tried setting ui.command_entry.element_color[view.ELEMENT_CARET] = 0xBBGGRR in your ~/.textadept/init.lua?

The Find & Replace pane layout is hardcoded in C. You should be able to style it using GTK stylesheets if you want to change the colors and such, but I'm not familiar with the particulars.

GreedyTactician commented 1 year ago

Yeah that works. Thank you.

Although, I can't see how I would have found that out without this issue.

Perhaps add '--ui.command_entry.element_color[view.ELEMENT_CARET] = colors.white' as a comment in all the themes in the 'Element colors' section?

snoopy commented 1 year ago

In addition, is there anyway of changing the search and replace UI or is that just provided by GTK?

That is indeed provided by GTK. It can be changed but it's not very straightforward. Ironically it's easier on Windows where you simply drop the replacement into your share folder inside the TA install folder. On Linux the custom theme affects all GTK apps. You can start TA with GTK_THEME=/path/to/your/theme to circumvent this but it's not a great solution and might not always work. Either way you will have to edit the massive GTK css file and also change the provided images files because the checkboxes are loaded as images.

I think TA packages the necessary files you would need to edit. Here is an archive of the custom files I used before switching to the Qt version: https://github.com/snoopy/.textadept/blob/5774dbefd82f6d08e49043cddd5b347d621d98c0/external/share.zip

orbitalquark commented 1 year ago

Yeah that works. Thank you.

Although, I can't see how I would have found that out without this issue.

Perhaps add '--ui.command_entry.element_color[view.ELEMENT_CARET] = colors.white' as a comment in all the themes in the 'Element colors' section?

You are right that this is not very discoverable. I've added API documentation that the command entry is just another buffer/view (https://github.com/orbitalquark/textadept/commit/578af90892c1f266f8756bdae71aedc7cf4d1b61), and a recent change to themes indicates that you can have command entry-specific view styles (https://github.com/orbitalquark/textadept/commit/2fd8e565fe42e50920113c96964939578671363d#diff-18398e00106119d7a20e082aada8d1b6925bd990886e04eff7d7dfc6871e2cf3). Hopefully this clarifies things a bit more.