From 64182ccb20f1586f102445dece20cae2af79dc97 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 20 Feb 2015 14:38:43 -0500 Subject: [PATCH] Menu and Deskbar: Remove _SetMenuLayout() method and remove TExpandoMenuBar as a friend class to BMenu hack. In Deskbar, call the newly added MenuPrivate::SetLayout() method instead. This is a much cleaner way to implement this, thanks Stefano Ceccherini for the tip! --- headers/os/interface/Menu.h | 2 -- src/apps/deskbar/ExpandoMenuBar.cpp | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/headers/os/interface/Menu.h b/headers/os/interface/Menu.h index 23db0c7aed..b96a7869e3 100644 --- a/headers/os/interface/Menu.h +++ b/headers/os/interface/Menu.h @@ -173,7 +173,6 @@ public: private: friend class BMenuBar; friend class BPrivate::MenuPrivate; - friend class TExpandoMenuBar; friend status_t _init_interface_kit_(); friend status_t set_menu_info(menu_info* info); friend status_t get_menu_info(menu_info* info); @@ -270,7 +269,6 @@ private: int _State(BMenuItem** _item = NULL) const; void _InvokeItem(BMenuItem* item, bool now = false); void _QuitTracking(bool onlyThis = true); - void _SetMenuLayout(menu_layout layout) { fLayout = layout; }; static menu_info sMenuInfo; diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp index b63a5d4ac1..479b61c717 100644 --- a/src/apps/deskbar/ExpandoMenuBar.cpp +++ b/src/apps/deskbar/ExpandoMenuBar.cpp @@ -44,6 +44,7 @@ All rights reserved. #include #include #include +#include #include #include #include @@ -792,7 +793,7 @@ void TExpandoMenuBar::SetMenuLayout(menu_layout layout) { fVertical = layout == B_ITEMS_IN_COLUMN; - BMenu::_SetMenuLayout(layout); + BPrivate::MenuPrivate(this).SetLayout(layout); SetMaxItemWidth(); // when the menu layout changes, make sure to set the max width }