diff options
| author | Martin Rudalics | 2014-01-02 16:58:48 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-01-02 16:58:48 +0100 |
| commit | 44c5e192bebd669e687423145cb4949567f64314 (patch) | |
| tree | 87e71c3367932103e9921e385c24d22853d0e623 /src/xterm.c | |
| parent | c4377e925acc4d9beabc516501e2eef0400197de (diff) | |
| download | emacs-44c5e192bebd669e687423145cb4949567f64314.tar.gz emacs-44c5e192bebd669e687423145cb4949567f64314.zip | |
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/xterm.c')
| -rw-r--r-- | src/xterm.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/xterm.c b/src/xterm.c index bffd85c8de4..f47d73cf7ed 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -5096,7 +5096,7 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio | |||
| 5096 | 5096 | ||
| 5097 | /* Compute the left edge and the width of the scroll bar area. */ | 5097 | /* Compute the left edge and the width of the scroll bar area. */ |
| 5098 | left = WINDOW_SCROLL_BAR_AREA_X (w); | 5098 | left = WINDOW_SCROLL_BAR_AREA_X (w); |
| 5099 | width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); | 5099 | width = WINDOW_SCROLL_BAR_AREA_WIDTH (w); |
| 5100 | 5100 | ||
| 5101 | /* Does the scroll bar exist yet? */ | 5101 | /* Does the scroll bar exist yet? */ |
| 5102 | if (NILP (w->vertical_scroll_bar)) | 5102 | if (NILP (w->vertical_scroll_bar)) |
| @@ -7675,6 +7675,7 @@ Lisp_Object | |||
| 7675 | x_new_font (struct frame *f, Lisp_Object font_object, int fontset) | 7675 | x_new_font (struct frame *f, Lisp_Object font_object, int fontset) |
| 7676 | { | 7676 | { |
| 7677 | struct font *font = XFONT_OBJECT (font_object); | 7677 | struct font *font = XFONT_OBJECT (font_object); |
| 7678 | int unit; | ||
| 7678 | 7679 | ||
| 7679 | if (fontset < 0) | 7680 | if (fontset < 0) |
| 7680 | fontset = fontset_from_font (font_object); | 7681 | fontset = fontset_from_font (font_object); |
| @@ -7694,21 +7695,20 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset) | |||
| 7694 | 7695 | ||
| 7695 | compute_fringe_widths (f, 1); | 7696 | compute_fringe_widths (f, 1); |
| 7696 | 7697 | ||
| 7697 | /* Compute the scroll bar width in character columns. */ | 7698 | unit = FRAME_COLUMN_WIDTH (f); |
| 7698 | if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0) | 7699 | #ifdef USE_TOOLKIT_SCROLL_BARS |
| 7699 | { | 7700 | /* The width of a toolkit scrollbar does not change with the new |
| 7700 | int wid = FRAME_COLUMN_WIDTH (f); | 7701 | font but we have to calculate the number of columns it occupies |
| 7701 | 7702 | anew. */ | |
| 7702 | FRAME_CONFIG_SCROLL_BAR_COLS (f) | 7703 | FRAME_CONFIG_SCROLL_BAR_COLS (f) |
| 7703 | = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid; | 7704 | = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + unit - 1) / unit; |
| 7704 | } | 7705 | #else |
| 7705 | else | 7706 | /* The width of a non-toolkit scrollbar is at least 14 pixels and a |
| 7706 | { | 7707 | multiple of the frame's character width. */ |
| 7707 | int wid = FRAME_COLUMN_WIDTH (f); | 7708 | FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + unit - 1) / unit; |
| 7708 | 7709 | FRAME_CONFIG_SCROLL_BAR_WIDTH (f) | |
| 7709 | FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 14; | 7710 | = FRAME_CONFIG_SCROLL_BAR_COLS (f) * unit; |
| 7710 | FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid; | 7711 | #endif |
| 7711 | } | ||
| 7712 | 7712 | ||
| 7713 | if (FRAME_X_WINDOW (f) != 0) | 7713 | if (FRAME_X_WINDOW (f) != 0) |
| 7714 | { | 7714 | { |