Editor: Don't use ToolButton
This commit is contained in:
@@ -60,10 +60,10 @@ protected:
|
||||
|
||||
QToolBar* m_toolBar;
|
||||
|
||||
QAbstractButton* m_playButton;
|
||||
QAbstractButton* m_recordButton;
|
||||
QAbstractButton* m_recordAccompanyButton;
|
||||
QAbstractButton* m_stopButton;
|
||||
QAction* m_playAction;
|
||||
QAction* m_recordAction;
|
||||
QAction* m_recordAccompanyAction;
|
||||
QAction* m_stopAction;
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
@@ -2029,14 +2029,14 @@ AutomationEditorWindow::AutomationEditorWindow() :
|
||||
|
||||
|
||||
// Play/stop buttons
|
||||
m_playButton->setToolTip(tr( "Play/pause current pattern (Space)" ));
|
||||
m_playButton->setWhatsThis(
|
||||
m_playAction->setToolTip(tr( "Play/pause current pattern (Space)" ));
|
||||
m_playAction->setWhatsThis(
|
||||
tr( "Click here if you want to play the current pattern. "
|
||||
"This is useful while editing it. The pattern is "
|
||||
"automatically looped when the end is reached." ) );
|
||||
|
||||
m_stopButton->setToolTip(tr("Stop playing of current pattern (Space)"));
|
||||
m_stopButton->setWhatsThis(
|
||||
m_stopAction->setToolTip(tr("Stop playing of current pattern (Space)"));
|
||||
m_stopAction->setWhatsThis(
|
||||
tr( "Click here if you want to stop playing of the "
|
||||
"current pattern." ) );
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ BBEditor::BBEditor( BBTrackContainer* tc ) :
|
||||
}
|
||||
|
||||
|
||||
m_playButton->setToolTip(tr( "Play/pause current beat/bassline (Space)" ));
|
||||
m_stopButton->setToolTip(tr( "Stop playback of current beat/bassline (Space)" ));
|
||||
m_playAction->setToolTip(tr( "Play/pause current beat/bassline (Space)" ));
|
||||
m_stopAction->setToolTip(tr( "Stop playback of current beat/bassline (Space)" ));
|
||||
|
||||
ToolButton * add_bb_track = new ToolButton(
|
||||
embed::getIconPixmap( "add_bb_track" ),
|
||||
@@ -90,11 +90,11 @@ BBEditor::BBEditor( BBTrackContainer* tc ) :
|
||||
m_trackContainerView, SLOT( addSteps() ), m_toolBar );
|
||||
|
||||
|
||||
m_playButton->setWhatsThis(
|
||||
m_playAction->setWhatsThis(
|
||||
tr( "Click here to play the current "
|
||||
"beat/bassline. The beat/bassline is automatically "
|
||||
"looped when its end is reached." ) );
|
||||
m_stopButton->setWhatsThis(
|
||||
m_stopAction->setWhatsThis(
|
||||
tr( "Click here to stop playing of current "
|
||||
"beat/bassline." ) );
|
||||
|
||||
@@ -136,7 +136,7 @@ BBEditor::~BBEditor()
|
||||
|
||||
QSize BBEditor::sizeHint() const
|
||||
{
|
||||
return {minimumWidth(), 300};
|
||||
return {minimumWidth()+10, 300};
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@ void Editor::setPauseIcon(bool displayPauseIcon)
|
||||
{
|
||||
// If we're playing, show a pause icon
|
||||
if (displayPauseIcon)
|
||||
m_playButton->setIcon(embed::getIconPixmap("pause"));
|
||||
m_playAction->setIcon(embed::getIconPixmap("pause"));
|
||||
else
|
||||
m_playButton->setIcon(embed::getIconPixmap("play"));
|
||||
m_playAction->setIcon(embed::getIconPixmap("play"));
|
||||
}
|
||||
|
||||
void Editor::play()
|
||||
@@ -59,45 +59,45 @@ void Editor::stop()
|
||||
|
||||
Editor::Editor(bool record) :
|
||||
m_toolBar(new QToolBar(this)),
|
||||
m_playButton(nullptr),
|
||||
m_recordButton(nullptr),
|
||||
m_recordAccompanyButton(nullptr),
|
||||
m_stopButton(nullptr)
|
||||
m_playAction(nullptr),
|
||||
m_recordAction(nullptr),
|
||||
m_recordAccompanyAction(nullptr),
|
||||
m_stopAction(nullptr)
|
||||
{
|
||||
m_toolBar->setContextMenuPolicy(Qt::PreventContextMenu);
|
||||
m_toolBar->setMovable(false);
|
||||
|
||||
auto addButton = [this](const char* pixmap_name, QString text, QString objectName) {
|
||||
ToolButton* button = new ToolButton(embed::getIconPixmap(pixmap_name), text);
|
||||
button->setObjectName(objectName);
|
||||
m_toolBar->addWidget(button);
|
||||
return button;
|
||||
QAction* action = m_toolBar->addAction(embed::getIconPixmap(pixmap_name), text);
|
||||
m_toolBar->widgetForAction(action)->setObjectName(objectName);
|
||||
return action;
|
||||
};
|
||||
|
||||
// Set up play button
|
||||
m_playButton = addButton("play", tr("Play (Space)"), "playButton");
|
||||
m_playButton->setShortcut(Qt::Key_Space);
|
||||
m_playAction = addButton("play", tr("Play (Space)"), "playButton");
|
||||
m_playAction->setShortcut(Qt::Key_Space);
|
||||
|
||||
// Set up record buttons if wanted
|
||||
if (record)
|
||||
{
|
||||
m_recordButton = addButton("record", tr("Record"), "recordButton");
|
||||
m_recordAccompanyButton = addButton("record_accompany", tr("Record while playing"), "recordAccompanyButton");
|
||||
m_recordAction = addButton("record", tr("Record"), "recordButton");
|
||||
m_recordAccompanyAction = addButton("record_accompany", tr("Record while playing"), "recordAccompanyButton");
|
||||
}
|
||||
|
||||
// Set up stop button
|
||||
m_stopButton = addButton("stop", tr("Stop (Space)"), "stopButton");
|
||||
m_stopAction = addButton("stop", tr("Stop (Space)"), "stopButton");
|
||||
|
||||
// Add toolbar to window
|
||||
addToolBar(Qt::TopToolBarArea, m_toolBar);
|
||||
|
||||
// Set up connections
|
||||
connect(m_playButton, SIGNAL(clicked()), this, SLOT(play()));
|
||||
connect(m_playAction, SIGNAL(triggered()), this, SLOT(play()));
|
||||
if (record)
|
||||
{
|
||||
connect(m_recordButton, SIGNAL(clicked()), this, SLOT(record()));
|
||||
connect(m_recordAccompanyButton, SIGNAL(clicked()), this, SLOT(recordAccompany()));
|
||||
connect(m_recordAction, SIGNAL(triggered()), this, SLOT(record()));
|
||||
connect(m_recordAccompanyAction, SIGNAL(triggered()), this, SLOT(recordAccompany()));
|
||||
}
|
||||
connect(m_stopButton, SIGNAL(clicked()), this, SLOT(stop()));
|
||||
connect(m_stopAction, SIGNAL(triggered()), this, SLOT(stop()));
|
||||
}
|
||||
|
||||
Editor::~Editor()
|
||||
|
||||
@@ -3978,28 +3978,28 @@ PianoRollWindow::PianoRollWindow() :
|
||||
{
|
||||
setCentralWidget(m_editor);
|
||||
|
||||
m_playButton->setToolTip(tr("Play/pause current pattern (Space)"));
|
||||
m_recordButton->setToolTip(tr("Record notes from MIDI-device/channel-piano"));
|
||||
m_recordAccompanyButton->setToolTip(tr("Record notes from MIDI-device/channel-piano while playing song or BB track"));
|
||||
m_stopButton->setToolTip(tr("Stop playing of current pattern (Space)"));
|
||||
m_playAction->setToolTip(tr("Play/pause current pattern (Space)"));
|
||||
m_recordAction->setToolTip(tr("Record notes from MIDI-device/channel-piano"));
|
||||
m_recordAccompanyAction->setToolTip(tr("Record notes from MIDI-device/channel-piano while playing song or BB track"));
|
||||
m_stopAction->setToolTip(tr("Stop playing of current pattern (Space)"));
|
||||
|
||||
m_playButton->setWhatsThis(
|
||||
m_playAction->setWhatsThis(
|
||||
tr( "Click here to play the current pattern. "
|
||||
"This is useful while editing it. The pattern is "
|
||||
"automatically looped when its end is reached." ) );
|
||||
m_recordButton->setWhatsThis(
|
||||
m_recordAction->setWhatsThis(
|
||||
tr( "Click here to record notes from a MIDI-"
|
||||
"device or the virtual test-piano of the according "
|
||||
"channel-window to the current pattern. When recording "
|
||||
"all notes you play will be written to this pattern "
|
||||
"and you can play and edit them afterwards." ) );
|
||||
m_recordAccompanyButton->setWhatsThis(
|
||||
m_recordAccompanyAction->setWhatsThis(
|
||||
tr( "Click here to record notes from a MIDI-"
|
||||
"device or the virtual test-piano of the according "
|
||||
"channel-window to the current pattern. When recording "
|
||||
"all notes you play will be written to this pattern "
|
||||
"and you will hear the song or BB track in the background." ) );
|
||||
m_stopButton->setWhatsThis(
|
||||
m_stopAction->setWhatsThis(
|
||||
tr( "Click here to stop playback of current pattern." ) );
|
||||
|
||||
// init edit-buttons at the top
|
||||
|
||||
@@ -611,13 +611,13 @@ SongEditorWindow::SongEditorWindow(Song* song) :
|
||||
setCentralWidget(m_editor);
|
||||
|
||||
// Set up buttons
|
||||
m_playButton->setToolTip(tr("Play song (Space)"));
|
||||
if (m_recordButton && m_recordAccompanyButton)
|
||||
m_playAction->setToolTip(tr("Play song (Space)"));
|
||||
if (m_recordAction && m_recordAccompanyAction)
|
||||
{
|
||||
m_recordButton->setToolTip(tr("Record samples from Audio-device"));
|
||||
m_recordAccompanyButton->setToolTip(tr( "Record samples from Audio-device while playing song or BB track"));
|
||||
m_recordAction->setToolTip(tr("Record samples from Audio-device"));
|
||||
m_recordAccompanyAction->setToolTip(tr( "Record samples from Audio-device while playing song or BB track"));
|
||||
}
|
||||
m_stopButton->setToolTip(tr( "Stop song (Space)" ));
|
||||
m_stopAction->setToolTip(tr( "Stop song (Space)" ));
|
||||
|
||||
m_addBBTrackButton = new ToolButton(
|
||||
embed::getIconPixmap("add_bb_track"),
|
||||
@@ -649,11 +649,11 @@ SongEditorWindow::SongEditorWindow(Song* song) :
|
||||
tool_button_group->addButton(m_editModeButton);
|
||||
tool_button_group->setExclusive(true);
|
||||
|
||||
m_playButton->setWhatsThis(
|
||||
m_playAction->setWhatsThis(
|
||||
tr("Click here, if you want to play your whole song. "
|
||||
"Playing will be started at the song-position-marker (green). "
|
||||
"You can also move it while playing."));
|
||||
m_stopButton->setWhatsThis(
|
||||
m_stopAction->setWhatsThis(
|
||||
tr("Click here, if you want to stop playing of your song. "
|
||||
"The song-position-marker will be set to the start of your song."));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user