mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-10-04 02:59:28 +03:00
7134eb3778
Since this surface is created by initBG instead of loaded from skin search paths, it didn't really fit in SurfaceCollection. After removing it, one of SurfaceCollection's methods could be removed as well.
44 lines
854 B
C++
44 lines
854 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;
|
|
OffscreenSurface& bgmain = *gmenu2x.bgmain;
|
|
|
|
bgmain.blit(s, 0, 0);
|
|
|
|
font.write(s, 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&) {
|
|
return false;
|
|
}
|