From a6e23d383572c281f399aebcc3efc329e45722d7 Mon Sep 17 00:00:00 2001 From: ayin Date: Sun, 17 Feb 2008 11:37:21 +0000 Subject: [PATCH] Make scrollbar_TotalWidth a method of scrollBar_t. --- src/main.C | 4 ++-- src/scrollbar.C | 2 +- src/scrollbar.h | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.C b/src/main.C index 9effb70b..b1cf9b71 100644 --- a/src/main.C +++ b/src/main.C @@ -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 (); } diff --git a/src/scrollbar.C b/src/scrollbar.C index c676cbf7..514ce498 100644 --- a/src/scrollbar.C +++ b/src/scrollbar.C @@ -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], diff --git a/src/scrollbar.h b/src/scrollbar.h index 386d879c..41720416 100644 --- a/src/scrollbar.h +++ b/src/scrollbar.h @@ -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 -- 2.34.1