diff options
author | sin-ack <sin-ack@users.noreply.github.com> | 2021-07-25 21:35:50 +0000 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-07-26 21:14:39 +0430 |
commit | 48d4062b47d52abb03f35bc4fbf6ed9e0ed335db (patch) | |
tree | 1a89239b68af25bbcbbf04f8bfe4661dbf80cbb2 /Userland/Services/NotificationServer/NotificationWindow.h | |
parent | e11940fd01c6c45ccaf4994cb588becd10c154f8 (diff) | |
download | serenity-48d4062b47d52abb03f35bc4fbf6ed9e0ed335db.zip |
NotificationServer: Expand the notification when hovered
Now, instead of showing a tooltip, the entire notification will be
shown when the user hovers over a notification. In the future, limiting
the amount of lines shown within the notification and moving extra lines
to the tooltip again might be a good idea.
Diffstat (limited to 'Userland/Services/NotificationServer/NotificationWindow.h')
-rw-r--r-- | Userland/Services/NotificationServer/NotificationWindow.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Services/NotificationServer/NotificationWindow.h b/Userland/Services/NotificationServer/NotificationWindow.h index 9007496e31..8fc47e78a7 100644 --- a/Userland/Services/NotificationServer/NotificationWindow.h +++ b/Userland/Services/NotificationServer/NotificationWindow.h @@ -24,17 +24,25 @@ public: static RefPtr<NotificationWindow> get_window_by_id(i32 id); +protected: + virtual void enter_event(Core::Event&) override; + virtual void leave_event(Core::Event&) override; + private: NotificationWindow(i32 client_id, const String& text, const String& title, const Gfx::ShareableBitmap&); virtual void screen_rects_change_event(GUI::ScreenRectsChangeEvent&) override; + void resize_to_fit_text(); + void set_height(int); + Gfx::IntRect m_original_rect; i32 m_id; GUI::Label* m_text_label; GUI::Label* m_title_label; GUI::ImageWidget* m_image; + bool m_hovering { false }; }; } |