unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [patch] use proper color when drawing border of non-toolkit scroll bars
@ 2007-01-29 22:37 Andreas Seltenreich
  2007-01-29 22:45 ` Leo
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andreas Seltenreich @ 2007-01-29 22:37 UTC (permalink / raw)
  To: emacs-devel; +Cc: david.hansen

Hi,

the border of non-toolkit scroll bars seems to ignore attempts to
customize it via the scroll-bar-foreground frame parameter or the
scroll-bar face.  Attached is a trivial patch to fix it, although I'm
not really sure if it qualifies as a bug.

regards,
andreas

Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.5527
diff -c -0 -r1.5527 ChangeLog
*** ChangeLog	29 Jan 2007 17:06:15 -0000	1.5527
--- ChangeLog	29 Jan 2007 22:18:56 -0000
***************
*** 0 ****
--- 1,6 ----
+ 2007-01-29  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>
+ 
+ 	* xterm.c [!USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_expose): Use
+ 	the foreground color of the scroll-bar face when drawing the
+ 	scroll-bar's border.
+ 
Index: xterm.c
===================================================================
RCS file: /sources/emacs/emacs/src/xterm.c,v
retrieving revision 1.938
diff -c -r1.938 xterm.c
*** xterm.c	21 Jan 2007 04:18:14 -0000	1.938
--- xterm.c	29 Jan 2007 22:19:08 -0000
***************
*** 5279,5284 ****
--- 5279,5289 ----
  
    x_scroll_bar_set_handle (bar, XINT (bar->start), XINT (bar->end), 1);
  
+   /* Switch to scroll bar foreground color. */
+   if (f->output_data.x->scroll_bar_foreground_pixel != -1)
+     XSetForeground (FRAME_X_DISPLAY (f), gc,
+ 		    f->output_data.x->scroll_bar_foreground_pixel);
+ 
    /* Draw a one-pixel border just inside the edges of the scroll bar.  */
    XDrawRectangle (FRAME_X_DISPLAY (f), w, gc,
  
***************
*** 5287,5292 ****
--- 5292,5302 ----
  		  XINT (bar->width) - 1 - width_trim - width_trim,
  		  XINT (bar->height) - 1);
  
+   /* Restore the foreground color of the GC if we changed it above.  */
+   if (f->output_data.x->scroll_bar_foreground_pixel != -1)
+     XSetForeground (FRAME_X_DISPLAY (f), gc,
+ 		    f->output_data.x->foreground_pixel);
+ 
    UNBLOCK_INPUT;
  
  }

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-02 10:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-29 22:37 [patch] use proper color when drawing border of non-toolkit scroll bars Andreas Seltenreich
2007-01-29 22:45 ` Leo
2007-01-30 16:40   ` Andreas Seltenreich
2007-02-01 13:26 ` David Hansen
2007-02-02 10:33 ` Jan Djärv

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).