summaryrefslogtreecommitdiff
path: root/src/xterm.c
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2004-10-04 14:07:06 +0000
committerKim F. Storm <storm@cua.dk>2004-10-04 14:07:06 +0000
commit13fcb8896ef7374bd957823f8e526d0ced20f287 (patch)
tree3cb8ad3deb47e20ebde20b26394e9a083a046519 /src/xterm.c
parent25f7220cc925403112342dd62f566a81e6f62f4f (diff)
downloademacs-13fcb8896ef7374bd957823f8e526d0ced20f287.tar.gz
(XTset_vertical_scroll_bar): Improve handling of scroll
bars with fractional column width. If scroll bar separates two windows, move it towards the window it belongs to. Only update the padding area below the scroll bar widget when necessary, i.e. when scroll bar widget is created, moved, or resized.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c
index acbb30ef21b..97e21d1f255 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5046,9 +5046,15 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
/* Compute the left edge of the scroll bar. */
#ifdef USE_TOOLKIT_SCROLL_BARS
if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
- sb_left = left + width - sb_width - (width - sb_width) / 2;
+ sb_left = (left +
+ (WINDOW_RIGHTMOST_P (w)
+ ? width - sb_width - (width - sb_width) / 2
+ : 0));
else
- sb_left = left + (width - sb_width) / 2;
+ sb_left = (left +
+ (WINDOW_LEFTMOST_P (w)
+ ? (width - sb_width) / 2
+ : width - sb_width));
#else
if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
sb_left = left + width - sb_width;
@@ -5101,19 +5107,20 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
width);
#else /* not USE_GTK */
- /* Since toolkit scroll bars are smaller than the space reserved
- for them on the frame, we have to clear "under" them. */
- if (width > 0 && height > 0)
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- left, top, width, height, False);
/* Move/size the scroll bar widget. */
if (mask)
+ {
+ /* Since toolkit scroll bars are smaller than the space reserved
+ for them on the frame, we have to clear "under" them. */
+ if (width > 0 && height > 0)
+ x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ left, top, width, height, False);
XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar),
sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
top,
sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
max (height, 1), 0);
-
+ }
#endif /* not USE_GTK */
#else /* not USE_TOOLKIT_SCROLL_BARS */