terminal: Use widget->window() instead of the App's main window

This commit is contained in:
apio 2024-03-29 20:17:51 +01:00 committed by apio
parent 8b3755873b
commit 6ded7247e0

View File

@ -40,7 +40,7 @@ Result<void> TerminalWidget::init(char* const* args)
m_font = ui::Font::default_font();
m_bold_font = ui::Font::default_bold_font();
m_terminal_canvas = ui::App::the().main_window()->canvas();
m_terminal_canvas = window()->canvas();
m_terminal_canvas.fill(ui::BLACK);
m_cursor_timer = TRY(os::Timer::create_repeating(500, [this]() { this->tick_cursor(); }));
@ -102,7 +102,7 @@ Result<void> TerminalWidget::process()
if (did_draw) drawn++;
}
if (drawn > 0) ui::App::the().main_window()->draw();
if (drawn > 0) window()->draw();
return {};
}
@ -117,7 +117,7 @@ void TerminalWidget::tick_cursor()
else
erase_current_char();
ui::App::the().main_window()->draw();
window()->draw();
}
void TerminalWidget::draw_glyph(wchar_t c, int x, int y)