mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 17:25:08 +00:00

This change adds a context menu for each app button to remove items from the quicklaunch section of the Taskbar.
36 lines
939 B
C++
36 lines
939 B
C++
/*
|
|
* Copyright (c) 2021, Fabian Blatz <fabianblatz@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibConfig/Listener.h>
|
|
#include <LibDesktop/AppFile.h>
|
|
#include <LibGUI/Button.h>
|
|
#include <LibGUI/Frame.h>
|
|
|
|
namespace Taskbar {
|
|
|
|
class QuickLaunchWidget : public GUI::Frame
|
|
, public Config::Listener {
|
|
C_OBJECT(QuickLaunchWidget);
|
|
|
|
public:
|
|
virtual ~QuickLaunchWidget() override;
|
|
|
|
virtual void config_key_was_removed(String const&, String const&, String const&) override;
|
|
virtual void config_string_did_change(String const&, String const&, String const&, String const&) override;
|
|
|
|
virtual void drop_event(GUI::DropEvent&) override;
|
|
|
|
private:
|
|
QuickLaunchWidget();
|
|
void add_or_adjust_button(String const&, NonnullRefPtr<Desktop::AppFile>);
|
|
RefPtr<GUI::Menu> m_context_menu;
|
|
RefPtr<GUI::Action> m_context_menu_default_action;
|
|
String m_context_menu_app_name;
|
|
};
|
|
|
|
}
|