From 3490eda827a60857605ac53271dfc7573f5dd1ef Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 29 Apr 2016 13:57:50 -0700 Subject: [PATCH] ControlLook: Rename border param to borderStyle border vs. borders is confusing. BTabView: Rename border param to borderStyle BTabView docs: rename border param to borderStyle enumerate border styles in docs --- docs/user/interface/TabView.dox | 9 +++++++-- headers/os/interface/ControlLook.h | 4 ++-- headers/os/interface/TabView.h | 2 +- src/kits/interface/ControlLook.cpp | 15 ++++++++------- src/kits/interface/TabView.cpp | 10 +++++----- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/docs/user/interface/TabView.dox b/docs/user/interface/TabView.dox index e5825409d6..c9605cf603 100644 --- a/docs/user/interface/TabView.dox +++ b/docs/user/interface/TabView.dox @@ -694,8 +694,13 @@ /*! - \fn void BTabView::SetBorder(border_style border) - \brief Sets the border of the tab view to \a border. + \fn void BTabView::SetBorder(border_style borderStyle) + \brief Sets the border style of the tab view to \a borderStyle. + + \param borderStyle One of the following: + - \c B_FANCY_BORDER (the default) + - \c B_PLAIN_BORDER a plain line border, + - \c B_NO_BORDER do not draw a border. \since Haiku R1 */ diff --git a/headers/os/interface/ControlLook.h b/headers/os/interface/ControlLook.h index 445f40bf8e..0908256156 100644 --- a/headers/os/interface/ControlLook.h +++ b/headers/os/interface/ControlLook.h @@ -240,7 +240,7 @@ public: BRect verticalScrollBarFrame, BRect horizontalScrollBarFrame, const rgb_color& base, - border_style border, + border_style borderStyle, uint32 flags = 0, uint32 borders = B_ALL_BORDERS); @@ -307,7 +307,7 @@ public: virtual void DrawBorder(BView* view, BRect& rect, const BRect& updateRect, const rgb_color& base, - border_style border, uint32 flags = 0, + border_style borderStyle, uint32 flags = 0, uint32 borders = B_ALL_BORDERS); virtual void DrawRaisedBorder(BView* view, BRect& rect, diff --git a/headers/os/interface/TabView.h b/headers/os/interface/TabView.h index 845893a679..1547610d38 100644 --- a/headers/os/interface/TabView.h +++ b/headers/os/interface/TabView.h @@ -162,7 +162,7 @@ public: virtual void SetTabHeight(float height); float TabHeight() const; - virtual void SetBorder(border_style border); + virtual void SetBorder(border_style borderStyle); border_style Border() const; BView* ContainerView() const; diff --git a/src/kits/interface/ControlLook.cpp b/src/kits/interface/ControlLook.cpp index 7446d80495..642d300c20 100644 --- a/src/kits/interface/ControlLook.cpp +++ b/src/kits/interface/ControlLook.cpp @@ -680,7 +680,7 @@ void BControlLook::DrawScrollViewFrame(BView* view, BRect& rect, const BRect& updateRect, BRect verticalScrollBarFrame, BRect horizontalScrollBarFrame, const rgb_color& base, - border_style border, uint32 flags, uint32 _borders) + border_style borderStyle, uint32 flags, uint32 _borders) { // calculate scroll corner rect before messing with the "rect" BRect scrollCornerFillRect(rect.right, rect.bottom, @@ -692,7 +692,7 @@ BControlLook::DrawScrollViewFrame(BView* view, BRect& rect, if (verticalScrollBarFrame.IsValid()) scrollCornerFillRect.top = verticalScrollBarFrame.bottom + 1; - if (border == B_NO_BORDER) { + if (borderStyle == B_NO_BORDER) { if (scrollCornerFillRect.IsValid()) { view->SetHighColor(base); view->FillRect(scrollCornerFillRect); @@ -700,7 +700,7 @@ BControlLook::DrawScrollViewFrame(BView* view, BRect& rect, return; } - bool excludeScrollCorner = border == B_FANCY_BORDER + bool excludeScrollCorner = borderStyle == B_FANCY_BORDER && horizontalScrollBarFrame.IsValid() && verticalScrollBarFrame.IsValid(); @@ -713,7 +713,7 @@ BControlLook::DrawScrollViewFrame(BView* view, BRect& rect, rgb_color scrollbarFrameColor = tint_color(base, B_DARKEN_2_TINT); - if (border == B_FANCY_BORDER) + if (borderStyle == B_FANCY_BORDER) _DrawOuterResessedFrame(view, rect, base, 1.0, 1.0, flags, borders); if ((flags & B_FOCUSED) != 0) { @@ -1634,16 +1634,17 @@ BControlLook::DrawSplitter(BView* view, BRect& rect, const BRect& updateRect, void BControlLook::DrawBorder(BView* view, BRect& rect, const BRect& updateRect, - const rgb_color& base, border_style border, uint32 flags, uint32 borders) + const rgb_color& base, border_style borderStyle, uint32 flags, + uint32 borders) { - if (border == B_NO_BORDER) + if (borderStyle == B_NO_BORDER) return; rgb_color scrollbarFrameColor = tint_color(base, B_DARKEN_2_TINT); if ((flags & B_FOCUSED) != 0) scrollbarFrameColor = ui_color(B_KEYBOARD_NAVIGATION_COLOR); - if (border == B_FANCY_BORDER) + if (borderStyle == B_FANCY_BORDER) _DrawOuterResessedFrame(view, rect, base, 1.0, 1.0, flags, borders); _DrawFrame(view, rect, scrollbarFrameColor, scrollbarFrameColor, diff --git a/src/kits/interface/TabView.cpp b/src/kits/interface/TabView.cpp index 7e3f5b7e9c..b947bc13d5 100644 --- a/src/kits/interface/TabView.cpp +++ b/src/kits/interface/TabView.cpp @@ -1166,12 +1166,12 @@ BTabView::TabHeight() const void -BTabView::SetBorder(border_style border) +BTabView::SetBorder(border_style borderStyle) { - if (fBorderStyle == border) + if (fBorderStyle == borderStyle) return; - fBorderStyle = border; + fBorderStyle = borderStyle; _LayoutContainerView((Flags() & B_SUPPORTS_LAYOUT) != 0); } @@ -1373,7 +1373,7 @@ BTabView::operator=(const BTabView&) extern "C" void B_IF_GCC_2(_ReservedTabView1__8BTabView, _ZN8BTabView17_ReservedTabView1Ev)( - BTabView* tabView, border_style border) + BTabView* tabView, border_style borderStyle) { - tabView->BTabView::SetBorder(border); + tabView->BTabView::SetBorder(borderStyle); }