1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:07:44 +00:00

LibGUI+WindowServer: Add option to hide a widow's close button

This allows windows to be closed only programatically, and not from e.g.
the user clicking the X button on the window frame.
This commit is contained in:
Timothy Flynn 2021-10-21 09:09:58 -04:00 committed by Linus Groh
parent 8a57885494
commit 176155c695
8 changed files with 29 additions and 7 deletions

View file

@ -98,6 +98,9 @@ public:
bool is_minimizable() const { return m_type == WindowType::Normal && m_minimizable; }
void set_minimizable(bool);
bool is_closeable() const { return m_closeable; }
void set_closeable(bool);
bool is_resizable() const { return m_resizable && !m_fullscreen; }
void set_resizable(bool);
@ -378,7 +381,7 @@ public:
bool is_stealable_by_client(i32 client_id) const { return m_stealable_by_client_ids.contains_slow(client_id); }
private:
Window(ClientConnection&, WindowType, int window_id, bool modal, bool minimizable, bool frameless, bool resizable, bool fullscreen, bool accessory, Window* parent_window = nullptr);
Window(ClientConnection&, WindowType, int window_id, bool modal, bool minimizable, bool closeable, bool frameless, bool resizable, bool fullscreen, bool accessory, Window* parent_window = nullptr);
Window(Core::Object&, WindowType);
virtual void event(Core::Event&) override;
@ -414,6 +417,7 @@ private:
bool m_has_alpha_channel { false };
bool m_modal { false };
bool m_minimizable { false };
bool m_closeable { false };
bool m_frameless { false };
bool m_forced_shadow { false };
bool m_resizable { false };