Krotos Modules 3
Loading...
Searching...
No Matches
DrawableButtonHelpers.h
Go to the documentation of this file.
1#pragma once
2namespace krotos
3{
4 //==============================================================================
11 class CloseButton : public DrawableButton
12 {
13 public:
15
16 private:
17 std::unique_ptr<Drawable> m_drawableDefault;
18 std::unique_ptr<Drawable> m_drawableHover;
19 std::unique_ptr<Drawable> m_drawableSelected;
20 };
21
22 //==============================================================================
28 class OpacityDrawableButton : public DrawableButton
29 {
30 public:
45 OpacityDrawableButton(std::unique_ptr<Drawable> drawable, const String& name, DrawableButton::ButtonStyle style,
46 float opacityNormal, float opacityHover = 0.0f, float opacityDown = 0.0f,
47 Colour targetColourToChangeAlpha = Colours::white);
48 };
49
50 //==============================================================================
55 {
56 public:
61 : OpacityDrawableButton(createKebabIconDrawable(), "ContextMenu", DrawableButton::ButtonStyle::ImageFitted,
62 0.5f, 1.0f)
63 {
64 }
65
66 private:
67 static std::unique_ptr<Drawable> createKebabIconDrawable()
68 {
69 return Drawable::createFromImageData(KrotosBinaryData::KebabIcon_svg, KrotosBinaryData::KebabIcon_svgSize);
70 }
71 };
72} // namespace krotos
A simple, image based Close Button using a drawable with default, hover and selected properties.
Definition DrawableButtonHelpers.h:12
std::unique_ptr< Drawable > m_drawableSelected
Definition DrawableButtonHelpers.h:19
CloseButton()
Definition DrawableButtonHelpers.cpp:6
std::unique_ptr< Drawable > m_drawableDefault
Definition DrawableButtonHelpers.h:17
std::unique_ptr< Drawable > m_drawableHover
Definition DrawableButtonHelpers.h:18
Draws a context menu button which has a kebab icon with mouse hover states.
Definition DrawableButtonHelpers.h:55
static std::unique_ptr< Drawable > createKebabIconDrawable()
Definition DrawableButtonHelpers.h:67
ContextMenuButton()
Create a context menu button. This is a kebab icon with mouse hover states for default and hover over...
Definition DrawableButtonHelpers.h:60
Helper class to create DrawableButtons with opacity hover states using a single Drawable resource....
Definition DrawableButtonHelpers.h:29
OpacityDrawableButton(std::unique_ptr< Drawable > drawable, const String &name, DrawableButton::ButtonStyle style, float opacityNormal, float opacityHover=0.0f, float opacityDown=0.0f, Colour targetColourToChangeAlpha=Colours::white)
Creates a DrawableButton with opacity hover states specified by the targetColourToChangeAlpha....
Definition DrawableButtonHelpers.cpp:18
Definition AirAbsorptionFilter.cpp:2