mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 16:05:08 +00:00
LibGUI: Make window-parented actions actually scoped to the window
We were relying on Core::is<Window>() to tell us whether the parent of an action is a window. This didn't work since we only saw a forward declaration of GUI::Window in Action.cpp. This is an unfortunate flaw in the is<T> pattern and we should solve it somehow but not in this patch.
This commit is contained in:
parent
3cb50a4714
commit
4392413cd1
1 changed files with 3 additions and 1 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
#include <LibGUI/Button.h>
|
#include <LibGUI/Button.h>
|
||||||
#include <LibGUI/MenuItem.h>
|
#include <LibGUI/MenuItem.h>
|
||||||
|
#include <LibGUI/Window.h>
|
||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
|
@ -157,8 +158,9 @@ Action::Action(const StringView& text, const Shortcut& shortcut, RefPtr<Gfx::Bit
|
||||||
m_scope = ShortcutScope::WindowLocal;
|
m_scope = ShortcutScope::WindowLocal;
|
||||||
} else {
|
} else {
|
||||||
m_scope = ShortcutScope::ApplicationGlobal;
|
m_scope = ShortcutScope::ApplicationGlobal;
|
||||||
if (auto* app = Application::the())
|
if (auto* app = Application::the()) {
|
||||||
app->register_global_shortcut_action({}, *this);
|
app->register_global_shortcut_action({}, *this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue