terminal: Use widget->window() instead of the App's main window
This commit is contained in:
parent
8db14d8883
commit
6c8a4ad995
@ -40,7 +40,7 @@ Result<void> TerminalWidget::init(char* const* args)
|
|||||||
m_font = ui::Font::default_font();
|
m_font = ui::Font::default_font();
|
||||||
m_bold_font = ui::Font::default_bold_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_terminal_canvas.fill(ui::BLACK);
|
||||||
|
|
||||||
m_cursor_timer = TRY(os::Timer::create_repeating(500, [this]() { this->tick_cursor(); }));
|
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 (did_draw) drawn++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drawn > 0) ui::App::the().main_window()->draw();
|
if (drawn > 0) window()->draw();
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@ void TerminalWidget::tick_cursor()
|
|||||||
else
|
else
|
||||||
erase_current_char();
|
erase_current_char();
|
||||||
|
|
||||||
ui::App::the().main_window()->draw();
|
window()->draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerminalWidget::draw_glyph(wchar_t c, int x, int y)
|
void TerminalWidget::draw_glyph(wchar_t c, int x, int y)
|
||||||
|
Loading…
Reference in New Issue
Block a user