From f7d58114b2192ac379bc775f8d2c4f672b6c9aa7 Mon Sep 17 00:00:00 2001 From: Vesa Date: Tue, 28 Jan 2014 22:16:25 +0200 Subject: [PATCH] Added object names for transport buttons (for theming purposes), fixed alignment issues on track labels --- data/themes/default/automation_track.png | Bin 586 -> 519 bytes data/themes/default/bb_track.png | Bin 681 -> 657 bytes data/themes/default/sample_track.png | Bin 893 -> 847 bytes data/themes/default/style.css | 11 ++++++++++ src/gui/AutomationEditor.cpp | 26 +++++++++++++---------- src/gui/MainWindow.cpp | 2 +- src/gui/bb_editor.cpp | 5 ++++- src/gui/piano_roll.cpp | 5 +++++ src/gui/song_editor.cpp | 19 +++++++++++------ src/gui/widgets/track_label_button.cpp | 2 +- 10 files changed, 49 insertions(+), 21 deletions(-) diff --git a/data/themes/default/automation_track.png b/data/themes/default/automation_track.png index d6193e4f6b6e228355b5f5c606569348f172b60c..a7480fd70fd6faa3dca4a9915d6e155a56a4500e 100644 GIT binary patch delta 507 zcmVnOfe+P6) zO+^RZ0UQ(y5GEtkYXATNrb$FWR7l5TU>F7D0u>b%c50ZzghhVTH|(dWnfW0He+LH+V$3lyF^R(!MC()Xrt`V_WV8MM&&=@mF9QP? zw=hFa*1E zT#Do55@JZmUBq_o_!V|1&)5b^zA)o*kIU&hG#K002ovPDHLkV1hv-<2V2S delta 553 zcmV+^0@nS91j+<4iBL{Q4GJ0x0000DNk~Le0000K0000K2nGNE0F8+q4FCWD1am@3 zR0s$N2z&@+h>;-}e;IT|SaefwW^{L9a%BK_cXuvnZfkR6VQ^(GZ*pgw?mQX*00GBI zL_t(Ijbr@(|33pY0Ta4_s;VkGRSaZgWMs6kuqY4~7I|Z4W)@D7fhHyFfcMO zF!(VsFfd>khK%jpQnOfe+P6) zO+^RZ0UQ(z3*!fiKmY&&FiAu~R7l6|m0fESK@^6cN%OT!Vm~BUn+m-XM8#O@jsCaN z-{zGUB^O>OLP5mDB<&{Iui4p|-5oFbVdEyjLcyE9aA08HGY{v?VGlg$e@k2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5>n~9#^61|{jl#O;VQO30G5YZ>llL~MMM*hc^ie}+rF>(J}x_RF;-G$OJ%C22<_+Yw1S zCha6-Q9{^^seZGSZr#571Ih+~e(+Cp0P=7@9G{%{s!%GvuCG01IdRbVsw3+pq<^$9 z3wJ{Ca?5Ysx%<=F%IZbnqN@JPF3Ii&TdURHK6GT@{X(fYV!iYOnwik-G&^gzf4}v8 zI;+*%04}TQx4U6IfdC>>15N`+fl7C~39JG?s%oPb?2*9#qrU-=*;w+>EAM3h0000< KMNUMnLSTZ * Copyright (c) 2008-2013 Paul Giblock * Copyright (c) 2006-2008 Javier Serrano Polo - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -156,10 +156,14 @@ AutomationEditor::AutomationEditor() : tr( "Play/pause current pattern (Space)" ), this, SLOT( play() ), m_toolBar ); + m_stopButton = new toolButton( embed::getIconPixmap( "stop" ), tr( "Stop playing of current pattern (Space)" ), this, SLOT( stop() ), m_toolBar ); + m_playButton->setObjectName( "playButton" ); + m_stopButton->setObjectName( "stopButton" ); + m_playButton->setWhatsThis( tr( "Click here if you want to play the current pattern. " "This is useful while editing it. The pattern is " @@ -277,7 +281,7 @@ AutomationEditor::AutomationEditor() : connect( &m_tensionModel, SIGNAL( dataChanged() ), this, SLOT( tensionChanged() ) ); - + tool_button_group = new QButtonGroup( this ); tool_button_group->addButton( m_discreteButton ); tool_button_group->addButton( m_linearButton ); @@ -524,7 +528,7 @@ void AutomationEditor::updateAfterPatternChange() } if( m_pattern->progressionType() == - AutomationPattern::DiscreteProgression && + AutomationPattern::DiscreteProgression && !m_discreteButton->isChecked() ) { m_discreteButton->setChecked( true ); @@ -763,20 +767,20 @@ void AutomationEditor::drawLine( int _x0, float _y0, int _x1, float _y1 ) float yscale = deltay / ( deltax ); - if( _x0 < _x1) + if( _x0 < _x1) { xstep = quantization(); } - else + else { xstep = -( quantization() ); } if( _y0 < _y1 ) { - ystep = 1; + ystep = 1; } - else + else { ystep = -1; } @@ -878,7 +882,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent * _me ) { // then set new value MidiTime value_pos( pos_ticks ); - + MidiTime new_time = m_pattern->putValue( value_pos, level ); @@ -1577,7 +1581,7 @@ void AutomationEditor::paintEvent( QPaintEvent * _pe ) is_selected ); } delete [] values; - + // Draw cross int y = yCoordOfLevel( it.value() ); p.drawLine( x - 1, y, x + 1, y ); @@ -1803,7 +1807,7 @@ void AutomationEditor::wheelEvent( QWheelEvent * _we ) m_timeLine->setPixelsPerTact( m_ppt ); update(); } - else if( _we->modifiers() & Qt::ShiftModifier + else if( _we->modifiers() & Qt::ShiftModifier || _we->orientation() == Qt::Horizontal ) { m_leftRightScroll->setValue( m_leftRightScroll->value() - @@ -2069,7 +2073,7 @@ void AutomationEditor::selectAll() const float level = it.value(); if( level < m_selectStartLevel ) { - // if we move start-level down, we have to add + // if we move start-level down, we have to add // the difference between old and new start-level // to m_selectedLevels, otherwise the selection // is just moved down... diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 8a92a5c76..c86975b3f 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -412,7 +412,7 @@ void MainWindow::finalize( void ) toolButton * bb_editor_window = new toolButton( - embed::getIconPixmap( "bb_track" ), + embed::getIconPixmap( "bb_track_btn" ), tr( "Show/hide Beat+Bassline Editor" ) + " (F6)", this, SLOT( toggleBBEditorWin() ), diff --git a/src/gui/bb_editor.cpp b/src/gui/bb_editor.cpp index a26094e80..ec6de9034 100644 --- a/src/gui/bb_editor.cpp +++ b/src/gui/bb_editor.cpp @@ -2,7 +2,7 @@ * bb_editor.cpp - basic main-window for editing of beats and basslines * * Copyright (c) 2004-2008 Tobias Doerffel - * + * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * * This program is free software; you can redistribute it and/or @@ -85,6 +85,9 @@ bbEditor::bbEditor( bbTrackContainer* tc ) : tr( "Stop playback of current beat/bassline (Space)" ), this, SLOT( stop() ), m_toolBar ); + m_playButton->setObjectName( "playButton" ); + m_stopButton->setObjectName( "stopButton" ); + toolButton * add_bb_track = new toolButton( embed::getIconPixmap( "add_bb_track" ), tr( "Add beat/bassline" ), diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index ddd450faa..4a9d8203e 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -331,6 +331,11 @@ pianoRoll::pianoRoll() : m_stopButton = new toolButton( embed::getIconPixmap( "stop" ), tr( "Stop playing of current pattern (Space)" ), this, SLOT( stop() ), m_toolBar ); + + m_playButton->setObjectName( "playButton" ); + m_stopButton->setObjectName( "stopButton" ); + m_recordButton->setObjectName( "recordButton" ); + m_recordAccompanyButton->setObjectName( "recordAccompanyButton" ); m_playButton->setWhatsThis( tr( "Click here to play the current pattern. " diff --git a/src/gui/song_editor.cpp b/src/gui/song_editor.cpp index 4a2205fbd..099204616 100644 --- a/src/gui/song_editor.cpp +++ b/src/gui/song_editor.cpp @@ -113,7 +113,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : this, SLOT( adjustUiAfterProjectLoad() ) ); - // add some essential widgets to global tool-bar + // add some essential widgets to global tool-bar QWidget * tb = engine::mainWindow()->toolBar(); engine::mainWindow()->addSpacingToToolBar( 10 ); @@ -153,7 +153,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : engine::mainWindow()->addWidgetToToolBar( m_timeSigDisplay ); engine::mainWindow()->addSpacingToToolBar( 10 ); - + QLabel * master_vol_lbl = new QLabel( tb ); master_vol_lbl->setPixmap( embed::getIconPixmap( "master_volume" ) ); @@ -239,7 +239,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : m_toolBar->setFixedHeight( 32 ); m_toolBar->setAutoFillBackground( true ); QPalette pal; - pal.setBrush( m_toolBar->backgroundRole(), + pal.setBrush( m_toolBar->backgroundRole(), embed::getIconPixmap( "toolbar_bg" ) ); m_toolBar->setPalette( pal ); @@ -255,19 +255,23 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : m_playButton = new toolButton( embed::getIconPixmap( "play" ), tr( "Play song (Space)" ), this, SLOT( play() ), m_toolBar ); + m_playButton->setObjectName( "playButton" ); m_recordButton = new toolButton( embed::getIconPixmap( "record" ), tr( "Record samples from Audio-device" ), this, SLOT( record() ), m_toolBar ); - m_recordAccompanyButton = new toolButton( + m_recordButton->setObjectName( "recordButton" ); + + m_recordAccompanyButton = new toolButton( embed::getIconPixmap( "record_accompany" ), tr( "Record samples from Audio-device while playing " "song or BB track" ), this, SLOT( recordAccompany() ), m_toolBar ); + m_recordAccompanyButton->setObjectName( "recordAccompanyButton" ); // FIXME: disable record button while it is not implemented m_recordButton->setDisabled( true ); - + // disable record buttons if capturing is not supported if( !engine::mixer()->audioDev()->supportsCapture() ) { @@ -278,6 +282,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : m_stopButton = new toolButton( embed::getIconPixmap( "stop" ), tr( "Stop song (Space)" ), this, SLOT( stop() ), m_toolBar ); + m_stopButton->setObjectName( "stopButton" ); m_addBBTrackButton = new toolButton( embed::getIconPixmap( "add_bb_track" ), @@ -566,7 +571,7 @@ void songEditor::wheelEvent( QWheelEvent * _we ) setPixelsPerTact( pixelsPerTact() ); // and make sure, all TCO's are resized and relocated realignTracks(); - } + } else if( engine::mainWindow()->isShiftPressed() == TRUE ) { m_leftRightScroll->setValue( m_leftRightScroll->value() - @@ -720,7 +725,7 @@ void songEditor::updatePosition( const MidiTime & _t ) trackOpWidth = TRACK_OP_WIDTH; } - if( ( m_s->isPlaying() && m_s->m_playMode == song::Mode_PlaySong + if( ( m_s->isPlaying() && m_s->m_playMode == song::Mode_PlaySong && m_timeLine->autoScroll() == timeLine::AutoScrollEnabled) || m_scrollBack == true ) { diff --git a/src/gui/widgets/track_label_button.cpp b/src/gui/widgets/track_label_button.cpp index 0080c090c..f26485701 100644 --- a/src/gui/widgets/track_label_button.cpp +++ b/src/gui/widgets/track_label_button.cpp @@ -58,7 +58,7 @@ trackLabelButton::trackLabelButton( trackView * _tv, QWidget * _parent ) : setFixedSize( 160, 29 ); } - setIconSize( QSize( 32, 32 ) ); + setIconSize( QSize( 24, 24 ) ); setText( " " ); connect( m_trackView->getTrack(), SIGNAL( dataChanged() ),