diff --git a/headers/private/shared/Toolbar.h b/headers/private/shared/Toolbar.h index d14eaecb67..130a6bf2eb 100644 --- a/headers/private/shared/Toolbar.h +++ b/headers/private/shared/Toolbar.h @@ -1,6 +1,6 @@ /* - * Copyright 2011 Stephan Aßmus - * All rights reserved. Distributed under the terms of the MIT license. + * Copyright 2011-2014, Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. */ #ifndef _TOOLBAR_H #define _TOOLBAR_H @@ -14,7 +14,8 @@ namespace BPrivate { class BToolbar : public BGroupView { public: - BToolbar(BRect frame); + BToolbar(BRect frame, + orientation ont = B_HORIZONTAL); virtual ~BToolbar(); virtual void Hide(); @@ -41,6 +42,8 @@ private: void _AddView(BView* view); BButton* _FindButton(uint32 command) const; void _HideToolTips() const; + + orientation fOrientation; }; } // namespace BPrivate diff --git a/src/kits/shared/Toolbar.cpp b/src/kits/shared/Toolbar.cpp index 4c9fbf5bae..0d6b79152f 100644 --- a/src/kits/shared/Toolbar.cpp +++ b/src/kits/shared/Toolbar.cpp @@ -44,9 +44,10 @@ LockableButton::MouseDown(BPoint point) } -BToolbar::BToolbar(BRect frame) +BToolbar::BToolbar(BRect frame, orientation ont) : - BGroupView(B_HORIZONTAL) + BGroupView(ont), + fOrientation(ont) { float inset = ceilf(be_control_look->DefaultItemSpacing() / 2); GroupLayout()->SetInsets(inset, 0, inset, 0); @@ -105,7 +106,9 @@ BToolbar::AddAction(BMessage* message, BHandler* target, void BToolbar::AddSeparator() { - _AddView(new BSeparatorView(B_VERTICAL, B_PLAIN_BORDER)); + orientation ont = (fOrientation == B_HORIZONTAL) ? + B_VERTICAL : B_HORIZONTAL; + _AddView(new BSeparatorView(ont, B_PLAIN_BORDER)); }