Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: John Baldwin <jhb@FreeBSD.org>,
	GDB Patches <gdb-patches@sourceware.org>,
	Tom Tromey <tom@tromey.com>, Eli Zaretskii <eliz@gnu.org>
Subject: Re: [PATCH] Improve/fix the TUI's current source line highlight
Date: Thu, 14 Mar 2019 20:10:00 -0000	[thread overview]
Message-ID: <6f85cf65-7eac-225a-6b25-1188b65fad70@redhat.com> (raw)
In-Reply-To: <9c145336-7474-9599-5f00-bc069e36c490@FreeBSD.org>


-- 
Thanks,
Pedro Alves
On 03/14/2019 07:55 PM, John Baldwin wrote:
> 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".

One advantage of this approach over a highlight bar of some determined
color, is that this saves one color.  I.e., it reduces need to worry
about the highlight bar color being the same as the color of something
else, in which case I think that something else would become invisible
when highlighted.  The foreground/background colors are pretty much
guaranteed to be quite apart contrast-wise, so I think it should work
fine whatever the theme.  At least it looks fine to me in all the themes
konsole comes with (konsole's theme dialog changes the theme on the
spot, and you can see the effect immediately, no need to restart gdb).

Thanks,
Pedro Alves


  reply	other threads:[~2019-03-14 20:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 17:47 Pedro Alves
2019-03-14 19:55 ` John Baldwin
2019-03-14 20:10   ` Pedro Alves [this message]
2019-03-15 16:39 ` Hannes Domani via gdb-patches
2019-03-15 16:45   ` Pedro Alves
2019-03-17 16:07   ` Eli Zaretskii
2019-03-17 16:46     ` Hannes Domani via gdb-patches
2019-03-17 16:53       ` Eli Zaretskii
2019-03-18 14:45       ` Pedro Alves
2019-03-15 21:41 ` Tom Tromey
     [not found] <24ebd86d-ac47-bc8d-042a-e29ae2b4301e@redhat.com>
2019-03-14 19:49 ` Eli Zaretskii
2019-03-14 20:14   ` Pedro Alves
2019-03-17 15:57 ` Eli Zaretskii
2019-03-18 14:42   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f85cf65-7eac-225a-6b25-1188b65fad70@redhat.com \
    --to=palves@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@FreeBSD.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox