Edwin Leuven wrote: > Abdelrazak Younes wrote: >> Edwin Leuven wrote: >>> Abdelrazak Younes wrote: >>> i think that the positioning of the cursor is nicer with the attached >>> (moves it 2 pixels to the right...) >> >> Yep. I hesitated to do that but I think you're right for an immediate >> solution. In principle the BufferView (via Cursor) should provide the >> correct positioning. It should not be up to the frontend to do this. > > i had a look at the cursor code but, as with a lot of core stuff, found > it pretty unintelligible. > > if someone knows how to do this, please do. > > i'll add a FIXME in the meantime... > >
What about this patch? -- Peter Kümmel
Index: frontends/qt4/GuiWorkArea.C =================================================================== --- frontends/qt4/GuiWorkArea.C (revision 15554) +++ frontends/qt4/GuiWorkArea.C (working copy) @@ -599,10 +599,7 @@ void GuiWorkArea::showCursor(int x, int y, int h, CursorShape shape) { - // FIXME: the BufferView (via Cursor) should provide the correct positioning - // for the moment we put the cursor 2 pixels to the right - //cursor_->setGeometry(x, y, 2, h); - cursor_->setGeometry(x + 2, y, 2, h); + cursor_->setGeometry(x, y, 2, h); cursor_->shape_ = shape; cursor_->on_ = true; cursor_->show(); Index: bufferview_funcs.C =================================================================== --- bufferview_funcs.C (revision 15554) +++ bufferview_funcs.C (working copy) @@ -195,9 +195,9 @@ y += par.rows()[rit].height(); y += par.rows()[rend].ascent(); x += dit.bottom().text()->cursorX(dit.bottom(), boundary && dit.depth() == 1); - // The following correction should not be there at all. - // The cursor looks much better with the -1, though. - --x; + // FIXME: The following correction should not be there at all. + // The cursor looks much better with the +1, though. + ++x; return Point(x, y); }