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)
m_color[what] = col;
}
+void eWindowStyleSkinned::setTitleOffset(const eSize &offset)
+{
+ m_title_offset = offset;
+}
+
+void eWindowStyleSkinned::setTitleFont(gFont *fnt)
+{
+ m_fnt = fnt;
+}
+
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
{
gRGB m_color[colMax];
+ eSize m_title_offset;
+ ePtr<gFont> m_fnt;
+
void drawBorder(gPainter &painter, const eRect &size, struct borderSet &border, int where);
};
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"):