| 9 | namespace Ui { |
| 10 | |
| 11 | LoadPackWidget::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 | |
| 46 | void LoadPackWidget::update() |
| 47 | { |
nothing calls this directly
no test coverage detected