Make scrollbar_TotalWidth a method of scrollBar_t.
authorayin <ayin>
Sun, 17 Feb 2008 11:37:21 +0000 (11:37 +0000)
committerayin <ayin>
Sun, 17 Feb 2008 11:37:21 +0000 (11:37 +0000)
src/main.C
src/scrollbar.C
src/scrollbar.h

index 9effb70b9a0a5f0ea2f427a34952487ae5b914af..b1cf9b71deb3825ebd48be7b9acc820eaba1b734 100644 (file)
@@ -599,7 +599,7 @@ rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight)
 
   if (scrollBar.state)
     {
-      sb_w = scrollbar_TotalWidth ();
+      sb_w = scrollBar.total_width ();
       szHint.base_width += sb_w;
 
       if (!option (Opt_scrollBar_right))
@@ -987,7 +987,7 @@ rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, in
         {
           XMoveResizeWindow (dpy, scrollBar.win,
                              window_sb_x, 0,
-                             scrollbar_TotalWidth (), szHint.height);
+                             scrollBar.total_width (), szHint.height);
           resize_scrollbar ();
         }
 
index c676cbf79fddaa65faf6bbad65a5ad56ece81b19..514ce4985075f99469feea28d66208934ef84c37 100644 (file)
@@ -112,7 +112,7 @@ rxvt_term::resize_scrollbar ()
       scrollBar.win = XCreateSimpleWindow (dpy,
                                            parent[0],
                                            window_sb_x, 0,
-                                           scrollbar_TotalWidth (),
+                                           scrollBar.total_width (),
                                            szHint.height,
                                            0,
                                            pix_colors[Color_fg],
index 386d879cf348714a303e786cb6749bdd57461acc..41720416dc3463b3ece7dce59daf8a439db17394 100644 (file)
@@ -54,10 +54,12 @@ struct scrollBar_t {
       return y > end;
     return false;
   }
+  unsigned total_width ()
+  {
+    return width + shadow * 2;
+  }
 };
 
-#define scrollbar_TotalWidth()  (scrollBar.width + scrollBar.shadow * 2)
-
 #define SCROLLNEXT_MINHEIGHT    SB_THUMB_MIN_HEIGHT
 #define SCROLLRXVT_MINHEIGHT    10