all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: tkk@misasa.okayama-u.ac.jp, 33452@debbugs.gnu.org
Subject: bug#33452: Color of tooltip text on macOS with dark mode
Date: Sat, 24 Nov 2018 09:35:25 +0000	[thread overview]
Message-ID: <20181124093525.GA26416@breton.holly.idiocy.org> (raw)
In-Reply-To: <835zwnlcxp.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

On Fri, Nov 23, 2018 at 11:08:18PM +0200, Eli Zaretskii wrote:
> > Date: Fri, 23 Nov 2018 20:38:51 +0000
> > From: Alan Third <alan@idiocy.org>
> > Cc: tkk@misasa.okayama-u.ac.jp, 33452@debbugs.gnu.org
> > 
> > Sorry, I thought you were meaning colours as set by Emacs lisp.
> > 
> > We can set the foreground and background to anything we want in C, but
> > in emacs-26 currently we can’t modify them by Emacs lisp, and only the
> > background colour is being set in C, which leaves the foreground to
> > use whatever the system default is.
> > 
> > The master branch honours the colours set by lisp.
> 
> Thanks.  So what are out alternatives for emacs-26, besides
> backporting from master (which will give control on colors to Lisp)?

We can try to use the system tooltip colours, but I think we’re better
off just setting a foreground colour. Patch attached.
-- 
Alan Third

[-- Attachment #2: 0001-Set-tooltip-text-color-bug-33452.patch --]
[-- Type: text/plain, Size: 1555 bytes --]

From 1caacbf3600302ca3dd7da4371e30857c4b01f51 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Sat, 24 Nov 2018 09:30:17 +0000
Subject: [PATCH] Set tooltip text color (bug#33452)

; Do not merge into master

* src/nsmenu.m: ([EmacsTooltip init]): Set text color to black.
---
 src/nsmenu.m | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/nsmenu.m b/src/nsmenu.m
index 604adcf40b..52a7d52e8e 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -1318,8 +1318,9 @@ @implementation EmacsTooltip
 
 - (instancetype)init
 {
-  NSColor *col = [NSColor colorWithCalibratedRed: 1.0 green: 1.0
+  NSColor *bgcol = [NSColor colorWithCalibratedRed: 1.0 green: 1.0
                                             blue: 0.792 alpha: 0.95];
+  NSColor *fgcol = [NSColor blackColor];
   NSFont *font = [NSFont toolTipsFontOfSize: 0];
   NSFont *sfont = [font screenFont];
   int height = [sfont ascender] - [sfont descender];
@@ -1328,7 +1329,8 @@ - (instancetype)init
 
   textField = [[NSTextField alloc] initWithFrame: r];
   [textField setFont: font];
-  [textField setBackgroundColor: col];
+  [textField setTextColor: fgcol];
+  [textField setBackgroundColor: bgcol];
 
   [textField setEditable: NO];
   [textField setSelectable: NO];
@@ -1345,7 +1347,7 @@ - (instancetype)init
   [win setReleasedWhenClosed: NO];
   [win setDelegate: self];
   [[win contentView] addSubview: textField];
-/*  [win setBackgroundColor: col]; */
+/*  [win setBackgroundColor: bgcol]; */
   [win setOpaque: NO];
 
   return self;
-- 
2.19.1


  reply	other threads:[~2018-11-24  9:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21  7:30 bug#33452: Color of tooltip text on macOS with mark mode Tak Kunihiro
2018-11-21  9:30 ` Eli Zaretskii
2018-11-21 10:14   ` bug#33452: Color of tooltip text on macOS with dark mode Tak Kunihiro
2018-11-21 10:32     ` Eli Zaretskii
2018-11-21 19:44       ` Alan Third
2018-11-22 12:44         ` Tak Kunihiro
2018-11-23 10:29         ` Eli Zaretskii
2018-11-23 18:10           ` Alan Third
2018-11-23 20:13             ` Eli Zaretskii
2018-11-23 20:38               ` Alan Third
2018-11-23 21:08                 ` Eli Zaretskii
2018-11-24  9:35                   ` Alan Third [this message]
2018-11-24  9:44                     ` Eli Zaretskii
2018-11-25 11:36                     ` Alan Third

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=20181124093525.GA26416@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=33452@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=tkk@misasa.okayama-u.ac.jp \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.