From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#33452: Color of tooltip text on macOS with dark mode Date: Sat, 24 Nov 2018 09:35:25 +0000 Message-ID: <20181124093525.GA26416@breton.holly.idiocy.org> References: <20181121.163056.945274585923720498.tkk@misasa.okayama-u.ac.jp> <8336ruixqg.fsf@gnu.org> <20181121.191435.1741777328559031241.tkk@misasa.okayama-u.ac.jp> <831s7eiuvp.fsf@gnu.org> <20181121194458.GA3180@breton.holly.idiocy.org> <83va4of5ni.fsf@gnu.org> <20181123181049.GA24527@breton.holly.idiocy.org> <83o9afft6z.fsf@gnu.org> <20181123203851.GA25177@breton.holly.idiocy.org> <835zwnlcxp.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Qxx1br4bt0+wmkIi" Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1543052365 20532 195.159.176.226 (24 Nov 2018 09:39:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 24 Nov 2018 09:39:25 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: tkk@misasa.okayama-u.ac.jp, 33452@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 24 10:39:20 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gQUPI-0005Cw-9r for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Nov 2018 10:39:20 +0100 Original-Received: from localhost ([::1]:55879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQURO-0003mP-5o for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Nov 2018 04:41:30 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQUR9-0003ZN-Vn for bug-gnu-emacs@gnu.org; Sat, 24 Nov 2018 04:41:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQUM7-0006Lb-VK for bug-gnu-emacs@gnu.org; Sat, 24 Nov 2018 04:36:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gQUM6-0006Kv-Vp for bug-gnu-emacs@gnu.org; Sat, 24 Nov 2018 04:36:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gQUM6-0001In-II for bug-gnu-emacs@gnu.org; Sat, 24 Nov 2018 04:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Nov 2018 09:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33452 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33452-submit@debbugs.gnu.org id=B33452.15430521364970 (code B ref 33452); Sat, 24 Nov 2018 09:36:02 +0000 Original-Received: (at 33452) by debbugs.gnu.org; 24 Nov 2018 09:35:36 +0000 Original-Received: from localhost ([127.0.0.1]:44812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gQULg-0001I6-8i for submit@debbugs.gnu.org; Sat, 24 Nov 2018 04:35:36 -0500 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:34307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gQULf-0001Ht-9Q for 33452@debbugs.gnu.org; Sat, 24 Nov 2018 04:35:35 -0500 Original-Received: by mail-wm1-f44.google.com with SMTP id y185so9013424wmd.1 for <33452@debbugs.gnu.org>; Sat, 24 Nov 2018 01:35:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=uql+fUovRIP58DRl75ciWolB193GYbD03yHYz8ktJG4=; b=JDWEXKaYKqf47xSxDLi1FAc2eFJS3fPyRKsloZJN7U531wIBsVWKFDnDjqXO2VsI3M UIbsPHp/vsWXx+yd9+M1mI/D8i0v2DivlM/b9JD6AyCj3NDXBpG0oZZa4FxJ9RtS2zna JbPKCo+4A/fC/jnCKuAjovNRDz9MpjBwBUZxZKVlFHibtil2qLCYHJUo8FHeHtLbGF5m YxBiom8wvY8WpkempHoxtga+aivR9Zd6nZqas8qwNUeuKrp9rHyEDeUj+pnPvyKfGywF WqvfOlOnKUviXSD+zgdk99yYrB0p0OFmB0SwnewsV6NzhLDMHxccV0biylXXkJwu65aK XY/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=uql+fUovRIP58DRl75ciWolB193GYbD03yHYz8ktJG4=; b=QgSm+ToqrggDhVQ0zFCte+0p3ojVLuoMaoOxJsEMzVFJaZftKfCmoWwXpfXkoEFfj8 O+QdLC7PtbwpoXRUtqbHxbAclBg7WSJHta5OK2pItjA/kHdlUKqSfpfE3eXwGIp6YOPp rKYuPtWDaNGxzEX/oSRfzMG2oOrYujTq6cgVxqjRAgOEgUbhM6fzN/5YMer58dS9fzdD oSonQ2gdCJsCmbQ5EQfGtwaT53RiktR5S4CG8Ya6Gh/O+Q9NyugiTah1qjNSukKGKHBq hxQgv2tV5jXMjTfjWP1w68BStbT4GqLNmi3VA/xe8xon4WFvDBmSHcRhfRoP1PFAFdW/ li6w== X-Gm-Message-State: AGRZ1gI2Q1zZVSqmJYEnP6Uqy6SdMaL3Dge0yIJdkwHRDpAkW++oMXAX 3LdIBJzlFJso3RarlKqd2aI= X-Google-Smtp-Source: AJdET5ePlEUDhOQxN+mC3RSzmToOdjh/DON4PtxAWLi02TSJEPeURQpxiXhA1M9IhsbMRZVoeGI+OQ== X-Received: by 2002:a7b:cc86:: with SMTP id p6mr16327153wma.19.1543052129201; Sat, 24 Nov 2018 01:35:29 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-dce1-f8e2-3065-9b77.holly.idiocy.org. [2001:8b0:3f8:8129:dce1:f8e2:3065:9b77]) by smtp.gmail.com with ESMTPSA id q2sm35808193wru.56.2018.11.24.01.35.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Nov 2018 01:35:27 -0800 (PST) Content-Disposition: inline In-Reply-To: <835zwnlcxp.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152731 Archived-At: --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 > > 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 --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-Set-tooltip-text-color-bug-33452.patch" >From 1caacbf3600302ca3dd7da4371e30857c4b01f51 Mon Sep 17 00:00:00 2001 From: Alan Third 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 --Qxx1br4bt0+wmkIi--