diff --git a/libui/include/ui/Window.h b/libui/include/ui/Window.h index fd914b0a..3e121a8f 100644 --- a/libui/include/ui/Window.h +++ b/libui/include/ui/Window.h @@ -62,7 +62,7 @@ namespace ui int m_id; Canvas m_canvas; Widget* m_main_widget { nullptr }; - Color m_background { ui::BLACK }; + Option m_background {}; Option m_old_mouse_buttons; }; } diff --git a/libui/src/Window.cpp b/libui/src/Window.cpp index fc12467d..298a4499 100644 --- a/libui/src/Window.cpp +++ b/libui/src/Window.cpp @@ -74,7 +74,7 @@ namespace ui Result 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 {};