triggerbox UI: jump follow action, part one

This commit is contained in:
Paul Davis 2022-01-20 11:01:14 -07:00
parent 413f2e9d1b
commit 46e2a03863
5 changed files with 29 additions and 0 deletions

View File

@ -253,6 +253,7 @@ CueBoxUI::context_menu (uint64_t idx)
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::ForwardTrigger), idx)));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::AnyTrigger), idx)));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::OtherTrigger), idx)));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::JumpTrigger), idx)));
Menu* launch_menu = manage (new Menu);
MenuList& litems = launch_menu->items ();

View File

@ -146,6 +146,7 @@ SlotPropertyTable::SlotPropertyTable ()
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::ForwardTrigger), 0)));
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::AnyTrigger), 0)));
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::OtherTrigger), 0)));
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::JumpTrigger), 0)));
_follow_left.set_sizing_text (longest_follow);
_follow_right.set_name("FollowAction");
@ -158,6 +159,7 @@ SlotPropertyTable::SlotPropertyTable ()
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::ForwardTrigger), 1)));
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::AnyTrigger), 1)));
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::OtherTrigger), 1)));
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::JumpTrigger), 1)));
_follow_right.set_sizing_text (longest_follow);
_launch_style_button.set_name("FollowAction");

View File

@ -350,6 +350,7 @@ TriggerMaster::context_menu ()
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ReverseTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::ReverseTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::AnyTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::OtherTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::JumpTrigger))));
Menu* launch_menu = manage (new Menu);
MenuList& litems = launch_menu->items ();
@ -731,6 +732,8 @@ CueMaster::context_menu ()
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ReverseTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::ReverseTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::AnyTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::OtherTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::JumpTrigger))));
Menu* launch_menu = manage (new Menu);
MenuList& litems = launch_menu->items ();

View File

@ -88,6 +88,7 @@ TriggerUI::TriggerUI ()
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::LastTrigger)));
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::AnyTrigger)));
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::OtherTrigger)));
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::JumpTrigger)));
for (std::vector<std::string>::const_iterator i = follow_strings.begin(); i != follow_strings.end(); ++i) {
if (i->length() > longest_follow.length()) {
@ -646,6 +647,11 @@ TriggerUI::follow_context_menu ()
dynamic_cast<Gtk::CheckMenuItem*> (&fitems.back ())->set_active (true);
}
fitems.push_back (RadioMenuElem (fagroup, TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind(sigc::mem_fun (*this, &TriggerUI::set_follow_action), FollowAction (FollowAction::JumpTrigger))));
if (trigger ()->follow_action (0) == FollowAction::JumpTrigger) {
dynamic_cast<Gtk::CheckMenuItem*> (&fitems.back ())->set_active (true);
}
_ignore_menu_action = false;
items.push_back (MenuElem (_("Follow Action..."), *follow_menu));
@ -805,6 +811,8 @@ TriggerUI::follow_action_to_string (FollowAction const & fa)
return _("Any");
case FollowAction::OtherTrigger:
return _("Other");
case FollowAction::JumpTrigger:
return _("Jump");
}
/*NOTREACHED*/
return std::string();

View File

@ -294,6 +294,21 @@ TriggerEntry::draw_follow_icon (Cairo::RefPtr<Cairo::Context> context, FollowAct
context->set_matrix (m);
}
context->set_identity_matrix ();
} break;
/* ben: new shape here ? */
case FollowAction::JumpTrigger: {
context->set_line_width (1.5 * scale);
set_source_rgba (context, HSV (UIConfiguration::instance ().color ("neutral:midground")).lighter (0.25).color ()); // needs to be brighter to maintain balance
for (int i = 0; i < 6; i++) {
Cairo::Matrix m = context->get_matrix ();
context->translate (size / 2, size / 2);
context->rotate (i * M_PI / 3);
context->move_to (0, 2 * scale);
context->line_to (0, (size / 2) - 4 * scale);
context->stroke ();
context->set_matrix (m);
}
context->set_identity_matrix ();
} break;
case FollowAction::None:
default: