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 positioner plugin (just basic gui atm)
[enigma2.git]
/
lib
/
gui
/
elistboxcontent.cpp
diff --git
a/lib/gui/elistboxcontent.cpp
b/lib/gui/elistboxcontent.cpp
index ff93eac2191e93c550786e429a4792655dcb30d4..f5ae2b3837d3507d8b2239f4bd27e7fb42c8f4fa 100644
(file)
--- a/
lib/gui/elistboxcontent.cpp
+++ b/
lib/gui/elistboxcontent.cpp
@@
-374,10
+374,11
@@
void eListboxPythonStringContent::setList(PyObject *list)
PyObject *eListboxPythonStringContent::getCurrentSelection()
{
PyObject *eListboxPythonStringContent::getCurrentSelection()
{
- if (!m_list)
- return 0;
- if (!cursorValid())
- return 0;
+ if (!(m_list && cursorValid()))
+ {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
PyObject *r = PyList_GET_ITEM(m_list, m_cursor);
Py_XINCREF(r);
return r;
PyObject *r = PyList_GET_ITEM(m_list, m_cursor);
Py_XINCREF(r);
return r;
@@
-475,12
+476,14
@@
void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
} else if (!strcmp(atype, "slider"))
{
PyObject *pvalue = PyTuple_GET_ITEM(value, 1);
} else if (!strcmp(atype, "slider"))
{
PyObject *pvalue = PyTuple_GET_ITEM(value, 1);
+ PyObject *psize = PyTuple_GET_ITEM(value, 2);
/* convert value to Long. fallback to -1 on error. */
int value = (pvalue && PyInt_Check(pvalue)) ? PyInt_AsLong(pvalue) : -1;
/* convert value to Long. fallback to -1 on error. */
int value = (pvalue && PyInt_Check(pvalue)) ? PyInt_AsLong(pvalue) : -1;
+ int size = (pvalue && PyInt_Check(psize)) ? PyInt_AsLong(psize) : 100;
/* calc. slider length */
/* calc. slider length */
- int width = item_right.width() * value /
100
;
+ int width = item_right.width() * value /
size
;
int height = item_right.height();
int height = item_right.height();