diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-11-15 04:20:11 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-11-15 04:20:11 +0000 |
| commit | ed5ecff4f6aaccb0b3bfaeedd9ee1714ff054b1e (patch) | |
| tree | f7866987a7c33b6676a2339fcdbcedea1aae0e9c | |
| parent | 1c76ad3b38e3dc87b32fe3ed1016c5ef54df776b (diff) | |
| download | enigma2-ed5ecff4f6aaccb0b3bfaeedd9ee1714ff054b1e.tar.gz enigma2-ed5ecff4f6aaccb0b3bfaeedd9ee1714ff054b1e.zip | |
add window titles
| -rw-r--r-- | lib/gui/ewindowstyleskinned.cpp | 18 | ||||
| -rw-r--r-- | lib/gui/ewindowstyleskinned.h | 9 | ||||
| -rw-r--r-- | skin.py | 3 |
3 files changed, 30 insertions, 0 deletions
diff --git a/lib/gui/ewindowstyleskinned.cpp b/lib/gui/ewindowstyleskinned.cpp index 55092e1d..20d508f6 100644 --- a/lib/gui/ewindowstyleskinned.cpp +++ b/lib/gui/ewindowstyleskinned.cpp @@ -35,6 +35,14 @@ void eWindowStyleSkinned::handleNewSize(eWindow *wnd, eSize &size, eSize &offset void eWindowStyleSkinned::paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) { drawBorder(painter, eRect(ePoint(0, 0), wnd->size()), m_border[bsWindow], bpAll); + + if (m_fnt) + { + painter.setBackgroundColor(m_color[colWindowTitleBackground]); + painter.setForegroundColor(m_color[colWindowTitleForeground]); + painter.setFont(m_fnt); + painter.renderText(eRect(m_title_offset.width(), m_title_offset.height(), wnd->size().width() - m_title_offset.width(), m_border[bsWindow].m_border_top - m_title_offset.height()), title); + } } void eWindowStyleSkinned::paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) @@ -248,3 +256,13 @@ void eWindowStyleSkinned::setColor(int what, const gRGB &col) m_color[what] = col; } +void eWindowStyleSkinned::setTitleOffset(const eSize &offset) +{ + m_title_offset = offset; +} + +void eWindowStyleSkinned::setTitleFont(gFont *fnt) +{ + m_fnt = fnt; +} + diff --git a/lib/gui/ewindowstyleskinned.h b/lib/gui/ewindowstyleskinned.h index bc9c0549..17988f65 100644 --- a/lib/gui/ewindowstyleskinned.h +++ b/lib/gui/ewindowstyleskinned.h @@ -61,11 +61,17 @@ public: colListboxSelectedForeground, colListboxMarkedBackground, colListboxMarkedForeground, + + colWindowTitleForeground, + colWindowTitleBackground, colMax }; void setColor(int what, const gRGB &back); + void setTitleOffset(const eSize &offset); + void setTitleFont(gFont *fnt); + private: struct borderSet { @@ -77,6 +83,9 @@ private: gRGB m_color[colMax]; + eSize m_title_offset; + ePtr<gFont> m_fnt; + void drawBorder(gPainter &painter, const eRect &size, struct borderSet &border, int where); }; @@ -154,6 +154,9 @@ def loadSkin(desktop): for windowstyle in elementsWithTag(skin.childNodes, "windowstyle"): style = eWindowStyleSkinned() + style.setTitleFont(gFont("Arial", 13)); + style.setTitleOffset(eSize(3, 3)); + for borderset in elementsWithTag(windowstyle.childNodes, "borderset"): bsName = str(borderset.getAttribute("name")) for pixmap in elementsWithTag(borderset.childNodes, "pixmap"): |
