From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88744 invoked by alias); 14 Mar 2019 19:55:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 88691 invoked by uid 89); 14 Mar 2019 19:55:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=screenshots, HX-Languages-Length:1726, H*r:sk:server-, theme X-HELO: mx2.freebsd.org Received: from mx2.freebsd.org (HELO mx2.freebsd.org) (8.8.178.116) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Mar 2019 19:55:07 +0000 Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 54D6D4A85; Thu, 14 Mar 2019 19:55:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DC9E8FF5B; Thu, 14 Mar 2019 19:55:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id D5FC214FF7; Thu, 14 Mar 2019 19:55:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: [PATCH] Improve/fix the TUI's current source line highlight To: Pedro Alves , GDB Patches , Tom Tromey , Eli Zaretskii References: <6ada07d6-ff84-e215-19ff-0a17563390c6@redhat.com> From: John Baldwin Openpgp: preference=signencrypt Message-ID: <9c145336-7474-9599-5f00-bc069e36c490@FreeBSD.org> Date: Thu, 14 Mar 2019 19:55:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <6ada07d6-ff84-e215-19ff-0a17563390c6@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5DC9E8FF5B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00299.txt.bz2 On 3/14/19 10:47 AM, Pedro Alves wrote: > [trying again, this time with a tar.gz. sourceware rejected the image/pngs > content type...] > > With styling enabled, I think the way we display the TUI's > highlighted/current line is very ugly and distracting. At least, > I can't seem to get used to it. The problem in my view is that we > reverse foreground/background in colored text as well, leading to > a fuzzy rainbow of colors. > > This patch changes that to something that I find much more sensible -- > only reverse the default foreground/background colors, leave styled > text colors alone. If the foreground color is not the default (because the > text was styled), leave the foreground color as is. If > e.g., the terminal is fg=BLACK, and bg=WHITE, and the style wants to > print text in RED, reverse the background color (print in BLACK), but > still print the text in RED. > > I've attached screenshots of before/after patch, with both > white-on-black (actually, linux-colors / grey-ish-on-black), > and black-on-white themes in my console (konsole). Also attached > screenshots with styling disabled, so that you can see how the > after-patch versions look more like the unstyled output. > > Note: The new ui_file_style::set_fg method isn't called set_foreground > instead, because set_foreground is a macro in /usr/lib/term.h (ncurses). > > WDYT? I prefer your version over the current approach. I think we've decided to forgo the idea, but if we had light and dark "themes" it would perhaps make sense to use the other "theme" colors for the highlight bar. Your version is pretty close to that with the current single "theme". -- John Baldwin