mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 12:48:26 +02:00
Removed GMenu2X::drawButton variant
This was only called form ButtonBox, so I moved the code there. I still think a paint method shouldn't be repositioning widgets, but that's something for a later cleanup.
This commit is contained in:
parent
faf0287cf5
commit
8e885bc2c1
@ -22,10 +22,14 @@ void ButtonBox::clear()
|
|||||||
buttons.clear();
|
buttons.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ButtonBox::paint(Surface& s, unsigned int posX)
|
void ButtonBox::paint(Surface& s, unsigned int x)
|
||||||
{
|
{
|
||||||
|
const int y = gmenu2x->resY - 1;
|
||||||
for (auto button : buttons) {
|
for (auto button : buttons) {
|
||||||
posX = gmenu2x->drawButton(s, button, posX);
|
auto rect = button->getRect();
|
||||||
|
button->setPosition(x, y - rect.h);
|
||||||
|
button->paint(s);
|
||||||
|
x += button->getRect().w + 6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ public:
|
|||||||
void add(IconButton *button);
|
void add(IconButton *button);
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
void paint(Surface& s, unsigned int posX);
|
void paint(Surface& s, unsigned int x);
|
||||||
void handleTS();
|
void handleTS();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1030,13 +1030,6 @@ string GMenu2X::getDiskFree(const char *path) {
|
|||||||
return df;
|
return df;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GMenu2X::drawButton(Surface& s, IconButton *btn, int x, int y) {
|
|
||||||
if (y<0) y = resY+y;
|
|
||||||
btn->setPosition(x, y-7);
|
|
||||||
btn->paint(s);
|
|
||||||
return x+btn->getRect().w+6;
|
|
||||||
}
|
|
||||||
|
|
||||||
int GMenu2X::drawButton(Surface& s, const string &btn, const string &text, int x, int y) {
|
int GMenu2X::drawButton(Surface& s, const string &btn, const string &text, int x, int y) {
|
||||||
if (y<0) y = resY+y;
|
if (y<0) y = resY+y;
|
||||||
int w = 0;
|
int w = 0;
|
||||||
|
@ -205,7 +205,6 @@ public:
|
|||||||
void renameSection();
|
void renameSection();
|
||||||
void deleteSection();
|
void deleteSection();
|
||||||
|
|
||||||
int drawButton(Surface& s, IconButton *btn, int x=5, int y=-10);
|
|
||||||
int drawButton(Surface& s, const std::string &btn, const std::string &text, int x=5, int y=-10);
|
int drawButton(Surface& s, const std::string &btn, const std::string &text, int x=5, int y=-10);
|
||||||
int drawButtonRight(Surface& s, const std::string &btn, const std::string &text, int x=5, int y=-10);
|
int drawButtonRight(Surface& s, const std::string &btn, const std::string &text, int x=5, int y=-10);
|
||||||
void drawScrollBar(uint pageSize, uint totalSize, uint pagePos);
|
void drawScrollBar(uint pageSize, uint totalSize, uint pagePos);
|
||||||
|
Loading…
Reference in New Issue
Block a user