Skip to content

Commit

Permalink
ActionBinder: add font icon constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
sturnclaw committed Oct 14, 2023
1 parent 20d0a7b commit fe54228
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/editor/ActionBinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ namespace Editor {
action(f)
{}

template<typename Functor>
ActionEntry(std::string_view label, const char *icon, ImGuiKeyChord shortcut, Functor f) :
label(label),
fontIcon(icon),
shortcut(shortcut),
action(f)
{}

template<typename Predicate, typename Functor>
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;
Expand Down

0 comments on commit fe54228

Please sign in to comment.