DistributedProofreaders / guiguts-py

Guiguts rewrite using Python/tkinter
GNU General Public License v2.0
2 stars 7 forks source link

Emphasis of line number highlight #561

Open tangledhelix opened 1 day ago

tangledhelix commented 1 day ago

The line number in GG2 is a weaker signal (IMHO) than in GG1 and I wonder about strengthening it. (Although we've added the cursor-line highlight, which makes the input line in general a bit stronger than before.)

Some examples are attached. I'll note two things.

  1. The coloring is much bolder in GG1, making it easier to see.
  2. In GG1, the highlight is across the entire gutter, even if the number is only 1-2 digits and the gutter is 5 digits wide. GG2 highlights only the number itself and doesn't cover the entire gutter width.

An example of where this matters (at least in my workflow): while starting a new project last night, I was reviewing page by page, and my habit is to place the cursor at the page separator line and then scroll that to the top of the viewport as I switch page to page (while reviewing the PNG in a different window). This is pretty easy in GG1 due to the strong marker and GG2's is a bit harder to see as you quickly scroll something to the top of the viewport.

Even if coloring remains as-is I would personally prefer the full-width marking.

(One nice change in GG2 is the scrolling is much smoother, at least on Mac - the X11 scrolling is not very smooth at all!)

GG1 samples

Screenshot 2024-12-01 at 10 38 43 AM Screenshot 2024-12-01 at 10 38 54 AM

GG2 samples

Screenshot 2024-12-01 at 10 39 12 AM Screenshot 2024-12-01 at 10 39 34 AM
windymilla commented 1 day ago

I'm pretty sure the color is determined by your text selection color - in my case it's a bright (Windows) blue, in yours it probably comes from your macOS color theme. @srjfoo has a kind-of pinkish color in her screenshots. For the width, I think all you'd need to do is find the call to create_rectangle in maintext.py, about line 130, and change

                        bbox[0] - 3,

to

                        3,

Then the box will start 3 pixels in from the left margin, rather than 3 pixels outside the bounding box of the text.

windymilla commented 1 day ago

Do you want to do that, or shall I - I agree it would be a good change to make

tangledhelix commented 1 day ago

I can look at it. I think learning more about the gutter system would be useful for me if I plan to attack #61 which I think I assigned to myself...

srjfoo commented 1 day ago

Yes, the highlight for the line number is controlled by your system highlight color, and is largely why my system highlight color is purple at the moment.

There are (or were at the time I changed my highlight color from the default) other places that use the system highlight color, which just wasn't showing up well enough. If only one character was selected in the middle of the page, it was very hard to see it. Which, incidentally, it still is, if you are using just "Search" instead of "Find All" (which I rarely use anymore).

As far as highlight colors are concerned in general, that was pretty early-days, and I think that we decided to punt making a final decision on exactly how highlight colors were going to work, didn't we? Now that we're nearly ready for beta testing, is it time to consider all highlighting, including that which applies to the line numbers and simple search results (and wherever else the system highlighting color is sitll used)?

I like the idea of the color being for the whole gutter area instead of just the number.

windymilla commented 1 day ago

On Macs, doesn't the system highlight color get used by other apps to show selected text? It does on Windows, for example if I select some text on this webpage in my browser.

srjfoo commented 1 day ago

On Macs, doesn't the system highlight color get used by other apps to show selected text? It does on Windows, for example if I select some text on this webpage in my browser.

I can't tell for sure, because I've got the default multicolor turned on. But note that the colors are different between FF:

image

And Apple's Pages app:

image

Note also that there are two different highlight colors. One for the currently selected word and one for those that are not selected.

Just to make sure that it wasn't because of my system setting I went in and changed that. For search results, it appears that the highlighting is done in FF with accent-level colors (i.e. solid bright colors) and not highlight colors, which, in the macOS System Settings are more transparent. However, if you do a manual selection, a highligh color is used. Pages uses the system highlight color when you manually do a selection, but not for search results. So ... it's a very big can of worms. Is it actually predictable across apps on Windows?

My recommendation would be to make our own decision based on what works for GG2.

(PS: I may have gotten it wrong, honestly. I tried something, drew a conclusion, tried something else and realized that my conclusion was flawed, and tried again. More than once. Bottom line, though, I think my conclusion is correct insofar as, at least on Macs, highlight and accent colors are not necessarily predictable across apps, and that at least some make a distinction between search results and manually selected text.)

windymilla commented 1 day ago

I don't think Windows has the distinction between accent and highlight colors - that may be Apple-specific. For now, it looks as though we are doing the same as FF (which like GG2 is a non-Apple app). That seems reasonable to me, at least for now. As you hinted, Sharon, we may end up succumbing to having a color chooser where all the various colors can be chosen by the user, probably defaulting to something like the colors we currently use. That wouldn't be too hard to do.