mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-31 14:48:17 +00:00
WindowServer: Use window menu actions when clicking frame buttons
This keeps the minimize/maximize/restore/close implementation consistent with the window menu actions.
This commit is contained in:
parent
7345b502ab
commit
31c3382577
Notes:
sideshowbarker
2024-07-18 19:00:40 +09:00
Author: https://github.com/tomuta
Commit: 31c3382577
Pull-request: https://github.com/SerenityOS/serenity/pull/6702
Issue: https://github.com/SerenityOS/serenity/issues/6690
4 changed files with 54 additions and 29 deletions
|
@ -65,14 +65,14 @@ WindowFrame::WindowFrame(Window& window)
|
|||
: m_window(window)
|
||||
{
|
||||
auto button = make<Button>(*this, [this](auto&) {
|
||||
m_window.request_close();
|
||||
m_window.handle_window_menu_action(WindowMenuAction::Close);
|
||||
});
|
||||
m_close_button = button.ptr();
|
||||
m_buttons.append(move(button));
|
||||
|
||||
if (window.is_resizable()) {
|
||||
auto button = make<Button>(*this, [this](auto&) {
|
||||
WindowManager::the().maximize_windows(m_window, !m_window.is_maximized());
|
||||
m_window.handle_window_menu_action(WindowMenuAction::MaximizeOrRestore);
|
||||
});
|
||||
button->on_middle_click = [&](auto&) {
|
||||
m_window.set_vertically_maximized();
|
||||
|
@ -83,7 +83,7 @@ WindowFrame::WindowFrame(Window& window)
|
|||
|
||||
if (window.is_minimizable()) {
|
||||
auto button = make<Button>(*this, [this](auto&) {
|
||||
WindowManager::the().minimize_windows(m_window, true);
|
||||
m_window.handle_window_menu_action(WindowMenuAction::MinimizeOrUnminimize);
|
||||
});
|
||||
m_minimize_button = button.ptr();
|
||||
m_buttons.append(move(button));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue