libui: Allow not filling the window with a background color every time
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
18e3265d14
commit
24679e06dd
@ -62,7 +62,7 @@ namespace ui
|
|||||||
int m_id;
|
int m_id;
|
||||||
Canvas m_canvas;
|
Canvas m_canvas;
|
||||||
Widget* m_main_widget { nullptr };
|
Widget* m_main_widget { nullptr };
|
||||||
Color m_background { ui::BLACK };
|
Option<Color> m_background {};
|
||||||
Option<int> m_old_mouse_buttons;
|
Option<int> m_old_mouse_buttons;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ namespace ui
|
|||||||
|
|
||||||
Result<void> Window::draw()
|
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));
|
if (m_main_widget) TRY(m_main_widget->draw(m_canvas));
|
||||||
update();
|
update();
|
||||||
return {};
|
return {};
|
||||||
|
Loading…
Reference in New Issue
Block a user