From: Timo Savola <timo.savola@iki.fi>
Subject: GTK scrollbar position
Date: Tue, 11 Apr 2006 20:00:44 +0300 [thread overview]
Message-ID: <1144774844.4302.20.camel@localhost.localdomain> (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
reply other threads:[~2006-04-11 17:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1144774844.4302.20.camel@localhost.localdomain \
--to=timo.savola@iki.fi \
/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).