diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:50:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:50:49 +0000 |
commit | c853ffb5b2f75f5a889ed2e3ef89b818a736e87a (patch) | |
tree | 7d13a0883bb7936b84d6ecdd7bc332b41ed04bee /src/ui/widget/completion-popup.h | |
parent | Initial commit. (diff) | |
download | inkscape-c853ffb5b2f75f5a889ed2e3ef89b818a736e87a.tar.xz inkscape-c853ffb5b2f75f5a889ed2e3ef89b818a736e87a.zip |
Adding upstream version 1.3+ds.upstream/1.3+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ui/widget/completion-popup.h')
-rw-r--r-- | src/ui/widget/completion-popup.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/ui/widget/completion-popup.h b/src/ui/widget/completion-popup.h new file mode 100644 index 0000000..b7b77a1 --- /dev/null +++ b/src/ui/widget/completion-popup.h @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + + +#ifndef INKSCAPE_UI_WIDGET_COMPLETION_POPUP_H +#define INKSCAPE_UI_WIDGET_COMPLETION_POPUP_H + +#include <glibmm/refptr.h> +#include <glibmm/ustring.h> +#include <gtkmm/builder.h> +#include <gtkmm/entrycompletion.h> +#include <gtkmm/liststore.h> +#include <gtkmm/menu.h> +#include <gtkmm/menubutton.h> +#include <gtkmm/searchentry.h> +#include <sigc++/connection.h> +#include "labelled.h" + +namespace Inkscape { +namespace UI { +namespace Widget { + +class CompletionPopup : public Gtk::Box { +public: + CompletionPopup(); + + Gtk::Menu& get_menu(); + Gtk::SearchEntry& get_entry(); + Glib::RefPtr<Gtk::ListStore> get_list(); + + void clear_completion_list(); + void add_to_completion_list(int id, Glib::ustring name, Glib::ustring icon_name, Glib::ustring search_text = Glib::ustring()); + + sigc::signal<void (int)>& on_match_selected(); + sigc::signal<void ()>& on_button_press(); + sigc::signal<bool ()>& on_focus(); + +private: + Glib::RefPtr<Gtk::Builder> _builder; + Glib::RefPtr<Gtk::ListStore> _list; + Gtk::SearchEntry& _search; + Gtk::MenuButton& _button; + Gtk::Menu& _popup; + Glib::RefPtr<Gtk::EntryCompletion> _completion; + sigc::signal<void (int)> _match_selected; + sigc::signal<void ()> _button_press; + sigc::signal<bool ()> _on_focus; +}; + +}}} // namespaces + +#endif // INKSCAPE_UI_WIDGET_COMPLETION_POPUP_H |