fixed shortcut context for pitch-up/pitch-down
This commit is contained in:
parent
e3145fe0bb
commit
7f0b25f248
5 changed files with 51 additions and 36 deletions
|
@ -161,10 +161,11 @@ bool UiContextResolver::isShortcutContextAllowed(const std::string& scContext) c
|
|||
//! NotationFocused
|
||||
//! NotationStaffTab
|
||||
|
||||
static const std::string CTX_NOTATION_STAFF_STANDART("notation-staff-standart");
|
||||
static const std::string CTX_ANY("any");
|
||||
static const std::string CTX_NOTATION_STAFF_STANDARD("notation-staff-standard");
|
||||
static const std::string CTX_NOTATION_STAFF_TAB("notation-staff-tab");
|
||||
|
||||
if (CTX_NOTATION_STAFF_STANDART == scContext) {
|
||||
if (CTX_NOTATION_STAFF_STANDARD == scContext) {
|
||||
auto notation = globalContext()->currentNotation();
|
||||
if (!notation) {
|
||||
return false;
|
||||
|
@ -179,5 +180,8 @@ bool UiContextResolver::isShortcutContextAllowed(const std::string& scContext) c
|
|||
return notation->interaction()->noteInput()->state().staffGroup == Ms::StaffGroup::TAB;
|
||||
}
|
||||
|
||||
IF_ASSERT_FAILED(CTX_ANY == scContext) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -335,6 +335,7 @@
|
|||
<SC>
|
||||
<key>pitch-up</key>
|
||||
<seq>Up</seq>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pitch-up-diatonic</key>
|
||||
|
@ -391,6 +392,7 @@
|
|||
<SC>
|
||||
<key>pitch-down</key>
|
||||
<seq>Down</seq>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pitch-down-diatonic</key>
|
||||
|
@ -585,52 +587,52 @@
|
|||
<SC>
|
||||
<key>note-longa</key>
|
||||
<seq>9</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>note-breve</key>
|
||||
<seq>8</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-1</key>
|
||||
<seq>7</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-2</key>
|
||||
<seq>6</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-4</key>
|
||||
<seq>5</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-8</key>
|
||||
<seq>4</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-16</key>
|
||||
<seq>3</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-32</key>
|
||||
<seq>2</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-64</key>
|
||||
<seq>1</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-dot</key>
|
||||
<seq>.</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>tie</key>
|
||||
|
|
|
@ -335,6 +335,7 @@
|
|||
<SC>
|
||||
<key>pitch-up</key>
|
||||
<seq>Up</seq>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pitch-up-diatonic</key>
|
||||
|
@ -391,6 +392,7 @@
|
|||
<SC>
|
||||
<key>pitch-down</key>
|
||||
<seq>Down</seq>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pitch-down-diatonic</key>
|
||||
|
@ -585,52 +587,52 @@
|
|||
<SC>
|
||||
<key>note-longa</key>
|
||||
<seq>9</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>note-breve</key>
|
||||
<seq>8</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-1</key>
|
||||
<seq>7</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-2</key>
|
||||
<seq>6</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-4</key>
|
||||
<seq>5</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-8</key>
|
||||
<seq>4</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-16</key>
|
||||
<seq>3</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-32</key>
|
||||
<seq>2</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-64</key>
|
||||
<seq>1</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-dot</key>
|
||||
<seq>.</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>tie</key>
|
||||
|
|
|
@ -344,6 +344,7 @@
|
|||
<SC>
|
||||
<key>pitch-up</key>
|
||||
<seq>Up</seq>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pitch-up-diatonic</key>
|
||||
|
@ -400,6 +401,7 @@
|
|||
<SC>
|
||||
<key>pitch-down</key>
|
||||
<seq>Down</seq>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pitch-down-diatonic</key>
|
||||
|
@ -603,60 +605,60 @@
|
|||
<key>note-longa</key>
|
||||
<seq>9</seq>
|
||||
<seq>Ç</seq> <!-- AZERTY for 9 -->
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>note-breve</key>
|
||||
<seq>8</seq>
|
||||
<seq>_</seq> <!-- AZERTY for 8 -->
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-1</key>
|
||||
<seq>7</seq>
|
||||
<seq>È</seq> <!-- AZERTY for 7 -->
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-2</key>
|
||||
<seq>6</seq>
|
||||
<seq>-</seq> <!-- AZERTY for 6 -->
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-4</key>
|
||||
<seq>5</seq>
|
||||
<seq>(</seq> <!-- AZERTY for 5 -->
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-8</key>
|
||||
<seq>4</seq>
|
||||
<seq>'</seq> <!-- AZERTY for 4 -->
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-16</key>
|
||||
<seq>3</seq>
|
||||
<seq>"</seq> <!-- AZERTY for 3 -->
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-32</key>
|
||||
<seq>2</seq>
|
||||
<seq>É</seq> <!-- AZERTY for 2 -->
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-note-64</key>
|
||||
<seq>1</seq>
|
||||
<seq>&</seq> <!-- AZERTY for 1 -->
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>pad-dot</key>
|
||||
<seq>.</seq>
|
||||
<ctx>notation-staff-standart</ctx>
|
||||
<ctx>notation-staff-standard</ctx>
|
||||
</SC>
|
||||
<SC>
|
||||
<key>tie</key>
|
||||
|
|
|
@ -90,13 +90,18 @@ void ShortcutsRegister::reload(bool onlyDef)
|
|||
void ShortcutsRegister::mergeShortcuts(ShortcutList& shortcuts, const ShortcutList& defaultShortcuts) const
|
||||
{
|
||||
ShortcutList needadd;
|
||||
for (const Shortcut& sh : defaultShortcuts) {
|
||||
auto it = std::find_if(shortcuts.begin(), shortcuts.end(), [sh](const Shortcut& i) {
|
||||
return i.action == sh.action;
|
||||
for (const Shortcut& defSc : defaultShortcuts) {
|
||||
auto it = std::find_if(shortcuts.begin(), shortcuts.end(), [defSc](const Shortcut& i) {
|
||||
return i.action == defSc.action;
|
||||
});
|
||||
|
||||
//! NOTE If no default shortcut is found in user shortcuts add def
|
||||
if (it == shortcuts.end()) {
|
||||
needadd.push_back(sh);
|
||||
needadd.push_back(defSc);
|
||||
}
|
||||
//! NOTE If user shortcut is found, set context (context should always as default)
|
||||
else {
|
||||
it->context = defSc.context;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue