mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[escher/layout_field] Reset the scroll when clearing the layout
Scenario: Go to the graph app, create f(x) = 1 then create g(x) -> there is a weird big margin in the edition field
This commit is contained in:
committed by
EmilieNumworks
parent
73c55f0437
commit
016f87c266
@@ -26,7 +26,7 @@ public:
|
||||
Poincare::Context * context() const;
|
||||
bool isEditing() const override { return m_contentView.isEditing(); }
|
||||
void setEditing(bool isEditing) override;
|
||||
void clearLayout() { m_contentView.clearLayout(); }
|
||||
void clearLayout();
|
||||
void scrollToCursor() {
|
||||
scrollToBaselinedRect(m_contentView.cursorRect(), m_contentView.cursor()->baselineWithoutSelection());
|
||||
}
|
||||
|
||||
@@ -294,6 +294,11 @@ void LayoutField::setEditing(bool isEditing) {
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutField::clearLayout() {
|
||||
m_contentView.clearLayout(); // Replace the layout with an empty horizontal layout
|
||||
reloadScroll(); // Put the scroll to offset 0
|
||||
}
|
||||
|
||||
Context * LayoutField::context() const {
|
||||
return (m_delegate != nullptr) ? m_delegate->context() : nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user