1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2025-04-21 12:27:27 +03:00

Removed GMenu2X pointer from ButtonBox

It was only used to fetch resY, so I replaced that by taking the
y-coordinate as an argument. That is also more consistent with the
x-coordinate which was already an argument.

The x-coordinate was changed to a signed int, since that is the norm
for paint coordinates. It can be useful for drawing widgets that are
partially off screen, for example during a (dis)appear animation.

In InputDialog, the ButtonBox field was changed from a pointer to
a plain data member. There was no need to dynamically allocate it.
This commit is contained in:
Maarten ter Huurne
2014-08-16 05:47:48 +02:00
parent e5a432cb6b
commit 428a316bc1
7 changed files with 13 additions and 24 deletions

View File

@@ -62,7 +62,7 @@ bool WallpaperDialog::exec()
uint i, selected = 0, firstElement = 0, iY;
ButtonBox buttonbox(gmenu2x);
ButtonBox buttonbox;
buttonbox.add(unique_ptr<IconButton>(new IconButton(gmenu2x, ts, "skin:imgs/buttons/accept.png", gmenu2x->tr["Select"])));
buttonbox.add(unique_ptr<IconButton>(new IconButton(gmenu2x, ts, "skin:imgs/buttons/cancel.png", gmenu2x->tr["Exit"])));
@@ -90,7 +90,7 @@ bool WallpaperDialog::exec()
writeTitle(s, gmenu2x->tr["Wallpaper selection"]);
writeSubTitle(s, gmenu2x->tr["Select a wallpaper from the list"]);
buttonbox.paint(s, 5);
buttonbox.paint(s, 5, gmenu2x->resY - 1);
//Selection
iY = selected - firstElement;