libui: Allow not filling the window with a background color every time
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
apio 2023-09-16 13:29:42 +02:00
parent 18e3265d14
commit 24679e06dd
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ namespace ui
int m_id;
Canvas m_canvas;
Widget* m_main_widget { nullptr };
Color m_background { ui::BLACK };
Option<Color> m_background {};
Option<int> m_old_mouse_buttons;
};
}

View File

@ -74,7 +74,7 @@ namespace ui
Result<void> Window::draw()
{
m_canvas.fill(m_background);
if (m_background.has_value()) m_canvas.fill(*m_background);
if (m_main_widget) TRY(m_main_widget->draw(m_canvas));
update();
return {};