aboutsummaryrefslogtreecommitdiff
path: root/lib/gui
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2007-11-28 13:07:43 +0000
committerFelix Domke <tmbinc@elitedvb.net>2007-11-28 13:07:43 +0000
commit76ab06c06bdf77f0b0cecd225367862ef0de0d2f (patch)
tree5a0c44fbda7cd123261afb39549ef89740a317a5 /lib/gui
parent5de16a03d348df3a90dd0c768e0d7fa3d7a82fc1 (diff)
downloadenigma2-76ab06c06bdf77f0b0cecd225367862ef0de0d2f.tar.gz
enigma2-76ab06c06bdf77f0b0cecd225367862ef0de0d2f.zip
improve text editing. Patch by Anders Holst
Diffstat (limited to 'lib/gui')
-rw-r--r--lib/gui/elabel.cpp15
-rw-r--r--lib/gui/elistboxcontent.cpp18
2 files changed, 28 insertions, 5 deletions
diff --git a/lib/gui/elabel.cpp b/lib/gui/elabel.cpp
index 6e53c851..87ad5133 100644
--- a/lib/gui/elabel.cpp
+++ b/lib/gui/elabel.cpp
@@ -51,7 +51,20 @@ int eLabel::event(int event, void *data, void *data2)
int glyphs = para->size();
- if ((m_pos < 0) || (m_pos >= glyphs))
+ if (m_pos == -2) { /* All glyphs inverted */
+ eRect bbox;
+ int left = 0, right = 0;
+ for (int i=0; i<glyphs; i++)
+ para->setGlyphFlag(i, GS_INVERT);
+ if (glyphs > 0) {
+ bbox = para->getGlyphBBox(0);
+ left = bbox.left();
+ bbox = para->getGlyphBBox(glyphs-1);
+ right = bbox.left() + bbox.width();
+ }
+ bbox = eRect(left, 0, right-left, size().height());
+ painter.fill(bbox);
+ } else if ((m_pos < 0) || (m_pos >= glyphs))
eWarning("glyph index %d in eLabel out of bounds!", m_pos);
else
{
diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp
index 191bc7e1..585d6fec 100644
--- a/lib/gui/elistboxcontent.cpp
+++ b/lib/gui/elistboxcontent.cpp
@@ -431,6 +431,8 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
if (plist && PyList_Check(plist))
entries = PyList_Size(plist);
+ int left=0, right=0, last=-1;
+ eRect bbox;
for (int i = 0; i < entries; ++i)
{
ePyObject entry = PyList_GET_ITEM(plist, i);
@@ -440,15 +442,23 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
eWarning("glyph index %d in PythonConfigList out of bounds!", num);
else
{
+ if (last+1 != num && last != -1) {
+ bbox = eRect(left, offset.y(), right-left, m_itemsize.height());
+ painter.fill(bbox);
+ }
para->setGlyphFlag(num, GS_INVERT);
- eRect bbox;
bbox = para->getGlyphBBox(num);
- bbox = eRect(bbox.left(), offset.y(), bbox.width(), m_itemsize.height());
- painter.fill(bbox);
+ if (last+1 != num || last == -1)
+ left = bbox.left();
+ right = bbox.left() + bbox.width();
+ last = num;
}
/* entry is borrowed */
}
-
+ if (last != -1) {
+ bbox = eRect(left, offset.y(), right-left, m_itemsize.height());
+ painter.fill(bbox);
+ }
painter.renderPara(para, ePoint(0, 0));
/* pvalue is borrowed */
/* plist is 0 or borrowed */