hrev48269 adds 1 changeset to branch 'master' old head: 44d31dca37fa0bc5ca2cbfe287d54822394ac2d4 new head: 0a74147e1de93928485f134d35cfbc24b33a763d overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=0a74147+%5E44d31dc ---------------------------------------------------------------------------- 0a74147: BToolbar: Allow the toolbar's orientation to be set by its creator. I already made this patch in Heidi's clone of BToolbar. Adding it here allows me to drop Heidi's version altogether. I also relicensed the header file at the permission of Stephan. The .cpp file still lists him as author and copyright holder. Signed-off-by: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev48269 Commit: 0a74147e1de93928485f134d35cfbc24b33a763d URL: http://cgit.haiku-os.org/haiku/commit/?id=0a74147 Author: Augustin Cavalier <waddlesplash@xxxxxxxxx> Date: Sat Nov 8 03:53:18 2014 UTC Committer: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx> Commit-Date: Mon Nov 10 00:21:13 2014 UTC ---------------------------------------------------------------------------- 2 files changed, 12 insertions(+), 6 deletions(-) headers/private/shared/Toolbar.h | 9 ++++++--- src/kits/shared/Toolbar.cpp | 9 ++++++--- ---------------------------------------------------------------------------- diff --git a/headers/private/shared/Toolbar.h b/headers/private/shared/Toolbar.h index d14eaec..130a6bf 100644 --- a/headers/private/shared/Toolbar.h +++ b/headers/private/shared/Toolbar.h @@ -1,6 +1,6 @@ /* - * Copyright 2011 Stephan Aßmus <superstippi@xxxxxx> - * 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 4c9fbf5..0d6b791 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)); }