mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[escher] LayoutField: reset selection when the field should finish
editing This fixes the following bug: in solver, input Matrix(Matrix()) and select the inner Matrix. When handling "OK" event, the "=0" is inserted at a wrong position leading to a crash !
This commit is contained in:
@@ -41,9 +41,7 @@ public:
|
||||
/* Responder */
|
||||
bool handleEventWithText(const char * text, bool indentation = false, bool forceCursorRightOfText = false) override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
bool shouldFinishEditing(Ion::Events::Event event) override { // TODO REMOVE ?
|
||||
return m_delegate->layoutFieldShouldFinishEditing(this, event);
|
||||
}
|
||||
bool shouldFinishEditing(Ion::Events::Event event) override; // TODO REMOVE ?
|
||||
|
||||
// Selection
|
||||
bool resetSelection() { return m_contentView.resetSelection(); }
|
||||
|
||||
@@ -369,6 +369,14 @@ bool LayoutField::handleEventWithText(const char * text, bool indentation, bool
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LayoutField::shouldFinishEditing(Ion::Events::Event event) {
|
||||
if (m_delegate->layoutFieldShouldFinishEditing(this, event)) {
|
||||
resetSelection();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LayoutField::handleEvent(Ion::Events::Event event) {
|
||||
bool didHandleEvent = false;
|
||||
KDSize previousSize = minimalSizeForOptimalDisplay();
|
||||
|
||||
Reference in New Issue
Block a user