aboutsummaryrefslogtreecommitdiff
path: root/lib/gui/elistboxcontent.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-01-23 11:57:35 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-01-23 11:57:35 +0000
commit4d39789a6269ba9023b163ffe4a5c1c51fe592fd (patch)
treedbdf26efba71ab47b53abba0edbcd75afe1a1a57 /lib/gui/elistboxcontent.cpp
parent1f0cfd8eb9bbb24864bb2d9010f9c11286e9f845 (diff)
downloadenigma2-4d39789a6269ba9023b163ffe4a5c1c51fe592fd.tar.gz
enigma2-4d39789a6269ba9023b163ffe4a5c1c51fe592fd.zip
listboxcontent: fix alignment on empty label
Diffstat (limited to 'lib/gui/elistboxcontent.cpp')
-rw-r--r--lib/gui/elistboxcontent.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp
index 8b0fe14d..5421f252 100644
--- a/lib/gui/elistboxcontent.cpp
+++ b/lib/gui/elistboxcontent.cpp
@@ -431,6 +431,10 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
painter.renderText(eRect(offset, item_left), string, gPainter::RT_HALIGN_LEFT);
Py_XDECREF(text);
+ /* when we have no label, align value to the left. (FIXME:
+ don't we want to specifiy this individually?) */
+ int value_alignment_left = !*string;
+
/* now, handle the value. get 2nd part from tuple*/
value = PyTuple_GET_ITEM(item, 1);
if (value)
@@ -462,7 +466,7 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
PyObject *pvalue = PyTuple_GET_ITEM(value, 1);
const char *value = (pvalue && PyString_Check(pvalue)) ? PyString_AsString(pvalue) : "<not-a-string>";
painter.setFont(fnt2);
- painter.renderText(eRect(offset + eSize(m_seperation, 0), item_right), value, gPainter::RT_HALIGN_RIGHT);
+ painter.renderText(eRect(offset + eSize(m_seperation, 0), item_right), value, value_alignment_left ? gPainter::RT_HALIGN_LEFT : gPainter::RT_HALIGN_RIGHT);
/* pvalue is borrowed */
} else if (!strcmp(atype, "slider"))
@@ -491,10 +495,7 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
ePtr<eTextPara> para = new eTextPara(eRect(offset + eSize(m_seperation, 0), item_right));
para->setFont(fnt2);
para->renderString(text, 0);
- if (strlen(text) != 0)
- para->realign(eTextPara::dirRight);
- else
- para->realign(eTextPara::dirLeft);
+ para->realign(value_alignment_left ? eTextPara::dirLeft : eTextPara::dirRight);
int glyphs = para->size();
PyObject *plist = 0;