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!
This commit is contained in:
John Scipione 2015-02-20 14:38:43 -05:00
parent 35384ab425
commit 64182ccb20
2 changed files with 2 additions and 3 deletions

View File

@ -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;

View File

@ -44,6 +44,7 @@ All rights reserved.
#include <Bitmap.h>
#include <ControlLook.h>
#include <Debug.h>
#include <MenuPrivate.h>
#include <NodeInfo.h>
#include <Roster.h>
#include <Screen.h>
@ -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
}