diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2007-11-28 13:07:43 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2007-11-28 13:07:43 +0000 |
| commit | 76ab06c06bdf77f0b0cecd225367862ef0de0d2f (patch) | |
| tree | 5a0c44fbda7cd123261afb39549ef89740a317a5 /lib/gui/elabel.cpp | |
| parent | 5de16a03d348df3a90dd0c768e0d7fa3d7a82fc1 (diff) | |
| download | enigma2-76ab06c06bdf77f0b0cecd225367862ef0de0d2f.tar.gz enigma2-76ab06c06bdf77f0b0cecd225367862ef0de0d2f.zip | |
improve text editing. Patch by Anders Holst
Diffstat (limited to 'lib/gui/elabel.cpp')
| -rw-r--r-- | lib/gui/elabel.cpp | 15 |
1 files changed, 14 insertions, 1 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 { |
