mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
Syncing the code for discussing it.
This commit is contained in:
@@ -157,7 +157,7 @@ textChangedObserver(void *observerData, WMNotification *notification)
|
||||
|
||||
WMInsertTextFieldText(panel->fileField, &item->text[textLen],
|
||||
textLen);
|
||||
WMSetTextFieldCursorPosition(panel->fileField, itemTextLen);
|
||||
/*WMSetTextFieldCursorPosition(panel->fileField, itemTextLen);*/
|
||||
range.position = textLen;
|
||||
range.count = itemTextLen - textLen;
|
||||
WMSelectTextFieldRange(panel->fileField, range);
|
||||
|
||||
@@ -550,6 +550,8 @@ WMSelectTextFieldRange(WMTextField *tPtr, WMRange range)
|
||||
|
||||
tPtr->selection = range;
|
||||
|
||||
tPtr->cursorPosition = range.position + range.count;
|
||||
|
||||
if (tPtr->view->flags.realized) {
|
||||
paintTextField(tPtr);
|
||||
}
|
||||
@@ -1176,9 +1178,15 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
|
||||
normal_key:
|
||||
default:
|
||||
if (count > 0 && !iscntrl(buffer[0])) {
|
||||
if (tPtr->selection.count)
|
||||
if (tPtr->selection.count) {
|
||||
WMDeleteTextFieldRange(tPtr, tPtr->selection);
|
||||
tPtr->selection.count = 0;
|
||||
refresh = 1;
|
||||
}
|
||||
/* TODO: check if this is correct. */
|
||||
cancelSelection = 0;
|
||||
WMInsertTextFieldText(tPtr, buffer, tPtr->cursorPosition);
|
||||
tPtr->selection.position = tPtr->cursorPosition;
|
||||
NOTIFY(tPtr, didChange, WMTextDidChangeNotification,
|
||||
(void*)WMInsertTextEvent);
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user