projects
/
vuplus_dvbapp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support Uno4k/Ultimo4k
[vuplus_dvbapp]
/
lib
/
gui
/
elistboxcontent.cpp
diff --git
a/lib/gui/elistboxcontent.cpp
b/lib/gui/elistboxcontent.cpp
index
97e2cc6
..
3dcea7b
100644
(file)
--- a/
lib/gui/elistboxcontent.cpp
+++ b/
lib/gui/elistboxcontent.cpp
@@
-138,7
+138,7
@@
void eListboxPythonStringContent::setSize(const eSize &size)
void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- ePtr<gFont> fnt
= new gFont("Regular", 20)
;
+ ePtr<gFont> fnt;
painter.clip(eRect(offset, m_itemsize));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clip(eRect(offset, m_itemsize));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
@@
-151,6
+151,7
@@
void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style,
if (local_style)
{
if (local_style)
{
+ fnt = local_style->m_font;
if (selected)
{
/* if we have a local background color set, use that. */
if (selected)
{
/* if we have a local background color set, use that. */
@@
-170,6
+171,7
@@
void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style,
painter.setForegroundColor(local_style->m_foreground_color);
}
}
painter.setForegroundColor(local_style->m_foreground_color);
}
}
+ if (!fnt) fnt = new gFont("Regular", 20);
/* if we have no transparent background */
if (!local_style || !local_style->m_transparent_background)
/* if we have no transparent background */
if (!local_style || !local_style->m_transparent_background)
@@
-273,8
+275,8
@@
void eListboxPythonStringContent::invalidate()
void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- ePtr<gFont> fnt
= new gFont("Regular", 20)
;
- ePtr<gFont> fnt2
= new gFont("Regular", 16)
;
+ ePtr<gFont> fnt;
+ ePtr<gFont> fnt2;
eRect itemrect(offset, m_itemsize);
eListboxStyle *local_style = 0;
bool cursorValid = this->cursorValid();
eRect itemrect(offset, m_itemsize);
eListboxStyle *local_style = 0;
bool cursorValid = this->cursorValid();
@@
-288,6
+290,7
@@
void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
if (local_style)
{
if (local_style)
{
+ fnt = local_style->m_font;
if (selected)
{
/* if we have a local background color set, use that. */
if (selected)
{
/* if we have a local background color set, use that. */
@@
-308,6
+311,16
@@
void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
}
}
}
}
+ if (fnt)
+ {
+ fnt2 = new gFont(fnt->family, fnt->pointSize - fnt->pointSize/5);
+ }
+ else
+ {
+ fnt = new gFont("Regular", 20);
+ fnt2 = new gFont("Regular", 16);
+ }
+
if (!local_style || !local_style->m_transparent_background)
/* if we have no transparent background */
{
if (!local_style || !local_style->m_transparent_background)
/* if we have no transparent background */
{
@@
-501,6
+514,7
@@
eListboxPythonMultiContent::~eListboxPythonMultiContent()
{
Py_XDECREF(m_buildFunc);
Py_XDECREF(m_selectableFunc);
{
Py_XDECREF(m_buildFunc);
Py_XDECREF(m_selectableFunc);
+ Py_XDECREF(m_template);
}
void eListboxPythonMultiContent::setSelectionClip(eRect &rect, bool update)
}
void eListboxPythonMultiContent::setSelectionClip(eRect &rect, bool update)
@@
-640,7
+654,8
@@
static ePyObject lookupColor(ePyObject color, ePyObject data)
if ((icolor & 0xFF000000) == 0xFF000000)
{
int index = icolor & 0xFFFFFF;
if ((icolor & 0xFF000000) == 0xFF000000)
{
int index = icolor & 0xFFFFFF;
- eDebug("[eListboxPythonMultiContent] template color index: %d", index);
+ if (PyTuple_GetItem(data, index) == Py_None)
+ return ePyObject();
return PyTuple_GetItem(data, index);
}
return PyTuple_GetItem(data, index);
}
@@
-1158,5
+1173,7
@@
void eListboxPythonMultiContent::entryRemoved(int idx)
void eListboxPythonMultiContent::setTemplate(ePyObject tmplate)
{
void eListboxPythonMultiContent::setTemplate(ePyObject tmplate)
{
+ Py_XDECREF(m_template);
m_template = tmplate;
m_template = tmplate;
+ Py_XINCREF(m_template);
}
}