Root/
| 1 | #include "buttonbox.h" |
| 2 | |
| 3 | #include "gmenu2x.h" |
| 4 | #include "iconbutton.h" |
| 5 | |
| 6 | using std::unique_ptr; |
| 7 | using std::move; |
| 8 | |
| 9 | void ButtonBox::add(unique_ptr<IconButton> button) |
| 10 | { |
| 11 | buttons.push_back(move(button)); |
| 12 | } |
| 13 | |
| 14 | void ButtonBox::clear() |
| 15 | { |
| 16 | buttons.clear(); |
| 17 | } |
| 18 | |
| 19 | void ButtonBox::paint(Surface& s, int x, int y) |
| 20 | { |
| 21 | for (auto& button : buttons) { |
| 22 | auto rect = button->getRect(); |
| 23 | button->setPosition(x, y - rect.h); |
| 24 | button->paint(s); |
| 25 | x += button->getRect().w + 6; |
| 26 | } |
| 27 | } |
| 28 |
Branches:
install_locations
master
opkrun
packages
