emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] use proper color when drawing border of non-toolkit scroll bars


From: Andreas Seltenreich
Subject: [patch] use proper color when drawing border of non-toolkit scroll bars
Date: Mon, 29 Jan 2007 23:37:11 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (gnu/linux)

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  <address@hidden>
+ 
+       * 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;
  
  }






reply via email to

[Prev in Thread] Current Thread [Next in Thread]