1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +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

@ -71,7 +71,7 @@ WindowFrame::WindowFrame(Window& window)
void WindowFrame::window_was_constructed(Badge<Window>)
{
{
if (m_window.is_closeable()) {
auto button = make<Button>(*this, [this](auto&) {
m_window.handle_window_menu_action(WindowMenuAction::Close);
});
@ -113,7 +113,8 @@ void WindowFrame::set_button_icons()
if (m_window.is_frameless())
return;
m_close_button->set_icon(m_window.is_modified() ? *s_close_modified_icon : *s_close_icon);
if (m_window.is_closeable())
m_close_button->set_icon(m_window.is_modified() ? *s_close_modified_icon : *s_close_icon);
if (m_window.is_minimizable())
m_minimize_button->set_icon(s_minimize_icon);
if (m_window.is_resizable())