comparison src/xterm.c @ 8941:71762e6d69e0

* xterm.c (x_new_font): Compute number of scrollbar columns.
author Karl Heuer <kwzh@gnu.org>
date Tue, 20 Sep 1994 05:05:02 +0000
parents 48b3ac951c53
children 5882c2fedd98
comparison
equal deleted inserted replaced
8940:18b0314420d5 8941:71762e6d69e0
2605 int height = WINDOW_VERTICAL_SCROLL_BAR_HEIGHT (window); 2605 int height = WINDOW_VERTICAL_SCROLL_BAR_HEIGHT (window);
2606 2606
2607 /* Where should this scroll bar be, pixelwise? */ 2607 /* Where should this scroll bar be, pixelwise? */
2608 int pixel_top = CHAR_TO_PIXEL_ROW (f, top); 2608 int pixel_top = CHAR_TO_PIXEL_ROW (f, top);
2609 int pixel_left = CHAR_TO_PIXEL_COL (f, left); 2609 int pixel_left = CHAR_TO_PIXEL_COL (f, left);
2610 int pixel_width = VERTICAL_SCROLL_BAR_PIXEL_WIDTH (f); 2610 int pixel_width = FRAME_SCROLL_BAR_PIXEL_WIDTH (f);
2611 int pixel_height = VERTICAL_SCROLL_BAR_PIXEL_HEIGHT (f, height); 2611 int pixel_height = VERTICAL_SCROLL_BAR_PIXEL_HEIGHT (f, height);
2612 2612
2613 struct scroll_bar *bar; 2613 struct scroll_bar *bar;
2614 2614
2615 /* Does the scroll bar exist yet? */ 2615 /* Does the scroll bar exist yet? */
4495 } 4495 }
4496 found_font: 4496 found_font:
4497 4497
4498 /* If we have, just return it from the table. */ 4498 /* If we have, just return it from the table. */
4499 if (already_loaded >= 0) 4499 if (already_loaded >= 0)
4500 f->display.x->font = x_font_table[already_loaded].font; 4500 {
4501 4501 int wid;
4502 f->display.x->font = x_font_table[already_loaded].font;
4503 wid = FONT_WIDTH (f->display.x->font);
4504 f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid;
4505 }
4502 /* Otherwise, load the font and add it to the table. */ 4506 /* Otherwise, load the font and add it to the table. */
4503 else 4507 else
4504 { 4508 {
4505 int i; 4509 int i;
4506 char *full_name; 4510 char *full_name;
4567 x_font_table[n_fonts].full_name = x_font_table[n_fonts].name; 4571 x_font_table[n_fonts].full_name = x_font_table[n_fonts].name;
4568 f->display.x->font = x_font_table[n_fonts++].font = font; 4572 f->display.x->font = x_font_table[n_fonts++].font = font;
4569 4573
4570 if (full_name) 4574 if (full_name)
4571 fontname = full_name; 4575 fontname = full_name;
4576 {
4577 int wid = FONT_WIDTH (f->display.x->font);
4578 f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid;
4579 }
4572 } 4580 }
4573 4581
4574 /* Now make the frame display the given font. */ 4582 /* Now make the frame display the given font. */
4575 if (FRAME_X_WINDOW (f) != 0) 4583 if (FRAME_X_WINDOW (f) != 0)
4576 { 4584 {
4716 BLOCK_INPUT; 4724 BLOCK_INPUT;
4717 4725
4718 check_frame_size (f, &rows, &cols); 4726 check_frame_size (f, &rows, &cols);
4719 f->display.x->vertical_scroll_bar_extra 4727 f->display.x->vertical_scroll_bar_extra
4720 = (FRAME_HAS_VERTICAL_SCROLL_BARS (f) 4728 = (FRAME_HAS_VERTICAL_SCROLL_BARS (f)
4721 ? VERTICAL_SCROLL_BAR_PIXEL_WIDTH (f) 4729 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
4722 : 0); 4730 : 0);
4723 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); 4731 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
4724 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); 4732 pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows);
4725 4733
4726 f->display.x->win_gravity = NorthWestGravity; 4734 f->display.x->win_gravity = NorthWestGravity;