X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fgui%2Fewindowstyle.cpp;h=25b89460575b4d61024260e0f5c66331c3afc5a8;hp=8599cfd799c51bb03d0d5cb0b555364af7174cc0;hb=3af66122574386a2856e83ba9c5d73d27a6f3710;hpb=9202d4248dd7df2f6e5eb53b4154c8297ec9b1d1 diff --git a/lib/gui/ewindowstyle.cpp b/lib/gui/ewindowstyle.cpp index 8599cfd..25b8946 100644 --- a/lib/gui/ewindowstyle.cpp +++ b/lib/gui/ewindowstyle.cpp @@ -10,21 +10,21 @@ DEFINE_REF(eWindowStyleSimple); eWindowStyleSimple::eWindowStyleSimple() { - m_border_left = m_border_right = m_border_bottom = 1; + m_border_left = m_border_right = m_border_bottom = 2; m_border_top = 30; m_fnt = new gFont("Arial", 25); - m_border_color_tl = gColor(0x14); - m_border_color_br = gColor(0x1c); + m_border_color_tl = gColor(0x1f); + m_border_color_br = gColor(0x14); m_title_color_back = gColor(0x20); m_title_color = gColor(0x2f); - m_background_color = gColor(0x18); + m_background_color = gColor(0x19); } void eWindowStyleSimple::handleNewSize(eWindow *wnd, const eSize &size) { - eDebug("handle new size: %d x %d", size.width(), size.height()); +// eDebug("handle new size: %d x %d", size.width(), size.height()); eWidget *child = wnd->child(); @@ -36,19 +36,27 @@ void eWindowStyleSimple::handleNewSize(eWindow *wnd, const eSize &size) void eWindowStyleSimple::paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) { + painter.setForegroundColor(m_title_color_back); + painter.fill(eRect(2, 2, wnd->size().width() - 4, m_border_top - 4)); painter.setBackgroundColor(m_title_color_back); painter.setForegroundColor(m_title_color); - painter.clear(); painter.setFont(m_fnt); - painter.renderText(eRect(1, 1, wnd->size().width() - 2, m_border_top - 2), title); + painter.renderText(eRect(3, 3, wnd->size().width() - 6, m_border_top - 6), title); eRect frame(ePoint(0, 0), wnd->size()); - painter.setForegroundColor(m_border_color_tl); + + painter.setForegroundColor(m_background_color); painter.line(frame.topLeft1(), frame.topRight1()); - painter.line(frame.topRight1(), frame.bottomRight1()); + painter.line(frame.topLeft1(), frame.bottomLeft1()); + painter.setForegroundColor(m_border_color_tl); + painter.line(frame.topLeft1()+eSize(1,1), frame.topRight1()+eSize(0,1)); + painter.line(frame.topLeft1()+eSize(1,1), frame.bottomLeft1()+eSize(1,0)); + painter.setForegroundColor(m_border_color_br); - painter.line(frame.bottomRight1(), frame.bottomLeft1()); - painter.line(frame.bottomLeft1(), frame.topLeft1()); + painter.line(frame.bottomLeft()+eSize(1,-1), frame.bottomRight()+eSize(0,-1)); + painter.line(frame.topRight1()+eSize(-1,1), frame.bottomRight1()+eSize(-1, 0)); + painter.line(frame.bottomLeft()+eSize(1,-2), frame.bottomRight()+eSize(0,-2)); + painter.line(frame.topRight1()+eSize(-0,1), frame.bottomRight1()+eSize(-0, 0)); } void eWindowStyleSimple::paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) @@ -57,17 +65,78 @@ void eWindowStyleSimple::paintBackground(gPainter &painter, const ePoint &offset painter.clear(); } -void eWindowStyleSimple::setForegroundStyle(gPainter &painter) +void eWindowStyleSimple::setStyle(gPainter &painter, int what) { - painter.setForegroundColor(gColor(0x1F)); + switch (what) + { + case styleLabel: + painter.setForegroundColor(gColor(0x1F)); + break; + case styleListboxSelected: + painter.setForegroundColor(gColor(0x1F)); + painter.setBackgroundColor(gColor(0x1A)); + break; + case styleListboxNormal: + painter.setForegroundColor(gColor(0x1C)); + painter.setBackgroundColor(m_background_color); + break; + case styleListboxMarked: + painter.setForegroundColor(gColor(0x2F)); + painter.setBackgroundColor(gColor(0x2A)); + break; + } } -void eWindowStyleSimple::drawButtonFrame(gPainter &painter, const eRect &frame) +void eWindowStyleSimple::drawFrame(gPainter &painter, const eRect &frame, int what) { - painter.setForegroundColor(m_border_color_tl); + gColor c1, c2; + switch (what) + { + case frameButton: + c1 = m_border_color_tl; + c2 = m_border_color_br; + break; + case frameListboxEntry: + c1 = m_border_color_br; + c2 = m_border_color_tl; + break; + } + + painter.setForegroundColor(c2); painter.line(frame.topLeft1(), frame.topRight1()); painter.line(frame.topRight1(), frame.bottomRight1()); - painter.setForegroundColor(m_border_color_br); + painter.setForegroundColor(c1); painter.line(frame.bottomRight1(), frame.bottomLeft1()); painter.line(frame.bottomLeft1(), frame.topLeft1()); } + +DEFINE_REF(eWindowStyleSkinned); + +eWindowStyleSkinned::eWindowStyleSkinned() +{ +} + +void eWindowStyleSkinned::handleNewSize(eWindow *wnd, const eSize &size) +{ +} + +void eWindowStyleSkinned::paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) +{ +} + +void eWindowStyleSkinned::paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) +{ +} + +void eWindowStyleSkinned::setStyle(gPainter &painter, int what) +{ +} + +void eWindowStyleSkinned::drawFrame(gPainter &painter, const eRect &frame, int what) +{ +} + +void eWindowStyleSkinned::drawBorder(gPainter &painter, const eSize &size, const struct borderSet &border, int where) +{ +} +