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

[PATCH v2] gitk: Un-hide selection in areas with non-default background color

From
Johannes Sixt <j6t@kdbg.org>
Date
Apr 9, 2020, 17:48 UTC
Message-ID
<dc614e0d-fe7b-2aed-545b-e4322e35ab12@kdbg.org>
In-Reply-To
<2ecfbb59-3a65-9db0-4ff7-e649ab6dfb6e@kdbg.org>

The recently introduced background for the tags that highlight added and removed text takes precedence over the background color of the selection. But selected text is more important than the highlighted text. Make the highlighting tags the lowest priority.

The same argument holds for the file separator and the highlight of search results. Therefore, make them also low-priority. But search results are a bit more important; therefore, keep them above the other tags.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Here is an update for my earlier patch as I found that the file
separator also overrides the selection. This fixes it.
1:  7c4c862 ! 1:  3a0e64c gitk: Un-hide selection in added and removed text and search results
    @@ Metadata
     Author: Johannes Sixt <j6t@kdbg.org>
     
      ## Commit message ##
    -    gitk: Un-hide selection in added and removed text and search results
    +    gitk: Un-hide selection in areas with non-default background color
     
         The recently introduced background for the tags that highlight
         added and removed text takes precedence over the background color
         of the selection. But selected text is more important than the
         highlighted text. Make the highlighting tags the lowest priority.
     
    -    The same argument holds for the highlight of search results. But
    -    search results are a bit more important. Therefore, make them
    -    also low-priority, but just above the added-and-removed tags.
    +    The same argument holds for the file separator and the highlight
    +    of search results. Therefore, make them also low-priority. But
    +    search results are a bit more important; therefore, keep them
    +    above the other tags.
     
         Signed-off-by: Johannes Sixt <j6t@kdbg.org>
     
    @@ gitk: proc makewindow {} {
     +    # set these to the lowest priority:
     +    $ctext tag lower currentsearchhit
     +    $ctext tag lower found
    ++    $ctext tag lower filesep
     +    $ctext tag lower dresult
     +    $ctext tag lower d0
      
 gitk | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/gitk b/gitk
index 4129c0b..9ac6e5b 100755
--- a/gitk
+++ b/gitk
@@ -2468,6 +2468,12 @@ proc makewindow {} {
     $ctext tag conf currentsearchhit -back $currentsearchhitbgcolor
     $ctext tag conf wwrap -wrap word -lmargin2 1c
     $ctext tag conf bold -font textfontbold
+    # set these to the lowest priority:
+    $ctext tag lower currentsearchhit
+    $ctext tag lower found
+    $ctext tag lower filesep
+    $ctext tag lower dresult
+    $ctext tag lower d0
 
     .pwbottom add .bleft
     if {!$use_ttk} {
-- 
2.26.0.207.gdeb9c6cae9
Previous: Johannes Sixt
Message 4 of 4 in “gitk: add diff lines background colors”
  1. gitk: add diff lines background colorsStefan Dotterweich, Feb 11, 2020
  2. Johannes SixtApr 7, 2020
  3. gitk: Un-hide selection in added and removed text and search resultsJohannes Sixt, Apr 8, 2020
  4. gitk: Un-hide selection in areas with non-default background colorJohannes Sixt, Apr 9, 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.