X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/1cdf6cb021fcaa6548b90ba7b6765cf1e8b8b37b..2e74b767faf7548c6f6aae3a12506d46d3edd6c0:/lib/gui/ewindowstyle.cpp diff --git a/lib/gui/ewindowstyle.cpp b/lib/gui/ewindowstyle.cpp index ccf7299f..79024a35 100644 --- a/lib/gui/ewindowstyle.cpp +++ b/lib/gui/ewindowstyle.cpp @@ -2,10 +2,35 @@ #include #include #include - +#include +#include eWindowStyle::~eWindowStyle() {} +DEFINE_REF(eWindowStyleManager); + +eWindowStyleManager::eWindowStyleManager() +{ + m_instance = this; +} + +eWindowStyleManager::~eWindowStyleManager() +{ + m_instance = 0; +} + +void eWindowStyleManager::getStyle(ePtr &style) +{ + style = m_current_style; +} + +void eWindowStyleManager::setStyle(eWindowStyle *style) +{ + m_current_style = style; +} + +eWindowStyleManager *eWindowStyleManager::m_instance; + DEFINE_REF(eWindowStyleSimple); eWindowStyleSimple::eWindowStyleSimple() @@ -22,7 +47,7 @@ eWindowStyleSimple::eWindowStyleSimple() m_background_color = gColor(0x19); } -void eWindowStyleSimple::handleNewSize(eWindow *wnd, const eSize &size) +void eWindowStyleSimple::handleNewSize(eWindow *wnd, eSize &size, eSize &offset) { // eDebug("handle new size: %d x %d", size.width(), size.height()); @@ -80,6 +105,10 @@ void eWindowStyleSimple::setStyle(gPainter &painter, int what) painter.setForegroundColor(gColor(0x1C)); painter.setBackgroundColor(m_background_color); break; + case styleListboxMarked: + painter.setForegroundColor(gColor(0x2F)); + painter.setBackgroundColor(gColor(0x2A)); + break; } } @@ -105,3 +134,25 @@ void eWindowStyleSimple::drawFrame(gPainter &painter, const eRect &frame, int wh painter.line(frame.bottomRight1(), frame.bottomLeft1()); painter.line(frame.bottomLeft1(), frame.topLeft1()); } + +RESULT eWindowStyleSimple::getFont(int what, ePtr &fnt) +{ + fnt = 0; + switch (what) + { + case fontStatic: + fnt = new gFont("Arial", 12); + break; + case fontButton: + fnt = new gFont("Arial", 20); + break; + case fontTitlebar: + fnt = new gFont("Arial", 25); + break; + default: + return -1; + } + return 0; +} + +eAutoInitPtr init_eWindowStyleManager(eAutoInitNumbers::skin, "eWindowStyleManager");