]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Hide/show the scrollbar
authorOwen Dunn <owen@greenend.org.uk>
Sun, 30 Jan 2005 14:59:47 +0000 (14:59 +0000)
committerOwen Dunn <owen@greenend.org.uk>
Sun, 30 Jan 2005 14:59:47 +0000 (14:59 +0000)
[originally from svn r5230]

mac/macdlg.c
mac/macterm.c

index be0b50d984f38337e73ed747dc938bc8f6f914fe..4d60492a9692ee71f72d89a91e3e837b2f19e4b8 100644 (file)
@@ -181,7 +181,6 @@ static void mac_enddlg_reconfig(WindowPtr window, int value)
        if (s->cfg.height != prev_cfg.height ||
            s->cfg.width != prev_cfg.width ||
            s->cfg.savelines != prev_cfg.savelines) {
-           term_size(s->term, s->cfg.height, s->cfg.width, s->cfg.savelines);
            request_resize(s, s->cfg.width, s->cfg.height);
        }
 
@@ -189,7 +188,11 @@ static void mac_enddlg_reconfig(WindowPtr window, int value)
        if (s->cfg.wintitle[0])
             set_title(s, s->cfg.wintitle);
 
-       /* TODO: zoom, scroll bar, font */
+       /* Scroll bar */
+       if (s->cfg.scrollbar != prev_cfg.scrollbar)
+           request_resize(s, s->cfg.width, s->cfg.height);
+
+       /* TODO: zoom, font */
     }
 }
 
index 44fb5af815724c9957be95f5f0113e973768e695..a80b113a7804048ce1f2d6e3de223a892fb91b7c 100644 (file)
@@ -324,14 +324,18 @@ void mac_pollterm(void)
  */
 static void mac_adjustsize(Session *s, int newrows, int newcols) {
     int winwidth, winheight;
+    int extraforscroll;
 
-    winwidth = newcols * s->font_width + 15;
+    extraforscroll=s->cfg.scrollbar ? 15 : 0;
+    winwidth = newcols * s->font_width + extraforscroll;
     winheight = newrows * s->font_height;
     SizeWindow(s->window, winwidth, winheight, true);
-    HideControl(s->scrollbar);
-    MoveControl(s->scrollbar, winwidth - 15, -1);
-    SizeControl(s->scrollbar, 16, winheight - 13);
-    ShowControl(s->scrollbar);
+    if (s->cfg.scrollbar) {
+        HideControl(s->scrollbar);
+        MoveControl(s->scrollbar, winwidth - extraforscroll, -1);
+        SizeControl(s->scrollbar, extraforscroll + 1, winheight - 13);
+        ShowControl(s->scrollbar);
+    }
     mac_drawgrowicon(s);
 }
 
@@ -1043,7 +1047,7 @@ static void mac_activateterm(WindowPtr window, EventRecord *event)
     s = mac_windowsession(window);
     term_set_focus(s->term, active);
     term_update(s->term);
-    if (active)
+    if (active && s->cfg.scrollbar)
        ShowControl(s->scrollbar);
     else {
        if (HAVE_COLOR_QD())