1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-17 17:52:24 +00:00

WindowServer: Flash modal window when clicking on window blocked by it

This makes window modality a bit more discoverable by indicating to the
user that the modal window must be closed before mouse interaction is
possible in the clicked window.
This commit is contained in:
Andreas Kling 2021-01-01 01:10:53 +01:00
parent 2e8db6560f
commit af7800d947
3 changed files with 31 additions and 0 deletions

View file

@ -28,6 +28,8 @@
#include <AK/Forward.h>
#include <AK/NonnullOwnPtrVector.h>
#include <AK/RefPtr.h>
#include <LibCore/Forward.h>
#include <LibGfx/Forward.h>
#include <LibGfx/WindowTheme.h>
@ -58,6 +60,8 @@ public:
void layout_buttons();
void set_button_icons();
void start_flash_animation();
private:
void paint_notification_frame(Gfx::Painter&);
void paint_normal_frame(Gfx::Painter&);
@ -69,6 +73,9 @@ private:
Button* m_close_button { nullptr };
Button* m_maximize_button { nullptr };
Button* m_minimize_button { nullptr };
RefPtr<Core::Timer> m_flash_timer;
size_t m_flash_counter { 0 };
};
}