aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-11-15 04:20:11 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-11-15 04:20:11 +0000
commited5ecff4f6aaccb0b3bfaeedd9ee1714ff054b1e (patch)
treef7866987a7c33b6676a2339fcdbcedea1aae0e9c
parent1c76ad3b38e3dc87b32fe3ed1016c5ef54df776b (diff)
downloadenigma2-ed5ecff4f6aaccb0b3bfaeedd9ee1714ff054b1e.tar.gz
enigma2-ed5ecff4f6aaccb0b3bfaeedd9ee1714ff054b1e.zip
add window titles
-rw-r--r--lib/gui/ewindowstyleskinned.cpp18
-rw-r--r--lib/gui/ewindowstyleskinned.h9
-rw-r--r--skin.py3
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);
};
diff --git a/skin.py b/skin.py
index 5744855c..f31d637b 100644
--- a/skin.py
+++ b/skin.py
@@ -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"):