这是indexloc提供的服务,不要输入任何密码
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
29 changes: 12 additions & 17 deletions core_lib/interface/timecontrols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TimeControls::TimeControls(TimeLine *parent ) : QToolBar( parent )

mFpsBox = new QSpinBox();
mFpsBox->setFont( QFont("Helvetica", 10) );
mFpsBox->setFixedHeight(22);
mFpsBox->setFixedHeight(24);
mFpsBox->setValue(settings.value("fps").toInt());
mFpsBox->setMinimum(1);
mFpsBox->setMaximum(90);
Expand All @@ -43,7 +43,7 @@ TimeControls::TimeControls(TimeLine *parent ) : QToolBar( parent )

mLoopStartSpinBox = new QSpinBox();
mLoopStartSpinBox->setFont( QFont("Helvetica", 10) );
mLoopStartSpinBox->setFixedHeight(22);
mLoopStartSpinBox->setFixedHeight(24);
mLoopStartSpinBox->setValue(settings.value("loopStart").toInt());
mLoopStartSpinBox->setMinimum(1);
mLoopStartSpinBox->setMaximum(parent->getFrameLength() - 1);
Expand All @@ -52,7 +52,7 @@ TimeControls::TimeControls(TimeLine *parent ) : QToolBar( parent )

mLoopEndSpinBox= new QSpinBox();
mLoopEndSpinBox->setFont( QFont("Helvetica", 10) );
mLoopEndSpinBox->setFixedHeight(22);
mLoopEndSpinBox->setFixedHeight(24);
mLoopEndSpinBox->setValue( settings.value( "loopEnd" ).toInt() );
mLoopEndSpinBox->setMinimum(mLoopStartSpinBox->value() + 1);
mLoopEndSpinBox->setMaximum(parent->getFrameLength());
Expand All @@ -61,7 +61,7 @@ TimeControls::TimeControls(TimeLine *parent ) : QToolBar( parent )

mPlaybackRangeCheckBox = new QCheckBox( tr("Range") );
mPlaybackRangeCheckBox->setFont( QFont("Helvetica", 10) );
mPlaybackRangeCheckBox->setFixedHeight(26);
mPlaybackRangeCheckBox->setFixedHeight(24);
mPlaybackRangeCheckBox->setToolTip(tr("Playback range"));

mPlayButton = new QPushButton( this );
Expand All @@ -70,21 +70,17 @@ TimeControls::TimeControls(TimeLine *parent ) : QToolBar( parent )
mJumpToEndButton= new QPushButton();
mJumpToStartButton= new QPushButton();

QLabel* separator = new QLabel();
separator->setPixmap(QPixmap(":icons/controls/separator.png"));
separator->setFixedSize(QSize(37,31));

QIcon loopIcon(":icons/controls/loop.png");
QIcon soundIcon(":icons/controls/sound.png");
QIcon endplayIcon(":icons/controls/endplay.png");
QIcon startplayIcon(":icons/controls/startplay.png");
mLoopIcon = QIcon(":icons/controls/loop.png");
mSoundIcon = QIcon(":icons/controls/sound.png");
mJumpToEndIcon = QIcon(":icons/controls/endplay.png");
mJumpToStartIcon = QIcon(":icons/controls/startplay.png");
mStartIcon = QIcon(":icons/controls/play.png");
mStopIcon = QIcon(":icons/controls/stop.png");
mPlayButton->setIcon(mStartIcon);
mLoopButton->setIcon(loopIcon);
mSoundButton->setIcon(soundIcon);
mJumpToEndButton->setIcon(endplayIcon);
mJumpToStartButton->setIcon(startplayIcon);
mLoopButton->setIcon(mLoopIcon);
mSoundButton->setIcon(mSoundIcon);
mJumpToEndButton->setIcon(mJumpToEndIcon);
mJumpToStartButton->setIcon(mJumpToStartIcon);

mPlayButton->setToolTip(tr("Play"));
mLoopButton->setToolTip(tr("Loop"));
Expand All @@ -96,7 +92,6 @@ TimeControls::TimeControls(TimeLine *parent ) : QToolBar( parent )
mSoundButton->setCheckable(true);
mSoundButton->setChecked(true);

addWidget(separator);
addWidget(mJumpToStartButton);
addWidget(mPlayButton);
addWidget(mJumpToEndButton);
Expand Down
5 changes: 5 additions & 0 deletions core_lib/interface/timecontrols.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ public slots:

QIcon mStartIcon;
QIcon mStopIcon;
QIcon mLoopIcon;
QIcon mSoundIcon;
QIcon mJumpToEndIcon;
QIcon mJumpToStartIcon;


Editor* mEditor = nullptr;
};
Expand Down
53 changes: 24 additions & 29 deletions core_lib/interface/timeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,9 @@ void TimeLine::initUI()

QWidget* timeLineContent = new QWidget( this );

connect( editor(), &Editor::currentFrameChanged, this, &TimeLine::updateFrame );

mLayerList = new TimeLineCells( this, editor(), TIMELINE_CELL_TYPE::Layers );
mTracks = new TimeLineCells( this, editor(), TIMELINE_CELL_TYPE::Tracks );

connect( mLayerList, &TimeLineCells::mouseMovedY, mLayerList, &TimeLineCells::setMouseMoveY );
connect( mLayerList, &TimeLineCells::mouseMovedY, mTracks, &TimeLineCells::setMouseMoveY );
connect (mTracks, &TimeLineCells::lengthChanged, this, &TimeLine::updateLength );

mHScrollbar = new QScrollBar( Qt::Horizontal );
mVScrollbar = new QScrollBar( Qt::Vertical );
mVScrollbar->setMinimum( 0 );
Expand All @@ -69,9 +63,9 @@ void TimeLine::initUI()
QWidget* rightWidget = new QWidget();

QWidget* leftToolBar = new QWidget();
leftToolBar->setFixedHeight( 31 );
leftToolBar->setFixedHeight( 30 );
QWidget* rightToolBar = new QWidget();
rightToolBar->setFixedHeight( 31 );
rightToolBar->setFixedHeight( 30 );

// --- left widget ---
// --------- layer buttons ---------
Expand All @@ -93,9 +87,9 @@ void TimeLine::initUI()
layerButtons->addWidget( layerLabel );
layerButtons->addWidget( addLayerButton );
layerButtons->addWidget( removeLayerButton );
layerButtons->setFixedHeight(30);

QHBoxLayout* leftToolBarLayout = new QHBoxLayout();
leftToolBarLayout->setAlignment( Qt::AlignLeft );
leftToolBarLayout->setMargin( 0 );
leftToolBarLayout->addWidget( layerButtons );
leftToolBar->setLayout( leftToolBarLayout );
Expand All @@ -122,7 +116,7 @@ void TimeLine::initUI()

// --- right widget ---
// --------- key buttons ---------
QToolBar* keyButtons = new QToolBar( this );
QToolBar* timelineButtons = new QToolBar( this );
QLabel* keyLabel = new QLabel( tr( "Keys:" ) );
keyLabel->setFont( QFont( "Helvetica", 10 ) );
keyLabel->setIndent( 5 );
Expand All @@ -142,39 +136,34 @@ void TimeLine::initUI()
duplicateKeyButton->setToolTip( tr("Duplicate Frame") );
duplicateKeyButton->setFixedSize( 24, 24 );

keyButtons->addWidget( keyLabel );
keyButtons->addWidget( addKeyButton );
keyButtons->addWidget( removeKeyButton );
keyButtons->addWidget( duplicateKeyButton );



QToolBar* onionButtons = new QToolBar( this );

QLabel* onionLabel = new QLabel( tr( "Onion skin:" ) );
onionLabel->setFont( QFont( "Helvetica", 10 ) );
onionLabel->setIndent( 5 );


QToolButton* onionTypeButton = new QToolButton( this );
onionTypeButton->setIcon( QIcon( ":icons/onion_type.png" ) );
onionTypeButton->setToolTip( tr("Toggle match keyframes") );
onionTypeButton->setFixedSize( 24, 24 );

onionButtons->addWidget( onionLabel );
onionButtons->addWidget( onionTypeButton );
timelineButtons->addWidget( keyLabel );
timelineButtons->addWidget( addKeyButton );
timelineButtons->addWidget( removeKeyButton );
timelineButtons->addWidget( duplicateKeyButton );
timelineButtons->addSeparator();
timelineButtons->addWidget( onionLabel );
timelineButtons->addWidget( onionTypeButton );
timelineButtons->addSeparator();
timelineButtons->setFixedHeight(30);

// --------- Time controls ---------
mTimeControls = new TimeControls( this );
mTimeControls->setCore( editor() );
mTimeControls->initUI();
mTimeControls->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
updateLength();

QHBoxLayout* rightToolBarLayout = new QHBoxLayout();
rightToolBarLayout->addWidget( keyButtons );
rightToolBarLayout->addStretch( 1 );
rightToolBarLayout->addWidget( onionButtons );
rightToolBarLayout->addStretch( 1 );
rightToolBarLayout->addWidget( timelineButtons );
rightToolBarLayout->setAlignment(Qt::AlignLeft);
rightToolBarLayout->addWidget( mTimeControls );
rightToolBarLayout->setMargin( 0 );
rightToolBarLayout->setSpacing( 0 );
Expand Down Expand Up @@ -232,7 +221,13 @@ void TimeLine::initUI()
connect( newSoundLayerAct, &QAction::triggered, this, &TimeLine::newSoundLayer );
connect( newCameraLayerAct, &QAction::triggered, this, &TimeLine::newCameraLayer );
connect( removeLayerButton, &QPushButton::clicked, this, &TimeLine::deleteCurrentLayer );


connect( mLayerList, &TimeLineCells::mouseMovedY, mLayerList, &TimeLineCells::setMouseMoveY );
connect( mLayerList, &TimeLineCells::mouseMovedY, mTracks, &TimeLineCells::setMouseMoveY );
connect (mTracks, &TimeLineCells::lengthChanged, this, &TimeLine::updateLength );

connect( editor(), &Editor::currentFrameChanged, this, &TimeLine::updateFrame );

LayerManager* layer = editor()->layers();
connect( layer, &LayerManager::layerCountChanged, this, &TimeLine::updateLayerNumber );

Expand Down