1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-04 21:05:27 +03:00
gmenu2x/src/background.cpp
Maarten ter Huurne 71f4391cda Moved all code for opening the context menu into the Menu class
All of the entries in the context menu affect sections and links, so
the context menu should be considered part of the main menu, not of
the global / background context.
2013-08-09 19:09:57 +02:00

44 lines
863 B
C++

// Various authors.
// License: GPL version 2 or later.
#include "background.h"
#include "gmenu2x.h"
Background::Background(GMenu2X &gmenu2x)
: gmenu2x(gmenu2x)
, battery(gmenu2x.sc)
{
}
void Background::paint(Surface &s) {
Font &font = *gmenu2x.font;
SurfaceCollection &sc = gmenu2x.sc;
sc["bgmain"]->blit(&s, 0, 0);
s.write(&font, clock.getTime(),
s.width() / 2, gmenu2x.bottomBarTextY,
Font::HAlignCenter, Font::VAlignMiddle);
battery.getIcon().blit(&s, s.width() - 19, gmenu2x.bottomBarIconY);
}
bool Background::handleButtonPress(InputManager::Button button) {
switch (button) {
case InputManager::CANCEL:
gmenu2x.showHelpPopup();
return true;
case InputManager::SETTINGS:
gmenu2x.showSettings();
return true;
default:
return false;
}
}
bool Background::handleTouchscreen(Touchscreen &/*ts*/) {
return false;
}