MCPcopy Create free account
hub / github.com/black-sliver/PopTracker / LoadPackWidget

Method LoadPackWidget

src/ui/loadpackwidget.cpp:11–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace Ui {
10
11LoadPackWidget::LoadPackWidget(int x, int y, int w, int h, FontStore *fontStore)
12 : SimpleContainer(x,y,w,h), _fontStore(fontStore)
13{
14 _font = _fontStore->getFont(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE);
15 _smallFont = _fontStore->getFont(DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE - 2);
16 if (_font && !_smallFont) _smallFont = _font;
17
18 onClick += {this, [this](void*, int, int, int button) {
19 if (button == MouseButton::BUTTON_RIGHT) {
20 setVisible(false); // TODO: fire onAbort ?
21 }
22 }};
23
24 auto packs = new ScrollVBox(0,0,0,0);
25 packs->setGrow(1,1);
26 packs->setPadding(0);
27 packs->setSpacing(1);
28 _packs = packs;
29
30 auto variants = new VBox(0,0,0,0);
31 variants->setGrow(1,1);
32 variants->setPadding(0);
33 variants->setSpacing(1);
34 _variants = variants;
35
36 auto hbox = new HBox(0,0,0,0);
37 hbox->setGrow(1,1);
38 hbox->addChild(packs);
39 hbox->addChild(variants);
40 hbox->setSpacing(1);
41 hbox->setPadding(2);
42 addChild(hbox);
43 _main = hbox;
44}
45
46void LoadPackWidget::update()
47{

Callers

nothing calls this directly

Calls 5

getFontMethod · 0.80
setGrowMethod · 0.80
setPaddingMethod · 0.45
setSpacingMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected