mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:47:47 +00:00
HexEditor: Scroll back to the top when opening another file
When a file is opened and scrolled to some position and the user opens another file, the current scroll position stays the same. That's disorienting. Therefore, when opening another file, scroll back to the top.
This commit is contained in:
parent
fd66dda1d7
commit
af754211fa
1 changed files with 6 additions and 0 deletions
|
@ -68,6 +68,9 @@ bool HexEditor::open_new_file(size_t size)
|
|||
set_content_length(m_document->size());
|
||||
m_position = 0;
|
||||
m_cursor_at_low_nibble = false;
|
||||
m_selection_start = 0;
|
||||
m_selection_end = 0;
|
||||
scroll_position_into_view(m_position);
|
||||
update();
|
||||
update_status();
|
||||
|
||||
|
@ -80,6 +83,9 @@ void HexEditor::open_file(NonnullRefPtr<Core::File> file)
|
|||
set_content_length(m_document->size());
|
||||
m_position = 0;
|
||||
m_cursor_at_low_nibble = false;
|
||||
m_selection_start = 0;
|
||||
m_selection_end = 0;
|
||||
scroll_position_into_view(m_position);
|
||||
update();
|
||||
update_status();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue