git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add possibility to set backgroundcolor for multicontent text entries too
[enigma2.git]
/
lib
/
gui
/
elistboxcontent.cpp
diff --git
a/lib/gui/elistboxcontent.cpp
b/lib/gui/elistboxcontent.cpp
index d4d8f609b79d87cf09c70a32fbf88dcd11a46e66..cba25a181f85b9df8e067b0b8609570b733bb01c 100644
(file)
--- a/
lib/gui/elistboxcontent.cpp
+++ b/
lib/gui/elistboxcontent.cpp
@@
-479,7
+479,7
@@
void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
goto error_out;
}
goto error_out;
}
- ePyObject px, py, pwidth, pheight, pfnt, pstring, pflags, pcolor, p
fillColor
, pborderWidth, pborderColor;
+ ePyObject px, py, pwidth, pheight, pfnt, pstring, pflags, pcolor, p
backColor, pbackColorSelected
, pborderWidth, pborderColor;
/*
we have a list of tuples:
/*
we have a list of tuples:
@@
-531,14
+531,20
@@
void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
}
if (size > 9)
{
}
if (size > 9)
{
- p
fill
Color = PyTuple_GET_ITEM(item, 9);
- if (p
fill
Color == Py_None)
- p
fill
Color=ePyObject();
+ p
back
Color = PyTuple_GET_ITEM(item, 9);
+ if (p
back
Color == Py_None)
+ p
back
Color=ePyObject();
}
if (size > 10)
}
if (size > 10)
- pborderWidth = PyTuple_GET_ITEM(item, 10);
+ {
+ pbackColorSelected = PyTuple_GET_ITEM(item, 10);
+ if (pbackColorSelected == Py_None)
+ pbackColorSelected=ePyObject();
+ }
if (size > 11)
if (size > 11)
- pborderColor = PyTuple_GET_ITEM(item, 11);
+ pborderWidth = PyTuple_GET_ITEM(item, 11);
+ if (size > 12)
+ pborderColor = PyTuple_GET_ITEM(item, 12);
}
switch (type)
}
switch (type)
@@
-577,9
+583,15
@@
void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
rc &= itemrect;
painter.clip(rc);
rc &= itemrect;
painter.clip(rc);
- if (pfillColor && !selected)
+ if (pbackColor && !selected)
+ {
+ int color = PyInt_AsLong(pbackColor);
+ painter.setBackgroundColor(gRGB(color));
+ painter.clear();
+ }
+ else if (pbackColorSelected && selected)
{
{
- int color = PyInt_AsLong(p
fillColor
);
+ int color = PyInt_AsLong(p
backColorSelected
);
painter.setBackgroundColor(gRGB(color));
painter.clear();
}
painter.setBackgroundColor(gRGB(color));
painter.clear();
}
@@
-600,7
+612,7
@@
void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
int color = PyInt_AsLong(pborderColor);
painter.setForegroundColor(gRGB(color));
}
int color = PyInt_AsLong(pborderColor);
painter.setForegroundColor(gRGB(color));
}
- else if (pcolor)
+ else if (pcolor)
// reset to normal color
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
rc.setRect(x, y, width, bwidth);
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
rc.setRect(x, y, width, bwidth);
@@
-704,7
+716,7
@@
void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
goto error_out;
}
goto error_out;
}
- if (pcolor || pborderColor || p
fillColor
)
+ if (pcolor || pborderColor || p
backColor || pbackColorSelected
)
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
}
}
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
}
}