summaryrefslogtreecommitdiff
path: root/src/xfns.c
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2014-01-02 16:58:48 +0100
committerMartin Rudalics <rudalics@gmx.at>2014-01-02 16:58:48 +0100
commit44c5e192bebd669e687423145cb4949567f64314 (patch)
tree87e71c3367932103e9921e385c24d22853d0e623 /src/xfns.c
parentc4377e925acc4d9beabc516501e2eef0400197de (diff)
downloademacs-44c5e192bebd669e687423145cb4949567f64314.tar.gz
Further adjust frame/window scrollbar width calculations.
* window.c (apply_window_adjustment): Set windows_or_buffers_changed. (Fwindow_scroll_bars): Return actual scrollbar width. * xfns.c (x_set_scroll_bar_default_width): Rename wid to unit. For non-toolkit builds again use 14 as minimum width and set FRAME_CONFIG_SCROLL_BAR_WIDTH accordingly. * xterm.c (XTset_vertical_scroll_bar): Take width from WINDOW_SCROLL_BAR_AREA_WIDTH. (x_new_font): Rename wid to unit. Base calculation of new scrollbar width on toolkit used and make it analogous to that of x_set_scroll_bar_default_width. * w32fns.c (x_set_scroll_bar_default_width): Rename wid to unit. (Fx_create_frame): Call x_set_scroll_bar_default_width instead of GetSystemMetrics. * w32term.c (w32_set_vertical_scroll_bar): Take width from WINDOW_SCROLL_BAR_AREA_WIDTH. (x_new_font): Make it correspond to changes in xterm.c.
Diffstat (limited to 'src/xfns.c')
-rw-r--r--src/xfns.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 39c895301dc..a78c2bf6b76 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1488,7 +1488,7 @@ x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
void
x_set_scroll_bar_default_width (struct frame *f)
{
- int wid = FRAME_COLUMN_WIDTH (f);
+ int unit = FRAME_COLUMN_WIDTH (f);
#ifdef USE_TOOLKIT_SCROLL_BARS
#ifdef USE_GTK
int minw = xg_get_default_scrollbar_width ();
@@ -1496,16 +1496,14 @@ x_set_scroll_bar_default_width (struct frame *f)
int minw = 16;
#endif
/* A minimum width of 14 doesn't look good for toolkit scroll bars. */
- FRAME_CONFIG_SCROLL_BAR_COLS (f) = (minw + wid - 1) / wid;
+ FRAME_CONFIG_SCROLL_BAR_COLS (f) = (minw + unit - 1) / unit;
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = minw;
#else
- /* Make the actual width 16 pixels and a multiple of a
- character width. */
- FRAME_CONFIG_SCROLL_BAR_COLS (f) = (16 + wid - 1) / wid;
-
- /* Use all of that space (aside from required margins) for the
- scroll bar. */
- FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 16;
+ /* The width of a non-toolkit scrollbar is at least 14 pixels and a
+ multiple of the frame's character width. */
+ FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + unit - 1) / unit;
+ FRAME_CONFIG_SCROLL_BAR_WIDTH (f)
+ = FRAME_CONFIG_SCROLL_BAR_COLS (f) * unit;
#endif
}