haiku/headers/private/interface/MenuItemPrivate.h
John Scipione 81364c9d82 BColorMenuItem: add custom color menufield
http://insightfactory.tumblr.com/image/142366356207

* Make the color box a rectangle with proportions of golden ratio.
* Override GetContentSize() to make menu item area larger.
* Label should never truncate since I make sure there is enough room.
* Draw the label using BMenuItem parent class
* Carefully adjust the spacing so that there is an attractive amount of
  padding between the checkmark and color box and the color box and label.

Add _AddMenu method to BMenuField that adds BColorMenuItem as its
base menu item. This shows the BColorMenuItem in the closed state.

Create BPrivate::MenuItemPrivate

Add a SetSubmenu() method to MenuItemPrivate that gives you
the ability to add a submenu after creating the object. This
method should be public

Skip disabled items

Color gets updated even if you select an item in a submenu
2016-07-31 19:42:39 -07:00

36 lines
565 B
C++

/*
* Copyright 2016 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* John Scipione, jscipione@gmail.com
*/
#ifndef __MENU_ITEM_PRIVATE_H
#define __MENU_ITEM_PRIVATE_H
#include <MenuItem.h>
class BMenu;
namespace BPrivate {
class MenuItemPrivate {
public:
MenuItemPrivate(BMenuItem* menuItem);
void SetSubmenu(BMenu* submenu);
void Install(BWindow* window);
void Uninstall();
private:
BMenuItem* fMenuItem;
};
}; // namespace BPrivate
#endif // __MENU_ITEM_PRIVATE_H