Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 10 additions & 21 deletions data/themes/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,6 @@ TrackContainerView QFrame{

/* autoscroll, loop, stop behaviour toggle buttons */

NStateButton {
max-height: 26px;
max-width: 26px;
min-height: 26px;
min-width: 26px;
}

/* track background colors */
TrackContentWidget {
qproperty-darkerColor: qlineargradient(x1:0, y1:0, x2:0, y2:1,
Expand Down Expand Up @@ -377,9 +370,9 @@ QWidget#mainToolbar {
/* smaller toolbars */

QToolBar {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #98a2a7, stop:1 #5b646f);
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #98a2a7, stop:1 #5b646f);
border: none;
padding: 1px;
padding: 2px;
spacing: 0;
}

Expand All @@ -390,47 +383,43 @@ QToolBar::separator {

QToolButton {
padding: 1px 1px 1px 1px;
border-radius: 2px;
border: 1px solid rgba(0,0,0,32);
background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #c9c9c9, stop:1 #969696 );
border-radius: 5px;
border: 1px solid rgba(63, 63, 63, 128);
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #98a2a7, stop:1 #5b646f);
font-size:10px;
color: black;
}

/* separate corner rounding for play and stop buttons! */

QToolButton#playButton {
border-top-left-radius: 5px 15px;
border-bottom-left-radius: 5px 15px;
border-top-left-radius: 10px 10px;
border-bottom-left-radius: 10px 10px;
}

QToolButton#stopButton {
border-top-right-radius: 5px 15px;
border-bottom-right-radius: 5px 15px;
border-top-right-radius: 10px 10px;
border-bottom-right-radius: 10px 10px;
}

/* record and record-accompany can be styled with #recordButton and #recordAccompanyButton respectively */

/* all tool buttons */

QToolButton:hover {
background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #e0e0e0, stop:0.5 #c9c9c9, stop:1 #969696 );
border: 1px solid rgba(0,0,0,128);
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #c0cdd3, stop:1 #71797d);
color: white;
}

QToolButton:pressed {
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #969696, stop:0.5 #c9c9c9, stop:1 #969696 );
padding: 2px 1px 0px 1px;
border: 1px solid rgba(0,0,0,128);
color: white;
}

QToolButton:checked {
background: qradialgradient(cx:0.3, cy:0.3, radius:0.8, fx:0.3, fy:0.3, stop:0 #e0e0e0, stop:0.8 #c9c9c9, stop:1 #c0c0c0 );
border-radius: 3px;
padding: 2px 1px 0px 1px;
border: 1px solid rgba(0,0,0,255);
color: black;
}

Expand Down
5 changes: 5 additions & 0 deletions include/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ class Editor : public QMainWindow
public:
void setPauseIcon(bool displayPauseIcon=true);

protected:
DropToolBar * addDropToolBarToTop(QString const & windowTitle);
DropToolBar * addDropToolBar(Qt::ToolBarArea whereToAdd, QString const & windowTitle);
DropToolBar * addDropToolBar(QWidget * parent, Qt::ToolBarArea whereToAdd, QString const & windowTitle);

protected slots:
virtual void play() {}
virtual void record() {}
Expand Down
92 changes: 54 additions & 38 deletions src/gui/editors/AutomationEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2024,9 +2024,12 @@ AutomationEditorWindow::AutomationEditorWindow() :
"current pattern." ) );

// Edit mode buttons
DropToolBar *editActionsToolBar = addDropToolBarToTop(tr("Edit actions"));

ActionGroup* editModeGroup = new ActionGroup(this);
QAction* drawAction = editModeGroup->addAction(embed::getIconPixmap("edit_draw"), tr("Draw mode (Shift+D)"));
drawAction->setShortcut(Qt::SHIFT | Qt::Key_D);
drawAction->setChecked(true);

QAction* eraseAction = editModeGroup->addAction(embed::getIconPixmap("edit_erase"), tr("Erase mode (Shift+E)"));
eraseAction->setShortcut(Qt::SHIFT | Qt::Key_E);
Expand Down Expand Up @@ -2069,11 +2072,23 @@ AutomationEditorWindow::AutomationEditorWindow() :

connect(editModeGroup, SIGNAL(triggered(int)), m_editor, SLOT(setEditMode(int)));

// Progression type buttons
editActionsToolBar->addAction(drawAction);
editActionsToolBar->addAction(eraseAction);
// editActionsToolBar->addAction(m_selectButton);
// editActionsToolBar->addAction(m_moveButton);
editActionsToolBar->addAction(m_flipXAction);
editActionsToolBar->addAction(m_flipYAction);


// Interpolation actions
DropToolBar *interpolationActionsToolBar = addDropToolBarToTop(tr("Interpolation controls"));

ActionGroup* progression_type_group = new ActionGroup(this);

m_discreteAction = progression_type_group->addAction(
embed::getIconPixmap("progression_discrete"), tr("Discrete progression"));
m_discreteAction->setChecked(true);

m_linearAction = progression_type_group->addAction(
embed::getIconPixmap("progression_linear"), tr("Linear progression"));
m_cubicHermiteAction = progression_type_group->addAction(
Expand Down Expand Up @@ -2111,7 +2126,18 @@ AutomationEditorWindow::AutomationEditorWindow() :
"object will change in a smooth curve and ease in to "
"the peaks and valleys." ) );

interpolationActionsToolBar->addSeparator();
interpolationActionsToolBar->addAction(m_discreteAction);
interpolationActionsToolBar->addAction(m_linearAction);
interpolationActionsToolBar->addAction(m_cubicHermiteAction);
interpolationActionsToolBar->addSeparator();
interpolationActionsToolBar->addWidget( new QLabel( tr("Tension: "), interpolationActionsToolBar ));
interpolationActionsToolBar->addWidget( m_tensionKnob );



// Copy paste buttons
/*DropToolBar *copyPasteActionsToolBar = addDropToolBarToTop(tr("Copy paste actions"));*/

QAction* cutAction = new QAction(embed::getIconPixmap("edit_cut"),
tr("Cut selected values (Ctrl+X)"), this);
Expand Down Expand Up @@ -2140,12 +2166,26 @@ AutomationEditorWindow::AutomationEditorWindow() :
connect(copyAction, SIGNAL(triggered()), m_editor, SLOT(copySelectedValues()));
connect(pasteAction, SIGNAL(triggered()), m_editor, SLOT(pasteValues()));

// Select is broken
// copyPasteActionsToolBar->addAction( cutAction );
// copyPasteActionsToolBar->addAction( copyAction );
// copyPasteActionsToolBar->addAction( pasteAction );


DropToolBar *timeLineToolBar = addDropToolBarToTop(tr("Timeline controls"));
m_editor->m_timeLine->addToolButtons(timeLineToolBar);


addToolBarBreak();


// Zoom controls
DropToolBar *zoomToolBar = addDropToolBarToTop(tr("Zoom controls"));

QLabel * zoom_x_label = new QLabel( m_toolBar );
QLabel * zoom_x_label = new QLabel( zoomToolBar );
zoom_x_label->setPixmap( embed::getIconPixmap( "zoom_x" ) );

m_zoomingXComboBox = new ComboBox( m_toolBar );
m_zoomingXComboBox = new ComboBox( zoomToolBar );
m_zoomingXComboBox->setFixedSize( 80, 22 );

for( int i = 0; i < 6; ++i )
Expand All @@ -2160,10 +2200,10 @@ AutomationEditorWindow::AutomationEditorWindow() :
m_editor, SLOT( zoomingXChanged() ) );


QLabel * zoom_y_label = new QLabel( m_toolBar );
QLabel * zoom_y_label = new QLabel( zoomToolBar );
zoom_y_label->setPixmap( embed::getIconPixmap( "zoom_y" ) );

m_zoomingYComboBox = new ComboBox( m_toolBar );
m_zoomingYComboBox = new ComboBox( zoomToolBar );
m_zoomingYComboBox->setFixedSize( 80, 22 );

m_editor->m_zoomingYModel.addItem( "Auto" );
Expand All @@ -2178,9 +2218,16 @@ AutomationEditorWindow::AutomationEditorWindow() :
connect( &m_editor->m_zoomingYModel, SIGNAL( dataChanged() ),
m_editor, SLOT( zoomingYChanged() ) );

zoomToolBar->addWidget( zoom_x_label );
zoomToolBar->addWidget( m_zoomingXComboBox );
zoomToolBar->addSeparator();
zoomToolBar->addWidget( zoom_y_label );
zoomToolBar->addWidget( m_zoomingYComboBox );



// Quantization controls
DropToolBar *quantizationActionsToolBar = addDropToolBarToTop(tr("Quantization controls"));

QLabel * quantize_lbl = new QLabel( m_toolBar );
quantize_lbl->setPixmap( embed::getIconPixmap( "quantize" ) );
Expand All @@ -2190,40 +2237,9 @@ AutomationEditorWindow::AutomationEditorWindow() :

m_quantizeComboBox->setModel( &m_editor->m_quantizeModel );

quantizationActionsToolBar->addWidget( quantize_lbl );
quantizationActionsToolBar->addWidget( m_quantizeComboBox );

m_toolBar->addSeparator();;
m_toolBar->addAction(drawAction);
m_toolBar->addAction(eraseAction);
// m_toolBar->addAction(m_selectButton);
// m_toolBar->addAction(m_moveButton);
m_toolBar->addAction(m_flipXAction);
m_toolBar->addAction(m_flipYAction);
m_toolBar->addSeparator();
m_toolBar->addAction(m_discreteAction);
m_toolBar->addAction(m_linearAction);
m_toolBar->addAction(m_cubicHermiteAction);
m_toolBar->addSeparator();
m_toolBar->addWidget( new QLabel( tr("Tension: "), m_toolBar ));
m_toolBar->addWidget( m_tensionKnob );
m_toolBar->addSeparator();
// Select is broken
// m_toolBar->addAction( cutAction );
// m_toolBar->addAction( copyAction );
// m_toolBar->addAction( pasteAction );
m_toolBar->addSeparator();
m_editor->m_timeLine->addToolButtons(m_toolBar);
m_toolBar->addSeparator();
m_toolBar->addWidget( zoom_x_label );
m_toolBar->addWidget( m_zoomingXComboBox );
m_toolBar->addSeparator();
m_toolBar->addWidget( zoom_y_label );
m_toolBar->addWidget( m_zoomingYComboBox );
m_toolBar->addSeparator();
m_toolBar->addWidget( quantize_lbl );
m_toolBar->addWidget( m_quantizeComboBox );

drawAction->setChecked(true);
m_discreteAction->setChecked(true);

// Setup our actual window
setFocusPolicy( Qt::StrongFocus );
Expand Down
29 changes: 19 additions & 10 deletions src/gui/editors/BBEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,34 +82,43 @@ BBEditor::BBEditor( BBTrackContainer* tc ) :
tr( "Click here to stop playing of current "
"beat/bassline." ) );


// Beat selector
DropToolBar *beatSelectionToolBar = addDropToolBarToTop(tr("Beat selector"));

m_bbComboBox = new ComboBox( m_toolBar );
m_bbComboBox->setFixedSize( 200, 22 );
m_bbComboBox->setModel( &tc->m_bbComboBoxModel );

m_toolBar->addSeparator();
m_toolBar->addWidget( m_bbComboBox );
beatSelectionToolBar->addWidget( m_bbComboBox );


// Track actions
DropToolBar *trackAndStepActionsToolBar = addDropToolBarToTop(tr("Track and step actions"));

m_toolBar->addSeparator();
m_toolBar->addAction(embed::getIconPixmap("add_bb_track"), tr("Add beat/bassline"),

trackAndStepActionsToolBar->addAction(embed::getIconPixmap("add_bb_track"), tr("Add beat/bassline"),
Engine::getSong(), SLOT(addBBTrack()));
m_toolBar->addAction(embed::getIconPixmap("add_automation"), tr("Add automation-track"),
trackAndStepActionsToolBar->addAction(embed::getIconPixmap("add_automation"), tr("Add automation-track"),
m_trackContainerView, SLOT(addAutomationTrack()));

QWidget* stretch = new QWidget(m_toolBar);
stretch->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_toolBar->addWidget(stretch);
trackAndStepActionsToolBar->addWidget(stretch);


m_toolBar->addAction(embed::getIconPixmap("step_btn_remove"), tr("Remove steps"),
// Step actions
trackAndStepActionsToolBar->addAction(embed::getIconPixmap("step_btn_remove"), tr("Remove steps"),
m_trackContainerView, SLOT(removeSteps()));
m_toolBar->addAction(embed::getIconPixmap("step_btn_add"), tr("Add steps"),
trackAndStepActionsToolBar->addAction(embed::getIconPixmap("step_btn_add"), tr("Add steps"),
m_trackContainerView, SLOT( addSteps()));
m_toolBar->addAction( embed::getIconPixmap( "step_btn_duplicate" ), tr( "Clone Steps" ),
trackAndStepActionsToolBar->addAction( embed::getIconPixmap( "step_btn_duplicate" ), tr( "Clone Steps" ),
m_trackContainerView, SLOT( cloneSteps() ) );
m_toolBar->addSeparator();

connect( &tc->m_bbComboBoxModel, SIGNAL( dataChanged() ),
m_trackContainerView, SLOT( updatePosition() ) );


QAction* viewNext = new QAction(this);
connect(viewNext, SIGNAL(triggered()), m_bbComboBox, SLOT(selectNext()));
viewNext->setShortcut(Qt::Key_Plus);
Expand Down
27 changes: 22 additions & 5 deletions src/gui/editors/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,27 @@ void Editor::setPauseIcon(bool displayPauseIcon)
m_playAction->setIcon(embed::getIconPixmap("play"));
}

DropToolBar * Editor::addDropToolBarToTop(QString const & windowTitle)
{
return addDropToolBar(Qt::TopToolBarArea, windowTitle);
}

DropToolBar * Editor::addDropToolBar(Qt::ToolBarArea whereToAdd, QString const & windowTitle)
{
return addDropToolBar(this, whereToAdd, windowTitle);
}

DropToolBar * Editor::addDropToolBar(QWidget * parent, Qt::ToolBarArea whereToAdd, QString const & windowTitle)
{
DropToolBar *toolBar = new DropToolBar(parent);
addToolBar(whereToAdd, toolBar);
toolBar->setMovable(false);
toolBar->setFloatable(false);
toolBar->setWindowTitle(windowTitle);

return toolBar;
}

void Editor::togglePlayStop()
{
if (Engine::getSong()->isPlaying())
Expand All @@ -57,8 +78,7 @@ Editor::Editor(bool record) :
m_recordAccompanyAction(nullptr),
m_stopAction(nullptr)
{
m_toolBar->setContextMenuPolicy(Qt::PreventContextMenu);
m_toolBar->setMovable(false);
m_toolBar = addDropToolBarToTop(tr("Transport controls"));

auto addButton = [this](QAction* action, QString objectName) {
m_toolBar->addAction(action);
Expand All @@ -79,9 +99,6 @@ Editor::Editor(bool record) :
connect(m_stopAction, SIGNAL(triggered()), this, SLOT(stop()));
new QShortcut(Qt::Key_Space, this, SLOT(togglePlayStop()));

// Add toolbar to window
addToolBar(Qt::TopToolBarArea, m_toolBar);

// Add actions to toolbar
addButton(m_playAction, "playButton");
if (record)
Expand Down
Loading