add ToolButtonMenu for new Note Entry Modes

This commit is contained in:
Peter Jonas 2016-07-04 08:32:43 +01:00
parent a6bba9d71a
commit 053307d0bb
No known key found for this signature in database
GPG key ID: 0B81879C782D49F1
4 changed files with 26 additions and 6 deletions

View file

@ -96,7 +96,7 @@ static const char* iconNames[] = {
"grace16after.svg",
"grace32after.svg",
"mode-notes.svg",
"mode-notes-steptime.svg",
// "mode-notes-steptime.svg", (using normal icon for the time being.)
"mode-notes-repitch.svg",
"mode-notes-rhythm.svg",
"mode-notes-realtime-auto.svg",

View file

@ -38,7 +38,8 @@ enum class Icons : signed char { Invalid_ICON = -1,
window_ICON, acciaccatura_ICON, appoggiatura_ICON,
grace4_ICON, grace16_ICON, grace32_ICON,
grace8after_ICON, grace16after_ICON, grace32after_ICON,
noteEntry_ICON, noteEntrySteptime_ICON, noteEntryRepitch_ICON, noteEntryRhythm_ICON, noteEntryRealtimeAuto_ICON, noteEntryRealtimeManual_ICON,
noteEntry_ICON, // noteEntrySteptime_ICON, (using normal icon for the time being.)
noteEntryRepitch_ICON, noteEntryRhythm_ICON, noteEntryRealtimeAuto_ICON, noteEntryRealtimeManual_ICON,
keys_ICON, tie_ICON,
textBold_ICON, textItalic_ICON, textUnderline_ICON,
textLeft_ICON, textCenter_ICON, textRight_ICON, textTop_ICON, textBottom_ICON, textVCenter_ICON, textBaseline_ICON,

View file

@ -102,6 +102,7 @@
#include "fluid/fluid.h"
#include "qmlplugin.h"
#include "accessibletoolbutton.h"
#include "toolbuttonmenu.h"
#include "searchComboBox.h"
#include "startcenter.h"
#include "help.h"
@ -167,7 +168,6 @@ const char* voiceActions[] = { "voice-1", "voice-2", "voice-3", "voice-4" };
const std::list<const char*> MuseScore::_allNoteInputMenuEntries {
"note-input",
"repitch",
"pad-note-128",
"pad-note-64",
"pad-note-32",
@ -201,7 +201,6 @@ const std::list<const char*> MuseScore::_allNoteInputMenuEntries {
const std::list<const char*> MuseScore::_advancedNoteInputMenuEntries {
"note-input",
"repitch",
"pad-note-128",
"pad-note-64",
"pad-note-32",
@ -465,7 +464,28 @@ void MuseScore::populateNoteInputMenu()
entryTools->addSeparator();
else {
QAction* a = getAction(s);
if (strncmp(s, "voice-", 6) == 0) {
if (strcmp(s, "note-input") == 0) {
//-----------------------------------------------------------------
// Note Entry Modes menu
// ToolButtonMenu to swap between Note Entry Methods
//-----------------------------------------------------------------
QActionGroup* noteEntryMethods = new QActionGroup(entryTools);
noteEntryMethods->addAction(getAction("note-input-steptime"));
noteEntryMethods->addAction(getAction("note-input-repitch"));
noteEntryMethods->addAction(getAction("note-input-rhythm"));
noteEntryMethods->addAction(getAction("note-input-realtime-auto"));
noteEntryMethods->addAction(getAction("note-input-realtime-manual"));
ToolButtonMenu* noteInputModes = new ToolButtonMenu(tr("Note Entry Methods"),
ToolButtonMenu::TYPES::ICON_CHANGED,
getAction("note-input"),
noteEntryMethods,
this);
entryTools->addWidget(noteInputModes);
}
else if (strncmp(s, "voice-", 6) == 0) {
// QButton* tb = new QToolButton(this);
AccessibleToolButton* tb = new AccessibleToolButton(this, a);
tb->setFocusPolicy(Qt::ClickFocus);

View file

@ -85,7 +85,6 @@
<file>data/icons/media-playback-start.svg</file>
<file>data/icons/media-skip-backward.svg</file>
<file>data/icons/mode-notes.svg</file>
<file>data/icons/mode-notes-steptime.svg</file>
<file>data/icons/mode-notes-repitch.svg</file>
<file>data/icons/mode-notes-rhythm.svg</file>
<file>data/icons/mode-notes-realtime-manual.svg</file>