mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Revert "[eshcer/layout_field] Factor handleEvent"
This reverts commit d1ebbc685d67702994aa3ef822886a681cee63b9. There were problems in the calculation app for instance: - Write 34 then press ans -> the cursor is not drawn right of ans, but left. - Write a large layout, go up in th history, then go back to edition: the view is not scrolled to the cursor
This commit is contained in:
@@ -301,6 +301,8 @@ void LayoutField::reload(KDSize previousSize) {
|
||||
if (m_delegate && previousSize.height() != newSize.height()) {
|
||||
m_delegate->layoutFieldDidChangeSize(this);
|
||||
}
|
||||
m_contentView.cursorPositionChanged();
|
||||
scrollToCursor();
|
||||
markRectAsDirty(bounds());
|
||||
}
|
||||
|
||||
@@ -401,11 +403,12 @@ bool LayoutField::handleEvent(Ion::Events::Event event) {
|
||||
return false;
|
||||
}
|
||||
shouldRecomputeLayout = didHideLayouts || shouldRecomputeLayout;
|
||||
if (shouldRecomputeLayout) {
|
||||
if (!shouldRecomputeLayout) {
|
||||
m_contentView.cursorPositionChanged();
|
||||
scrollToCursor();
|
||||
} else {
|
||||
reload(previousSize);
|
||||
}
|
||||
m_contentView.cursorPositionChanged();
|
||||
scrollToCursor();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user