changeset 8942:a43f3b56ed47

(x_set_scroll_bar_width): New function. (x_frame_parms): Add that function to this table. (Qscroll_bar_width): New symbol. (syms_of_xfns): Initialize and staticpro it. (Fx_create_frame): Set default scroll bar width.
author Karl Heuer <kwzh@gnu.org>
date Tue, 20 Sep 1994 05:07:53 +0000
parents 71762e6d69e0
children a9e40d478857
files src/xfns.c
diffstat 1 files changed, 23 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Tue Sep 20 05:05:02 1994 +0000
+++ b/src/xfns.c	Tue Sep 20 05:07:53 1994 +0000
@@ -205,7 +205,6 @@
 Lisp_Object Qfont;
 Lisp_Object Qforeground_color;
 Lisp_Object Qgeometry;
-/* Lisp_Object Qicon; */
 Lisp_Object Qicon_left;
 Lisp_Object Qicon_top;
 Lisp_Object Qicon_type;
@@ -214,6 +213,7 @@
 Lisp_Object Qmouse_color;
 Lisp_Object Qnone;
 Lisp_Object Qparent_id;
+Lisp_Object Qscroll_bar_width;
 Lisp_Object Qsuppress_icon;
 Lisp_Object Qtop;
 Lisp_Object Qundefined_color;
@@ -401,6 +401,7 @@
 void x_set_vertical_scroll_bars ();
 void x_set_visibility ();
 void x_set_menu_bar_lines ();
+void x_set_scroll_bar_width ();
 
 static struct x_frame_parm_table x_frame_parms[] =
 {
@@ -420,6 +421,7 @@
   "vertical-scroll-bars", x_set_vertical_scroll_bars,
   "visibility", x_set_visibility,
   "menu-bar-lines", x_set_menu_bar_lines,
+  "scroll-bar-width", x_set_scroll_bar_width,
 };
 
 /* Attach the `x-frame-parameter' properties to
@@ -1321,6 +1323,21 @@
 	x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
     }
 }
+
+void
+x_set_scroll_bar_width (f, arg, oldval)
+     struct frame *f;
+     Lisp_Object arg, oldval;
+{
+  if (XFASTINT (arg) != FRAME_SCROLL_BAR_PIXEL_WIDTH (f))
+    {
+      int wid = FONT_WIDTH (f->display.x->font);
+      FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = XFASTINT (arg);
+      FRAME_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + wid-1) / wid;
+      if (FRAME_X_WINDOW (f))
+	x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
+    }
+}
 
 /* Subroutines of creating an X frame.  */
 
@@ -1674,7 +1691,7 @@
 
   f->display.x->vertical_scroll_bar_extra
     = (FRAME_HAS_VERTICAL_SCROLL_BARS (f)
-       ? VERTICAL_SCROLL_BAR_PIXEL_WIDTH (f)
+       ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
        : 0);
   f->display.x->pixel_width = CHAR_TO_PIXEL_WIDTH (f, f->width);
   f->display.x->pixel_height = CHAR_TO_PIXEL_HEIGHT (f, f->height);
@@ -2288,6 +2305,8 @@
 
   x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1),
 		       "menuBarLines", "MenuBarLines", number);
+  x_default_parameter (f, parms, Qscroll_bar_width, make_number (12),
+		       "scrollBarWidth", "ScrollBarWidth", number);
 
   f->display.x->parent_desc = ROOT_WINDOW;
   window_prompting = x_figure_window_size (f, parms);
@@ -3944,6 +3963,8 @@
   staticpro (&Qnone);
   Qparent_id = intern ("parent-id");
   staticpro (&Qparent_id);
+  Qscroll_bar_width = intern ("scroll-bar-width");
+  staticpro (&Qscroll_bar_width);
   Qsuppress_icon = intern ("suppress-icon");
   staticpro (&Qsuppress_icon);
   Qtop = intern ("top");