diff options
author | fvogel <fvogelnew1@free.fr> | 2018-09-07 20:03:42 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2018-09-07 20:03:42 (GMT) |
commit | aed211d47d3712759a3c49aad49210b0935b8fc6 (patch) | |
tree | 34559b0b837f9287f9b3ac85324204bada83ce83 /generic/ttk | |
parent | 719b08aa89350bc93dea8fac0e46fa6f7f088617 (diff) | |
download | tk-aed211d47d3712759a3c49aad49210b0935b8fc6.zip tk-aed211d47d3712759a3c49aad49210b0935b8fc6.tar.gz tk-aed211d47d3712759a3c49aad49210b0935b8fc6.tar.bz2 |
Better version of the patch, again by Csaba Nemethi
Diffstat (limited to 'generic/ttk')
-rw-r--r-- | generic/ttk/ttkEntry.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index f476dc9..05d861d 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1244,7 +1244,8 @@ static void EntryDisplay(void *clientData, Drawable d) /* Draw cursor: */ if (showCursor) { - int cursorX = EntryCharPosition(entryPtr, entryPtr->entry.insertPos), + Ttk_Box field = Ttk_ClientRegion(entryPtr->core.layout, "field"); + int cursorX = EntryCharPosition(entryPtr, entryPtr->entry.insertPos), cursorY = entryPtr->entry.layoutY, cursorHeight = entryPtr->entry.layoutHeight, cursorWidth = 1; @@ -1258,13 +1259,13 @@ static void EntryDisplay(void *clientData, Drawable d) Tk_SetCaretPos(tkwin, cursorX, cursorY, cursorHeight); cursorX -= cursorWidth/2; - if (cursorX < textarea.x) { - cursorX = textarea.x; - } else if (cursorX + cursorWidth > textarea.x + textarea.width) { - cursorX = textarea.x + textarea.width - cursorWidth; + if (cursorX < field.x) { + cursorX = field.x; + } else if (cursorX + cursorWidth > field.x + field.width) { + cursorX = field.x + field.width - cursorWidth; } - gc = EntryGetGC(entryPtr, es.insertColorObj, clipRegion); + gc = EntryGetGC(entryPtr, es.insertColorObj, None); XFillRectangle(Tk_Display(tkwin), d, gc, cursorX, cursorY, cursorWidth, cursorHeight); XSetClipMask(Tk_Display(tkwin), gc, None); |