unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Seltenreich <seltenreich@gmx.de>
To: emacs-devel@gnu.org
Cc: david.hansen@physik.fu-berlin.de
Subject: [patch] use proper color when drawing border of non-toolkit scroll bars
Date: Mon, 29 Jan 2007 23:37:11 +0100	[thread overview]
Message-ID: <87r6tdv4rs.fsf@gate450.dyndns.org> (raw)

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;
  
  }

             reply	other threads:[~2007-01-29 22:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-29 22:37 Andreas Seltenreich [this message]
2007-01-29 22:45 ` [patch] use proper color when drawing border of non-toolkit scroll bars Leo
2007-01-30 16:40   ` Andreas Seltenreich
2007-02-01 13:26 ` David Hansen
2007-02-02 10:33 ` Jan Djärv

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r6tdv4rs.fsf@gate450.dyndns.org \
    --to=seltenreich@gmx.de \
    --cc=david.hansen@physik.fu-berlin.de \
    --cc=emacs-devel@gnu.org \
    /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 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).