Migrate Timeline::addToolButtons to QToolBar
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
|
||||
class QPixmap;
|
||||
class QToolBar;
|
||||
class NStateButton;
|
||||
class TextFloat;
|
||||
|
||||
@@ -111,7 +112,7 @@ public:
|
||||
update();
|
||||
}
|
||||
|
||||
void addToolButtons( QWidget * _tool_bar );
|
||||
void addToolButtons(QToolBar* _tool_bar );
|
||||
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <QLayout>
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QToolBar>
|
||||
|
||||
|
||||
#include "Timeline.h"
|
||||
@@ -121,7 +122,7 @@ Timeline::~Timeline()
|
||||
|
||||
|
||||
|
||||
void Timeline::addToolButtons( QWidget * _tool_bar )
|
||||
void Timeline::addToolButtons( QToolBar * _tool_bar )
|
||||
{
|
||||
NStateButton * autoScroll = new NStateButton( _tool_bar );
|
||||
autoScroll->setGeneralToolTip( tr( "Enable/disable auto-scrolling" ) );
|
||||
@@ -152,10 +153,9 @@ void Timeline::addToolButtons( QWidget * _tool_bar )
|
||||
connect( behaviourAtStop, SIGNAL( changedState( int ) ), this,
|
||||
SLOT( toggleBehaviourAtStop( int ) ) );
|
||||
|
||||
QBoxLayout * layout = dynamic_cast<QBoxLayout *>( _tool_bar->layout() );
|
||||
layout->addWidget( autoScroll );
|
||||
layout->addWidget( loopPoints );
|
||||
layout->addWidget( behaviourAtStop );
|
||||
_tool_bar->addWidget( autoScroll );
|
||||
_tool_bar->addWidget( loopPoints );
|
||||
_tool_bar->addWidget( behaviourAtStop );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2265,13 +2265,7 @@ AutomationEditorWindow::AutomationEditorWindow() :
|
||||
m_toolBar->addWidget( m_copyButton );
|
||||
m_toolBar->addWidget( m_pasteButton );
|
||||
m_toolBar->addSeparator();
|
||||
QWidget* timeLineButtons = new QWidget();
|
||||
timeLineButtons->setFixedHeight(m_cutButton->height());
|
||||
timeLineButtons->move(0,0);
|
||||
QLayout* l = new QHBoxLayout( timeLineButtons );
|
||||
l->setSpacing(0); l->setMargin(0);
|
||||
m_editor->m_timeLine->addToolButtons(timeLineButtons);
|
||||
m_toolBar->addWidget(timeLineButtons);
|
||||
m_editor->m_timeLine->addToolButtons(m_toolBar);
|
||||
m_toolBar->addSeparator();
|
||||
m_toolBar->addWidget( zoom_x_label );
|
||||
m_toolBar->addWidget( m_zoomingXComboBox );
|
||||
|
||||
@@ -4145,13 +4145,7 @@ PianoRollWindow::PianoRollWindow() :
|
||||
m_toolBar->addWidget( m_pasteButton );
|
||||
|
||||
m_toolBar->addSeparator();
|
||||
QWidget* timeLineButtons = new QWidget();
|
||||
timeLineButtons->setFixedHeight(m_toolBar->height());
|
||||
timeLineButtons->move(0,0);
|
||||
QLayout* l = new QHBoxLayout( timeLineButtons );
|
||||
l->setSpacing(0); l->setMargin(0);
|
||||
m_editor->m_timeLine->addToolButtons(timeLineButtons);
|
||||
m_toolBar->addWidget(timeLineButtons);
|
||||
m_editor->m_timeLine->addToolButtons(m_toolBar);
|
||||
|
||||
m_toolBar->addSeparator();
|
||||
m_toolBar->addWidget( zoom_lbl );
|
||||
|
||||
@@ -676,14 +676,8 @@ SongEditorWindow::SongEditorWindow(Song* song) :
|
||||
m_toolBar->addSeparator();
|
||||
m_toolBar->addWidget( m_drawModeButton );
|
||||
m_toolBar->addWidget( m_editModeButton );
|
||||
|
||||
QWidget* timeLineButtons = new QWidget();
|
||||
timeLineButtons->setFixedHeight(m_toolBar->height());
|
||||
timeLineButtons->move(0,0);
|
||||
QLayout* l = new QHBoxLayout( timeLineButtons );
|
||||
l->setSpacing(0); l->setMargin(0);
|
||||
m_editor->m_timeLine->addToolButtons(timeLineButtons);
|
||||
|
||||
m_toolBar->addSeparator();
|
||||
m_editor->m_timeLine->addToolButtons(m_toolBar);
|
||||
m_toolBar->addSeparator();
|
||||
m_toolBar->addWidget( zoom_lbl );
|
||||
m_toolBar->addWidget( m_zoomingComboBox );
|
||||
|
||||
Reference in New Issue
Block a user