From fe54228c8a28440abb50548f1bf7b8cca98209b8 Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Sat, 14 Oct 2023 19:53:04 -0400 Subject: [PATCH] ActionBinder: add font icon constructors --- src/editor/ActionBinder.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/editor/ActionBinder.h b/src/editor/ActionBinder.h index 19bdc1146da..d61ac020775 100644 --- a/src/editor/ActionBinder.h +++ b/src/editor/ActionBinder.h @@ -32,6 +32,23 @@ namespace Editor { action(f) {} + template + ActionEntry(std::string_view label, const char *icon, ImGuiKeyChord shortcut, Functor f) : + label(label), + fontIcon(icon), + shortcut(shortcut), + action(f) + {} + + template + ActionEntry(std::string_view label, const char *icon, ImGuiKeyChord shortcut, Predicate p, Functor f) : + label(label), + fontIcon(icon), + shortcut(shortcut), + predicate(p), + action(f) + {} + std::string label; const char *fontIcon; ImGuiKeyChord shortcut;