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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22.11.20 14:32, Serg Tereshchenko wrote:
> Stefan, please check if this fixes select colors for you.

Yes, this works. Thanks for the quick fix! I tested on Mac in both light
and dark mode, and on Windows.

> --- 8< ---
> 
> Added selected state colors for text widget.
> 
> Same colors for active and inactive selection, to match previous
> behaviour.

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.

-Stefan


> Signed-off-by: Serg Tereshchenko <serg.partizan@xxxxxxxxx>
> ---
>  lib/themed.tcl | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/themed.tcl b/lib/themed.tcl
> index 83e3ac7..eda5f8c 100644
> --- a/lib/themed.tcl
> +++ b/lib/themed.tcl
> @@ -34,8 +34,10 @@ namespace eval color {
>  		}
>  		add_option *Text.Background $text_bg
>  		add_option *Text.Foreground $text_fg
> -		add_option *Text.HighlightBackground $base_bg
> -		add_option *Text.HighlightColor $select_bg
> +		add_option *Text.selectBackground $select_bg
> +		add_option *Text.selectForeground $select_fg
> +		add_option *Text.inactiveSelectBackground $select_bg
> +		add_option *Text.inactiveSelectForeground $select_fg
>  	}
>  }
>  
> 



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux