aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-10-04 14:07:06 +0000
committerKim F. Storm2004-10-04 14:07:06 +0000
commit13fcb8896ef7374bd957823f8e526d0ced20f287 (patch)
tree3cb8ad3deb47e20ebde20b26394e9a083a046519 /src
parent25f7220cc925403112342dd62f566a81e6f62f4f (diff)
downloademacs-13fcb8896ef7374bd957823f8e526d0ced20f287.tar.gz
emacs-13fcb8896ef7374bd957823f8e526d0ced20f287.zip
(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')
-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)
5046 /* Compute the left edge of the scroll bar. */ 5046 /* Compute the left edge of the scroll bar. */
5047#ifdef USE_TOOLKIT_SCROLL_BARS 5047#ifdef USE_TOOLKIT_SCROLL_BARS
5048 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)) 5048 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
5049 sb_left = left + width - sb_width - (width - sb_width) / 2; 5049 sb_left = (left +
5050 (WINDOW_RIGHTMOST_P (w)
5051 ? width - sb_width - (width - sb_width) / 2
5052 : 0));
5050 else 5053 else
5051 sb_left = left + (width - sb_width) / 2; 5054 sb_left = (left +
5055 (WINDOW_LEFTMOST_P (w)
5056 ? (width - sb_width) / 2
5057 : width - sb_width));
5052#else 5058#else
5053 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)) 5059 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
5054 sb_left = left + width - sb_width; 5060 sb_left = left + width - sb_width;
@@ -5101,19 +5107,20 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5101 width); 5107 width);
5102#else /* not USE_GTK */ 5108#else /* not USE_GTK */
5103 5109
5104 /* Since toolkit scroll bars are smaller than the space reserved
5105 for them on the frame, we have to clear "under" them. */
5106 if (width > 0 && height > 0)
5107 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5108 left, top, width, height, False);
5109 /* Move/size the scroll bar widget. */ 5110 /* Move/size the scroll bar widget. */
5110 if (mask) 5111 if (mask)
5112 {
5113 /* Since toolkit scroll bars are smaller than the space reserved
5114 for them on the frame, we have to clear "under" them. */
5115 if (width > 0 && height > 0)
5116 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
5117 left, top, width, height, False);
5111 XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar), 5118 XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar),
5112 sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, 5119 sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
5113 top, 5120 top,
5114 sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, 5121 sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
5115 max (height, 1), 0); 5122 max (height, 1), 0);
5116 5123 }
5117#endif /* not USE_GTK */ 5124#endif /* not USE_GTK */
5118#else /* not USE_TOOLKIT_SCROLL_BARS */ 5125#else /* not USE_TOOLKIT_SCROLL_BARS */
5119 5126