1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 17:15:08 +00:00

LibGUI: Convert GStatusBar to ObjectPtr

This commit is contained in:
Andreas Kling 2019-09-21 16:29:47 +02:00
parent f4531c976c
commit 3476a63415
5 changed files with 12 additions and 8 deletions

View file

@ -108,12 +108,12 @@ TextEditorWidget::TextEditorWidget()
m_editor->add_custom_context_menu_action(*m_find_next_action);
m_editor->add_custom_context_menu_action(*m_find_previous_action);
auto* statusbar = new GStatusBar(this);
m_statusbar = GStatusBar::construct(this);
m_editor->on_cursor_change = [statusbar, this] {
m_editor->on_cursor_change = [this] {
StringBuilder builder;
builder.appendf("Line: %d, Column: %d", m_editor->cursor().line() + 1, m_editor->cursor().column());
statusbar->set_text(builder.to_string());
m_statusbar->set_text(builder.to_string());
};
m_new_action = GAction::create("New", { Mod_Ctrl, Key_N }, GraphicsBitmap::load_from_file("/res/icons/16x16/new.png"), [this](const GAction&) {