Skip to content

Commit

Permalink
Fix #10908: Added cross-staff beaming button
Browse files Browse the repository at this point in the history
This commit adds cross-staff beaming button in note input toolbar
  • Loading branch information
HemantAntony committed Mar 26, 2022
1 parent c437746 commit f9d0560
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
Binary file modified fonts/mscore/MusescoreIcon.ttf
Binary file not shown.
2 changes: 2 additions & 0 deletions src/framework/ui/view/iconcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ class IconCode

INSERT_ONE_MEASURE = 0xF432,

CROSS_STAFF_BEAMING = 0xF43D,

NONE = 0xFFFF
};

Expand Down
11 changes: 9 additions & 2 deletions src/notation/internal/notationuiactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ const UiActionList NotationUiActions::m_actions = {
),
UiAction("move-up",
mu::context::UiCtxNotationOpened,
QT_TRANSLATE_NOOP("action", "Move up"),
QT_TRANSLATE_NOOP("action", "Move to staff above"),
QT_TRANSLATE_NOOP("action", "Move chord/rest to staff above")
),
UiAction("move-down",
mu::context::UiCtxNotationOpened,
QT_TRANSLATE_NOOP("action", "Move down"),
QT_TRANSLATE_NOOP("action", "Move to staff below"),
QT_TRANSLATE_NOOP("action", "Move chord/rest to staff below")
),
UiAction("next-track",
Expand Down Expand Up @@ -1753,6 +1753,12 @@ const UiActionList NotationUiActions::m_noteInputActions = {
QT_TRANSLATE_NOOP("action", "Toggle staccato"),
IconCode::Code::STACCATO
),
UiAction("cross-staff-beaming",
mu::context::UiCtxNotationOpened,
QT_TRANSLATE_NOOP("action", "Cross-staff beaming"),
QT_TRANSLATE_NOOP("action", "Move notes to staff above or below"),
IconCode::Code::CROSS_STAFF_BEAMING
),
UiAction("tuplet",
mu::context::UiCtxNotationOpened,
QT_TRANSLATE_NOOP("action", "Tuplet"),
Expand Down Expand Up @@ -2082,6 +2088,7 @@ const mu::ui::ToolConfig& NotationUiActions::defaultNoteInputBarConfig()
{ "add-tenuto", true },
{ "add-staccato", true },
{ "", true },
{ "cross-staff-beaming", false },
{ "tuplet", true },
{ "flip", true },
{ "", true },
Expand Down
15 changes: 15 additions & 0 deletions src/notation/view/noteinputbarmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ static const std::string ADD_ACTION_CODE("add");
static const char* ADD_ACTION_TITLE("Add");
static const IconCode::Code ADD_ACTION_ICON_CODE = IconCode::Code::PLUS;

static const ActionCode CROSS_STAFF_BEAMING_CODE("cross-staff-beaming");
static const ActionCode TUPLET_ACTION_CODE("tuplet");

static const std::vector<std::pair<ActionCode, NoteInputMethod> > noteInputModeActions = {
Expand Down Expand Up @@ -137,6 +138,8 @@ void NoteInputBarModel::load()
MenuItemList subitems;
if (isNoteInputModeAction(citem.action)) {
subitems = makeNoteInputMethodItems();
} else if (citem.action == CROSS_STAFF_BEAMING_CODE) {
subitems = makeCrossStaffBeamingItems();
} else if (citem.action == TUPLET_ACTION_CODE) {
subitems = makeTupletItems();
}
Expand Down Expand Up @@ -588,6 +591,8 @@ MenuItemList NoteInputBarModel::makeSubitems(const ActionCode& actionCode)
MenuItemList items;
if (isNoteInputModeAction(actionCode)) {
items = makeNoteInputMethodItems();
} else if (actionCode == CROSS_STAFF_BEAMING_CODE) {
items = makeCrossStaffBeamingItems();
} else if (actionCode == TUPLET_ACTION_CODE) {
items = makeTupletItems();
} else if (actionCode == ADD_ACTION_CODE) {
Expand Down Expand Up @@ -617,6 +622,16 @@ MenuItemList NoteInputBarModel::makeNoteInputMethodItems()
return items;
}

MenuItemList NoteInputBarModel::makeCrossStaffBeamingItems()
{
MenuItemList items = {
makeMenuItem("move-up"),
makeMenuItem("move-down")
};

return items;
}

MenuItemList NoteInputBarModel::makeTupletItems()
{
MenuItemList items = {
Expand Down
1 change: 1 addition & 0 deletions src/notation/view/noteinputbarmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class NoteInputBarModel : public uicomponents::AbstractMenuModel

uicomponents::MenuItemList makeSubitems(const actions::ActionCode& actionCode);
uicomponents::MenuItemList makeNoteInputMethodItems();
uicomponents::MenuItemList makeCrossStaffBeamingItems();
uicomponents::MenuItemList makeTupletItems();
uicomponents::MenuItemList makeAddItems();
uicomponents::MenuItemList makeNotesItems();
Expand Down

0 comments on commit f9d0560

Please sign in to comment.