git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-gui: Fix selected text colors

From
serg.partizan@gmail.com <serg.partizan@gmail.com>
Date
Nov 22, 2020, 17:16 UTC
Message-ID
<DZJ7KQ.UXACXR9SWDQI3@gmail.com>
In-Reply-To
<2436cd2e-26b9-a7cc-722a-7f27212f58f4@haller-berlin.de>

On Sun, Nov 22, 2020 at 16:41, Stefan Haller <stefan@haller-berlin.de> wrote:

Show 20 quoted lines
> Preserving the previous behavior is probably a good idea when fixing a
> regression.
> 
> However, it would actually be nice to have different colors for active
> and inactive selection (could be a follow-up patch). In native Mac and
> Windows applications the active selection background is usually light
> blue, and the inactive one is light grey. This would not just be a
> cosmetic improvement that looks prettier (that wouldn't be worth it),
> but it would be a real usability improvement because it would make it
> much easier to tell which of the four main views has the keyboard 
> focus.
> 
> I couldn't find a way to query the inactive selection colors, though. 
> Do
> you know if there's a way to do that? If not, I guess one way to do 
> this
> is to numerically calculate a grey color with a similar brightness 
> from
> the active selection background. I could work on a patch if you think
> this is an approach that makes sense.
I'm using this code in `wish` to query widget for available options:
 > text .t
 > .t configure

And it shows this widget has `-inactiveselectbackground` option. However, it doesn't have `-inactiveselectforeground` as I was thinking in previous patch.

 > .t configure -inactiveselectbackground
-inactiveselectbackground inactiveSelectBackground Foreground #c3c3c3 
#c3c3c3

But I have no idea how to get this colors from ttk::style. Looking at awdark theme, it set's inactiveselectbackground in function setTextColors, which is used on text widget directly. And we cannot use it here.

I think calculating that gray color from current selection bg is too much work for just one color.

We can just set inactiveSelectBackground to some neutral gray color like #707070 or #909090 which will work fine with both dark and light themes.

And, because we're using "widgetDefault" priority - themes can override this, when they want to explicitly set this color.

Previous: Stefan HallerNext: Stefan Haller
Message 12 of 37 in “git-gui: Basic dark mode support”
  1. git-gui: Basic dark mode supportSerg Tereshchenko, Aug 24, 2020
  2. Matthias AßhauerAug 25, 2020
  3. Pratyush YadavSep 22, 2020
  4. git-gui: Basic dark mode supportSerg Tereshchenko, Sep 26, 2020
  5. Pratyush YadavOct 7, 2020
  6. Serg TereshchenkoOct 8, 2020
  7. Pratyush YadavOct 8, 2020
  8. Stefan HallerNov 21, 2020
  9. serg.partizan@gmail.comNov 22, 2020
  10. git-gui: Fix selected text colorsSerg Tereshchenko, Nov 22, 2020
  11. Stefan HallerNov 22, 2020
  12. serg.partizan@gmail.comNov 22, 2020
  13. git-gui: use gray selection background for inactive text widgetsStefan Haller, Nov 23, 2020
  14. serg.partizan@gmail.comNov 23, 2020
  15. Stefan HallerNov 23, 2020
  16. serg.partizan@gmail.comNov 23, 2020
  17. Stefan HallerNov 29, 2020
  18. serg.partizan@gmail.comNov 30, 2020
  19. Pratyush YadavNov 30, 2020
  20. Stefan HallerNov 30, 2020
  21. git-gui: keep showing selection when diff view gets deactivated on MacStefan Haller, Nov 30, 2020
  22. Stefan HallerNov 23, 2020
  23. serg.partizan@gmail.comNov 23, 2020
  24. Stefan HallerNov 24, 2020
  25. git-gui: use gray background for inactive text widgetsStefan Haller, Nov 24, 2020
  26. Pratyush YadavDec 17, 2020
  27. Stefan HallerDec 17, 2020
  28. Pratyush YadavDec 18, 2020
  29. Stefan HallerDec 18, 2020
  30. git-gui: use gray background for inactive text widgetsStefan Haller, Dec 18, 2020
  31. Pratyush YadavDec 18, 2020
  32. Pratyush YadavDec 18, 2020
  33. Pratyush YadavDec 17, 2020
  34. Pratyush YadavOct 7, 2020
  35. Serg TereshchenkoOct 8, 2020
  36. Pratyush YadavOct 8, 2020
  37. Serg TereshchenkoOct 8, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.