mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +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],
|
WMInsertTextFieldText(panel->fileField, &item->text[textLen],
|
||||||
textLen);
|
textLen);
|
||||||
WMSetTextFieldCursorPosition(panel->fileField, itemTextLen);
|
/*WMSetTextFieldCursorPosition(panel->fileField, itemTextLen);*/
|
||||||
range.position = textLen;
|
range.position = textLen;
|
||||||
range.count = itemTextLen - textLen;
|
range.count = itemTextLen - textLen;
|
||||||
WMSelectTextFieldRange(panel->fileField, range);
|
WMSelectTextFieldRange(panel->fileField, range);
|
||||||
|
|||||||
@@ -550,6 +550,8 @@ WMSelectTextFieldRange(WMTextField *tPtr, WMRange range)
|
|||||||
|
|
||||||
tPtr->selection = range;
|
tPtr->selection = range;
|
||||||
|
|
||||||
|
tPtr->cursorPosition = range.position + range.count;
|
||||||
|
|
||||||
if (tPtr->view->flags.realized) {
|
if (tPtr->view->flags.realized) {
|
||||||
paintTextField(tPtr);
|
paintTextField(tPtr);
|
||||||
}
|
}
|
||||||
@@ -1176,9 +1178,15 @@ handleTextFieldKeyPress(TextField *tPtr, XEvent *event)
|
|||||||
normal_key:
|
normal_key:
|
||||||
default:
|
default:
|
||||||
if (count > 0 && !iscntrl(buffer[0])) {
|
if (count > 0 && !iscntrl(buffer[0])) {
|
||||||
if (tPtr->selection.count)
|
if (tPtr->selection.count) {
|
||||||
WMDeleteTextFieldRange(tPtr, tPtr->selection);
|
WMDeleteTextFieldRange(tPtr, tPtr->selection);
|
||||||
|
tPtr->selection.count = 0;
|
||||||
|
refresh = 1;
|
||||||
|
}
|
||||||
|
/* TODO: check if this is correct. */
|
||||||
|
cancelSelection = 0;
|
||||||
WMInsertTextFieldText(tPtr, buffer, tPtr->cursorPosition);
|
WMInsertTextFieldText(tPtr, buffer, tPtr->cursorPosition);
|
||||||
|
tPtr->selection.position = tPtr->cursorPosition;
|
||||||
NOTIFY(tPtr, didChange, WMTextDidChangeNotification,
|
NOTIFY(tPtr, didChange, WMTextDidChangeNotification,
|
||||||
(void*)WMInsertTextEvent);
|
(void*)WMInsertTextEvent);
|
||||||
} else
|
} else
|
||||||
|
|||||||
Reference in New Issue
Block a user