SongEditor and BBEditor: Accept drops in toolbar
This commit is contained in:
@@ -50,6 +50,11 @@ BBEditor::BBEditor( BBTrackContainer* tc ) :
|
||||
setWindowTitle( tr( "Beat+Bassline Editor" ) );
|
||||
setCentralWidget(m_trackContainerView);
|
||||
|
||||
setAcceptDrops(true);
|
||||
m_toolBar->setAcceptDrops(true);
|
||||
connect(m_toolBar, SIGNAL(dragEntered(QDragEnterEvent*)), m_trackContainerView, SLOT(dragEnterEvent(QDragEnterEvent*)));
|
||||
connect(m_toolBar, SIGNAL(dropped(QDropEvent*)), m_trackContainerView, SLOT(dropEvent(QDropEvent*)));
|
||||
|
||||
// TODO: Use style sheet
|
||||
if( ConfigManager::inst()->value( "ui",
|
||||
"compacttrackbuttons" ).toInt() )
|
||||
|
||||
@@ -51,7 +51,7 @@ void Editor::togglePlayStop()
|
||||
}
|
||||
|
||||
Editor::Editor(bool record) :
|
||||
m_toolBar(new QToolBar(this)),
|
||||
m_toolBar(new DropToolBar(this)),
|
||||
m_playAction(nullptr),
|
||||
m_recordAction(nullptr),
|
||||
m_recordAccompanyAction(nullptr),
|
||||
@@ -96,3 +96,21 @@ Editor::~Editor()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
DropToolBar::DropToolBar(QWidget* parent) : QToolBar(parent)
|
||||
{
|
||||
setAcceptDrops(true);
|
||||
}
|
||||
|
||||
void DropToolBar::dragEnterEvent(QDragEnterEvent* event)
|
||||
{
|
||||
dragEntered(event);
|
||||
}
|
||||
|
||||
void DropToolBar::dropEvent(QDropEvent* event)
|
||||
{
|
||||
dropped(event);
|
||||
}
|
||||
|
||||
@@ -626,6 +626,10 @@ SongEditorWindow::SongEditorWindow(Song* song) :
|
||||
setWindowIcon( embed::getIconPixmap( "songeditor" ) );
|
||||
|
||||
setCentralWidget(m_editor);
|
||||
setAcceptDrops(true);
|
||||
m_toolBar->setAcceptDrops(true);
|
||||
connect(m_toolBar, SIGNAL(dragEntered(QDragEnterEvent*)), m_editor, SLOT(dragEnterEvent(QDragEnterEvent*)));
|
||||
connect(m_toolBar, SIGNAL(dropped(QDropEvent*)), m_editor, SLOT(dropEvent(QDropEvent*)));
|
||||
|
||||
// Set up buttons
|
||||
m_playAction->setToolTip(tr("Play song (Space)"));
|
||||
|
||||
Reference in New Issue
Block a user