aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
authorMartin Rudalics2014-01-02 16:58:48 +0100
committerMartin Rudalics2014-01-02 16:58:48 +0100
commit44c5e192bebd669e687423145cb4949567f64314 (patch)
tree87e71c3367932103e9921e385c24d22853d0e623 /src/w32term.c
parentc4377e925acc4d9beabc516501e2eef0400197de (diff)
downloademacs-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/w32term.c')
-rw-r--r--src/w32term.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/w32term.c b/src/w32term.c
index c66c5b3e573..91235507b21 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3716,7 +3716,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3716 3716
3717 /* Compute the left edge and the width of the scroll bar area. */ 3717 /* Compute the left edge and the width of the scroll bar area. */
3718 left = WINDOW_SCROLL_BAR_AREA_X (w); 3718 left = WINDOW_SCROLL_BAR_AREA_X (w);
3719 width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); 3719 width = WINDOW_SCROLL_BAR_AREA_WIDTH (w);
3720 3720
3721 /* Does the scroll bar exist yet? */ 3721 /* Does the scroll bar exist yet? */
3722 if (NILP (w->vertical_scroll_bar)) 3722 if (NILP (w->vertical_scroll_bar))
@@ -5361,6 +5361,7 @@ Lisp_Object
5361x_new_font (struct frame *f, Lisp_Object font_object, int fontset) 5361x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
5362{ 5362{
5363 struct font *font = XFONT_OBJECT (font_object); 5363 struct font *font = XFONT_OBJECT (font_object);
5364 int unit;
5364 5365
5365 if (fontset < 0) 5366 if (fontset < 0)
5366 fontset = fontset_from_font (font_object); 5367 fontset = fontset_from_font (font_object);
@@ -5372,22 +5373,21 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
5372 5373
5373 FRAME_FONT (f) = font; 5374 FRAME_FONT (f) = font;
5374 FRAME_BASELINE_OFFSET (f) = font->baseline_offset; 5375 FRAME_BASELINE_OFFSET (f) = font->baseline_offset;
5375 FRAME_COLUMN_WIDTH (f) = font->average_width; 5376 FRAME_COLUMN_WIDTH (f) = unit = font->average_width;
5376 FRAME_LINE_HEIGHT (f) = font->height; 5377 FRAME_LINE_HEIGHT (f) = font->height;
5377 5378
5378 compute_fringe_widths (f, 1); 5379 compute_fringe_widths (f, 1);
5379 5380
5380 /* Compute the scroll bar width in character columns. */ 5381 /* Compute number of scrollbar columns. */
5382 unit = FRAME_COLUMN_WIDTH (f);
5381 if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0) 5383 if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0)
5382 { 5384 FRAME_CONFIG_SCROLL_BAR_COLS (f)
5383 int wid = FRAME_COLUMN_WIDTH (f); 5385 = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + unit - 1) / unit;
5384 FRAME_CONFIG_SCROLL_BAR_COLS (f)
5385 = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid - 1) / wid;
5386 }
5387 else 5386 else
5388 { 5387 {
5389 int wid = FRAME_COLUMN_WIDTH (f); 5388 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + unit - 1) / unit;
5390 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid; 5389 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) =
5390 FRAME_CONFIG_SCROLL_BAR_COLS (f) * unit;
5391 } 5391 }
5392 5392
5393 /* Now make the frame display the given font. */ 5393 /* Now make the frame display the given font. */