73 MRVIEWER_API
static bool CustomCollapsingHeader(
const char* label, ImGuiTreeNodeFlags flags = 0,
int issueCount = 0 );
77 float baseWidth{ 0.0f };
78 float additionalWidth{ 0.0f };
99 void setOnPressAction( std::function<
void( std::shared_ptr<RibbonMenuItem>,
const std::string& )> action ) { onPressAction_ = action; };
101 void setGetterRequirements( std::function<std::string( std::shared_ptr<RibbonMenuItem> )> getterRequirements ) { getRequirements_ = getterRequirements; };
112 void drawDropList_(
const std::shared_ptr<RibbonMenuItem>& baseDropItem )
const;
113 void drawTooltip_(
const MenuItemInfo& item,
const std::string& requirements )
const;
115 std::function<void( std::shared_ptr<RibbonMenuItem>,
const std::string& )> onPressAction_ = []( std::shared_ptr<RibbonMenuItem>,
const std::string& ) {};
116 std::function<std::string( std::shared_ptr<RibbonMenuItem> )> getRequirements_ = []( std::shared_ptr<RibbonMenuItem> ) {
return std::string(); };
117 RibbonMenu* menu_ =
nullptr;
118 const ShortcutManager* shortcutManager_ =
nullptr;
120 std::optional<Color> monochrome_;
122 static std::vector<std::unique_ptr<MR::ImGuiImage>> textures_;
Definition MRShortcutManager.h:47
MRVIEWER_API void setMonochrome(const std::optional< Color > &color)
if set color then instead of multicolored icons will be drawn with this color
TextureType
Definition MRRibbonButtonDrawer.h:58
IconType
Definition MRRibbonIcons.h:24
MRVIEWER_API void drawCustomButtonItem(const MenuItemInfo &item, const CustomButtonParameters &customParam, const DrawButtonParams ¶ms) const
draw item button
RootType
icon size ( = 0 - use preset according to button type), this is scale factor of cBigIcon size (should...
Definition MRRibbonButtonDrawer.h:30
void setGetterRequirements(std::function< std::string(std::shared_ptr< RibbonMenuItem >)> getterRequirements)
set function to get requirements for activate item
Definition MRRibbonButtonDrawer.h:101
SizeType
Definition MRRibbonButtonDrawer.h:21
void setOnPressAction(std::function< void(std::shared_ptr< RibbonMenuItem >, const std::string &)> action)
set reaction on press item button
Definition MRRibbonButtonDrawer.h:99
void setShortcutManager(const ShortcutManager *shortcutManager)
Definition MRRibbonButtonDrawer.h:104
MRVIEWER_API bool drawTabArrowButton(const char *icon, const ImVec2 &size, float iconSize)
draw custom styled button
static MRVIEWER_API std::unique_ptr< ImGuiImage > & GetTexture(TextureType type)
MRVIEWER_API ButtonItemWidth calcItemWidth(const MenuItemInfo &item, DrawButtonParams::SizeType sizeType) const
MRVIEWER_API void drawButtonItem(const MenuItemInfo &item, const DrawButtonParams ¶ms) const
draw item button
MRVIEWER_API bool GradientCheckboxItem(const MenuItemInfo &item, bool *value) const
draw gradient checkbox with icon (for menu item)
static MRVIEWER_API bool CustomCollapsingHeader(const char *label, ImGuiTreeNodeFlags flags=0, int issueCount=0)
void setMenu(RibbonMenu *menu)
Definition MRRibbonButtonDrawer.h:103
MRVIEWER_API int pushRibbonButtonColors(bool enabled, bool active, bool forceHovered, DrawButtonParams::RootType rootType) const
static MRVIEWER_API void InitGradientTexture()
Creates GL texture for gradient UI (called on theme apply)
float iconSize
size of whole item group, needed for all, this should respect system scaling
Definition MRRibbonButtonDrawer.h:28
ImVec2 itemSize
type of button to draw
Definition MRRibbonButtonDrawer.h:27
RibbonIcons::IconType iconType
Definition MRRibbonButtonDrawer.h:48
bool forcePressed
if true treat this item as pressed
Definition MRRibbonButtonDrawer.h:39
std::function< int(bool, bool)> pushColorsCb
if not set push default ribbon colors
Definition MRRibbonButtonDrawer.h:47
enum MR::DrawButtonParams::SizeType Big
MRVIEWER_API void drawButtonIcon(const MenuItemInfo &item, const DrawButtonParams ¶ms) const
draw item button icon
bool * isPressed
set true if item pressed
Definition MRRibbonButtonDrawer.h:41
bool forceHovered
if true treat this item as hovered
Definition MRRibbonButtonDrawer.h:37
@ Header
button is on toolbar
Definition MRRibbonButtonDrawer.h:33
@ Toolbar
button is on main ribbon bar
Definition MRRibbonButtonDrawer.h:32
@ Ribbon
Definition MRRibbonButtonDrawer.h:31
@ Small
button is small, text is on same line
@ SmallText
button is big, underline text is divided to 2 lines (maximum) to fit width
only for bindings generation
Definition MRCameraOrientationPlugin.h:8