Skip to content

Commit

Permalink
LayerList: Cleanup obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
MrStevns committed Sep 25, 2024
1 parent e81831f commit 66eab40
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
4 changes: 0 additions & 4 deletions app/src/timeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,11 @@ void TimeLine::initUI()
connect(mTracks, &TimeLineTrackList::offsetChanged, mHScrollbar, &QScrollBar::setValue);

connect(mLayerScrollArea->verticalScrollBar(), &QScrollBar::valueChanged, mTracks, &TimeLineTrackList::vScrollChange);
connect(mLayerScrollArea->verticalScrollBar(), &QScrollBar::valueChanged, mLayerList, &TimeLineLayerList::vScrollChange);
connect(mLayerScrollArea->verticalScrollBar(), &QScrollBar::valueChanged, this, &TimeLine::onScrollbarValueChanged);

connect(mTrackScrollArea->verticalScrollBar(), &QScrollBar::valueChanged, mTracks, &TimeLineTrackList::vScrollChange);
connect(mTrackScrollArea->verticalScrollBar(), &QScrollBar::valueChanged, mLayerList, &TimeLineLayerList::vScrollChange);
connect(mTrackScrollArea->verticalScrollBar(), &QScrollBar::valueChanged, this, &TimeLine::onScrollbarValueChanged);

connect(mScrollingStoppedTimer, &QTimer::timeout, mLayerList, &TimeLineLayerList::onScrollingVerticallyStopped);

connect(splitter, &QSplitter::splitterMoved, this, &TimeLine::updateLength);

connect(addKeyButton, &QToolButton::clicked, this, &TimeLine::insertKeyClick);
Expand Down
14 changes: 1 addition & 13 deletions app/src/timelinelayerlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,6 @@ int TimeLineLayerList::getLayerGutterYPosition(int posY) const
return getLayerCellY(layerNumber);
}

void TimeLineLayerList::vScrollChange(int x)
{
Q_UNUSED(x)
mScrollingVertically = true;
updateContent();
}

void TimeLineLayerList::onScrollingVerticallyStopped()
{
mScrollingVertically = false;
}

void TimeLineLayerList::onCellDragged(const DragEvent& event, TimeLineLayerCellEditorWidget* editorWidget, int /*x*/, int y)
{
switch (event)
Expand Down Expand Up @@ -200,7 +188,7 @@ void TimeLineLayerList::onCellDragged(const DragEvent& event, TimeLineLayerCellE
int fromLayerDragY = getLayerCellY(mFromLayer);
int dragToNumber = getDragToLayerNumber(getLayerCellY(mFromLayer), mGutterPositionY);

if (!mScrollingVertically && dragToNumber != mFromLayer && dragToNumber > -1 && mGutterWidget->isVisible())
if (dragToNumber != mFromLayer && dragToNumber > -1 && mGutterWidget->isVisible())
{
if (dragToNumber < mEditor->layers()->count())
{
Expand Down
8 changes: 0 additions & 8 deletions app/src/timelinelayerlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class TimeLineLayerList : public QWidget

public slots:
void updateContent();
void vScrollChange(int);
void onScrollingVerticallyStopped();

protected:
void paintEvent(QPaintEvent* event) override;
Expand Down Expand Up @@ -77,12 +75,6 @@ private slots:
bool mRedrawContent = false;
int mLayerHeight = 20;

Qt::MouseButton mPrimaryButton = Qt::NoButton;

bool mScrollingVertically = false;

const static int mLayerDetachThreshold = 5;

QMap<int, TimeLineLayerCell*> mLayerCells;
TimeLineLayerCellGutterWidget* mGutterWidget = nullptr;
};
Expand Down

0 comments on commit 66eab40

Please sign in to comment.