unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* GTK scrollbar position
@ 2006-04-11 17:00 Timo Savola
  0 siblings, 0 replies; only message in thread
From: Timo Savola @ 2006-04-11 17:00 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1008 bytes --]

I've noticed that the GTK version leaves a one-pixel gap between the
scroll bar and X window border.  This happens independent of the scroll
bar location (left/right).  When embedding Emacs into another GTK
application (using my XEmbed patches), it looks disconnected and ugly.

I tracked down the code snippet that is probably responsible for making
the crucial decision:  xterm.c:XTset_vertical_scroll_bar() places the
scroll bar at the center of the area reserved for it and in some
situations leaves empty pixels around it.

I made a patch that aligns the scroll bar to the left or right edge.  I
guess it is a matter of taste which way is best, or are there some
situations where this causes harm?  In my point of view this would be an
improvement even when not embedding Emacs.

Another approach would be to make the scroll bar's event box widget
wider; it would fill the gap by drawing background colour on the
right-hand side, but that would look ugly at least in the
scroll-bar-on-left case.

timo


[-- Attachment #2: gtk-scrollbar-position.patch --]
[-- Type: text/x-patch, Size: 665 bytes --]

Tue Apr 11 18:37:44 EEST 2006  Timo Savola <timo.savola@iki.fi>
  * gtk-scrollbar-position
diff -rN -u old-emacs/src/xterm.c new-emacs/src/xterm.c
--- old-emacs/src/xterm.c	2006-04-11 19:57:30.000000000 +0300
+++ new-emacs/src/xterm.c	2006-04-11 18:35:35.000000000 +0300
@@ -4984,12 +4984,12 @@
   if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
     sb_left = (left +
 	       (WINDOW_RIGHTMOST_P (w)
-		? width - sb_width - (width - sb_width) / 2
+		? width - sb_width
 		: 0));
   else
     sb_left = (left +
 	       (WINDOW_LEFTMOST_P (w)
-		? (width - sb_width) / 2
+		? 0
 		: width - sb_width));
 #else
   if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))


[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-11 17:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-11 17:00 GTK scrollbar position Timo Savola

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).