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:
@@ -173,7 +173,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
friend class BMenuBar;
|
friend class BMenuBar;
|
||||||
friend class BPrivate::MenuPrivate;
|
friend class BPrivate::MenuPrivate;
|
||||||
friend class TExpandoMenuBar;
|
|
||||||
friend status_t _init_interface_kit_();
|
friend status_t _init_interface_kit_();
|
||||||
friend status_t set_menu_info(menu_info* info);
|
friend status_t set_menu_info(menu_info* info);
|
||||||
friend status_t get_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;
|
int _State(BMenuItem** _item = NULL) const;
|
||||||
void _InvokeItem(BMenuItem* item, bool now = false);
|
void _InvokeItem(BMenuItem* item, bool now = false);
|
||||||
void _QuitTracking(bool onlyThis = true);
|
void _QuitTracking(bool onlyThis = true);
|
||||||
void _SetMenuLayout(menu_layout layout) { fLayout = layout; };
|
|
||||||
|
|
||||||
static menu_info sMenuInfo;
|
static menu_info sMenuInfo;
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ All rights reserved.
|
|||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
|
#include <MenuPrivate.h>
|
||||||
#include <NodeInfo.h>
|
#include <NodeInfo.h>
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
@@ -792,7 +793,7 @@ void
|
|||||||
TExpandoMenuBar::SetMenuLayout(menu_layout layout)
|
TExpandoMenuBar::SetMenuLayout(menu_layout layout)
|
||||||
{
|
{
|
||||||
fVertical = layout == B_ITEMS_IN_COLUMN;
|
fVertical = layout == B_ITEMS_IN_COLUMN;
|
||||||
BMenu::_SetMenuLayout(layout);
|
BPrivate::MenuPrivate(this).SetLayout(layout);
|
||||||
SetMaxItemWidth();
|
SetMaxItemWidth();
|
||||||
// when the menu layout changes, make sure to set the max width
|
// when the menu layout changes, make sure to set the max width
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user