mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher/layout_field] Fix EmptyLayout disappearance
Scenario :
In the calculation app, write 1, press Enter.
•|
Write ---
2
Then go up. The empty layout on top of the fraction disappears.
This commit is contained in:
@@ -156,18 +156,20 @@ bool LayoutField::handleEvent(Ion::Events::Event event) {
|
||||
shouldRecomputeLayout = true;
|
||||
didHandleEvent = true;
|
||||
}
|
||||
if (didHandleEvent) {
|
||||
shouldRecomputeLayout = m_contentView.cursor()->hideEmptyLayoutIfNeeded() || shouldRecomputeLayout;
|
||||
if (!shouldRecomputeLayout) {
|
||||
m_contentView.cursorPositionChanged();
|
||||
scrollToCursor();
|
||||
} else {
|
||||
reload(previousSize);
|
||||
}
|
||||
return true;
|
||||
/* Hide empty layout only if the layout is being edited, otherwise the cursor
|
||||
* is not visible so any empty layout should be visible. */
|
||||
bool didHideLayouts = isEditing() && m_contentView.cursor()->hideEmptyLayoutIfNeeded();
|
||||
if (!didHandleEvent) {
|
||||
return false;
|
||||
}
|
||||
m_contentView.cursor()->hideEmptyLayoutIfNeeded();
|
||||
return false;
|
||||
shouldRecomputeLayout = didHideLayouts || shouldRecomputeLayout;
|
||||
if (!shouldRecomputeLayout) {
|
||||
m_contentView.cursorPositionChanged();
|
||||
scrollToCursor();
|
||||
} else {
|
||||
reload(previousSize);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LayoutField::privateHandleEvent(Ion::Events::Event event) {
|
||||
|
||||
Reference in New Issue
Block a user