WindowServer+LibGUI+Taskbar: Store window progress as Optional<int>

We were previously using the magical constant -1 to signify that a
window had no progress state. Be more explicit an use an Optional. :^)
This commit is contained in:
Andreas Kling 2021-05-02 10:42:25 +02:00
commit cc6db526a6
Notes: sideshowbarker 2024-07-18 18:47:29 +09:00
9 changed files with 20 additions and 21 deletions

View file

@ -1021,7 +1021,7 @@ void Window::did_remove_widget(Badge<Widget>, Widget& widget)
m_automatic_cursor_tracking_widget = nullptr;
}
void Window::set_progress(int progress)
void Window::set_progress(Optional<int> progress)
{
VERIFY(m_window_id);
WindowServerConnection::the().post_message(Messages::WindowServer::SetWindowProgress(m_window_id, progress));