libui: Allow not filling the window with a background color every time
This commit is contained in:
parent
7f23931028
commit
7631b81681
@ -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;
|
||||
};
|
||||
}
|
||||
|
@ -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 {};
|
||||
|
Loading…
Reference in New Issue
Block a user