diff options
author | Alan Third <alan@idiocy.org> | 2017-12-23 11:00:35 +0000 |
---|---|---|
committer | Alan Third <alan@idiocy.org> | 2018-01-06 22:50:35 +0000 |
commit | 15cd18991c1d9a9bafeef7bf9b4dad91ecc0332a (patch) | |
tree | fca8d2460b73c843ac270c6ce9c0194ec59ca326 /src/nsfns.m | |
parent | 5fd229735384a5fa479466124a181bf7d4ea8dab (diff) | |
download | emacs-15cd18991c1d9a9bafeef7bf9b4dad91ecc0332a.tar.gz emacs-15cd18991c1d9a9bafeef7bf9b4dad91ecc0332a.tar.bz2 emacs-15cd18991c1d9a9bafeef7bf9b4dad91ecc0332a.zip |
Allow setting tooltip colors in NS port
* src/nsfns.m (Fx_show_tip): Get face colors and apply them to the
tooltip.
* src/nsmenu.m (EmacsTooltip::setBackgroundColor):
(EmacsTooltip::setForegroundColor): New functions.
* src/nsterm.h (EmacsTooltip::setBackgroundColor):
(EmacsTooltip::setForegroundColor): New function prototypes.
Diffstat (limited to 'src/nsfns.m')
-rw-r--r-- | src/nsfns.m | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index d5049a7a911..3ede63f9854 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -2873,6 +2873,8 @@ Text larger than the specified size is clipped. */) struct frame *f; char *str; NSSize size; + NSColor *color; + Lisp_Object t; specbind (Qinhibit_redisplay, Qt); @@ -2900,6 +2902,14 @@ Text larger than the specified size is clipped. */) else Fx_hide_tip (); + t = x_get_arg (NULL, parms, Qbackground_color, NULL, NULL, RES_TYPE_STRING); + if (ns_lisp_to_color (t, &color) == 0) + [ns_tooltip setBackgroundColor: color]; + + t = x_get_arg (NULL, parms, Qforeground_color, NULL, NULL, RES_TYPE_STRING); + if (ns_lisp_to_color (t, &color) == 0) + [ns_tooltip setForegroundColor: color]; + [ns_tooltip setText: str]; size = [ns_tooltip frame].size; |