/* * Copyright (c) 2022, Andreas Kling * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace GUI { class CommandPalette final : public GUI::Dialog { C_OBJECT(CommandPalette); public: GUI::Action* selected_action() { return m_selected_action; } GUI::Action const* selected_action() const { return m_selected_action; } private: explicit CommandPalette(GUI::Window& parent_window, ScreenPosition = ScreenPosition::CenterWithinParent); virtual ~CommandPalette() override = default; void collect_actions(GUI::Window& parent_window); void finish_with_index(GUI::ModelIndex const&); RefPtr m_selected_action; Vector> m_actions; RefPtr m_text_box; RefPtr m_table_view; RefPtr m_model; RefPtr m_filter_model; }; }