Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 9f31c733 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

UI: Don't set the vertical scroll bar in the visualizer and always scroll that...

UI: Don't set the vertical scroll bar in the visualizer and always scroll that widget to the bottom as the higher frequencies will likely be black pixels
parent 0d3f1eb9
Branches
Aucune étiquette associée trouvée
1 requête de fusion!6Add document views
......@@ -24,6 +24,9 @@ TimingView::TimingView(QImage img, quint64 soundLength, QWidget *parent) noexcep
setFixedHeight(img.height());
setMaximumHeight(img.height() + horizontalScrollBar()->height() - TO_ADD_TO_IMAGE_HEIGHT);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
QObject::connect(verticalScrollBar(), &QScrollBar::rangeChanged, this,
&TimingView::moveScrollBarToBottom);
setScene(scene);
}
......@@ -43,3 +46,9 @@ TimingView::mousePressEvent(QMouseEvent *event) noexcept
QGraphicsView::mousePressEvent(event);
}
void
TimingView::moveScrollBarToBottom(int, int max) noexcept
{
verticalScrollBar()->setValue(max);
}
......@@ -31,6 +31,7 @@ private:
public slots:
void mousePressEvent(QMouseEvent *event) noexcept;
void moveScrollBarToBottom(int, int) noexcept;
};
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter