1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:17:35 +00:00

HackStudio: Add statusbar with file and selected text information

This commit is contained in:
ry-sev 2021-07-01 20:39:17 -04:00 committed by Gunnar Beutner
parent e22a34badb
commit 2634cab7a8
8 changed files with 50 additions and 9 deletions

View file

@ -31,18 +31,10 @@ EditorWrapper::EditorWrapper()
m_filename_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
m_filename_label->set_fixed_height(14);
m_cursor_label = label_wrapper.add<GUI::Label>("(Cursor)");
m_cursor_label->set_text_alignment(Gfx::TextAlignment::CenterRight);
m_cursor_label->set_fixed_height(14);
m_editor = add<Editor>();
m_editor->set_ruler_visible(true);
m_editor->set_automatic_indentation_enabled(true);
m_editor->on_cursor_change = [this] {
m_cursor_label->set_text(String::formatted("Line: {}, Column: {}", m_editor->cursor().line() + 1, m_editor->cursor().column()));
};
m_editor->on_focus = [this] {
set_current_editor_wrapper(this);
};