From patchwork Thu Apr 9 17:48:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Sixt X-Patchwork-Id: 11482105 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2DDA814DD for ; Thu, 9 Apr 2020 17:48:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 176F5206F5 for ; Thu, 9 Apr 2020 17:48:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726595AbgDIRsP (ORCPT ); Thu, 9 Apr 2020 13:48:15 -0400 Received: from bsmtp2.bon.at ([213.33.87.16]:10713 "EHLO bsmtp2.bon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726523AbgDIRsP (ORCPT ); Thu, 9 Apr 2020 13:48:15 -0400 Received: from dx.site (unknown [93.83.142.38]) by bsmtp2.bon.at (Postfix) with ESMTPSA id 48ypXF4f9Qz5tlH; Thu, 9 Apr 2020 19:48:13 +0200 (CEST) Received: from [IPv6:::1] (localhost [IPv6:::1]) by dx.site (Postfix) with ESMTP id C50EB418D; Thu, 9 Apr 2020 19:48:12 +0200 (CEST) Subject: [PATCH v2] gitk: Un-hide selection in areas with non-default background color From: Johannes Sixt To: Paul Mackerras Cc: Stefan Dotterweich , git@vger.kernel.org References: <20200211212448.9288-1-stefandotterweich@gmx.de> <8b5b8d89-59c2-7349-25c1-2529db13fa6e@kdbg.org> <2ecfbb59-3a65-9db0-4ff7-e649ab6dfb6e@kdbg.org> Message-ID: Date: Thu, 9 Apr 2020 19:48:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <2ecfbb59-3a65-9db0-4ff7-e649ab6dfb6e@kdbg.org> Content-Language: en-US Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.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 --- 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 ## 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 @@ 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} {