MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / DropDownButton

Method DropDownButton

src/app/ui/drop_down_button.cpp:25–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23using namespace ui;
24
25DropDownButton::DropDownButton(const char* text)
26 : HBox()
27 , m_button(new Button(text))
28 , m_dropDown(new Button(""))
29{
30 SkinTheme* theme = SkinTheme::instance();
31
32 setup_look(m_button, LeftButtonLook);
33 setup_look(m_dropDown, RightButtonLook);
34
35 m_button->setExpansive(true);
36 m_button->setAlign(LEFT | MIDDLE);
37 m_button->Click.connect(&DropDownButton::onButtonClick, this);
38 m_dropDown->Click.connect(&DropDownButton::onDropDownButtonClick, this);
39
40 addChild(m_button);
41 addChild(m_dropDown);
42
43 setChildSpacing(0);
44
45 m_dropDown->setIconInterface
46 (new ButtonIconImpl(theme->parts.comboboxArrowDown(),
47 theme->parts.comboboxArrowDownSelected(),
48 theme->parts.comboboxArrowDownDisabled(),
49 CENTER | MIDDLE));
50}
51
52void DropDownButton::onButtonClick(Event& ev)
53{

Callers

nothing calls this directly

Calls 5

instanceFunction · 0.85
setup_lookFunction · 0.85
setExpansiveMethod · 0.80
setIconInterfaceMethod · 0.80
setAlignMethod · 0.45

Tested by

no test coverage detected