mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:37:34 +00:00
Taskbar: Add a factory function for QuickLaunchWidget
This helps propagate errors that might happen when constructing the quick launch menu. However, the errors are not propagated all the way yet.
This commit is contained in:
parent
fa1416987a
commit
f40cb8d771
3 changed files with 39 additions and 12 deletions
|
@ -6,6 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Error.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <LibConfig/Listener.h>
|
||||
#include <LibCore/FileWatcher.h>
|
||||
#include <LibDesktop/AppFile.h>
|
||||
|
@ -78,6 +80,7 @@ class QuickLaunchWidget : public GUI::Frame
|
|||
C_OBJECT(QuickLaunchWidget);
|
||||
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<QuickLaunchWidget>> create();
|
||||
virtual ~QuickLaunchWidget() override = default;
|
||||
|
||||
virtual void config_key_was_removed(DeprecatedString const&, DeprecatedString const&, DeprecatedString const&) override;
|
||||
|
@ -87,8 +90,10 @@ public:
|
|||
virtual void drop_event(GUI::DropEvent&) override;
|
||||
|
||||
private:
|
||||
QuickLaunchWidget();
|
||||
explicit QuickLaunchWidget(Vector<NonnullOwnPtr<QuickLaunchEntry>> entries);
|
||||
void add_or_adjust_button(DeprecatedString const&, NonnullOwnPtr<QuickLaunchEntry>&&);
|
||||
ErrorOr<void> create_context_menu();
|
||||
|
||||
RefPtr<GUI::Menu> m_context_menu;
|
||||
RefPtr<GUI::Action> m_context_menu_default_action;
|
||||
DeprecatedString m_context_menu_app_name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue