mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:47:47 +00:00
HackStudio: Add statusbar with file and selected text information
This commit is contained in:
parent
e22a34badb
commit
2634cab7a8
8 changed files with 50 additions and 9 deletions
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue