mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Wait before controls appear on AllPlot
This commit is contained in:
@@ -80,6 +80,7 @@ AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) :
|
||||
revealBackground = new QWidget(this);
|
||||
revealControls = new QWidget(this);
|
||||
revealControls->setFixedHeight(50);
|
||||
revealControls->setStyleSheet("background-color: rgba(100%, 100%, 100%, 100%)");
|
||||
revealBackground->setStyleSheet("background-color: rgba(100%, 100%, 100%, 100%)");
|
||||
revealControls->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
@@ -90,6 +91,9 @@ AllPlotWindow::AllPlotWindow(MainWindow *mainWindow) :
|
||||
unrevealAnim = new QPropertyAnimation(revealBackground, "geometry");
|
||||
unrevealAnim->setDuration(250);
|
||||
|
||||
showTimer = new QTimer();
|
||||
connect(showTimer, SIGNAL(timeout()), this, SLOT(showRevealControls()));
|
||||
|
||||
// reveal controls
|
||||
rSmooth = new QLabel(tr("Smooth"), revealControls);
|
||||
rSmoothEdit = new QLineEdit(revealControls);
|
||||
@@ -1690,3 +1694,9 @@ AllPlotWindow:: resizeEvent(QResizeEvent *)
|
||||
unrevealAnim->setKeyValueAt(0.5, QRect(2, contentsMargins().top(), width()-4, 45));
|
||||
unrevealAnim->setKeyValueAt(1, QRect(2, contentsMargins().top(), width()-4, 0));
|
||||
}
|
||||
|
||||
void
|
||||
AllPlotWindow:: showRevealControls()
|
||||
{
|
||||
revealControls->show();
|
||||
}
|
||||
|
||||
@@ -130,8 +130,8 @@ class AllPlotWindow : public GcWindow
|
||||
|
||||
// reveal
|
||||
bool hasReveal() { return true; }
|
||||
void reveal() { revealControls->show(); revealAnim->start(); }
|
||||
void unreveal() { unrevealAnim->start(); revealControls->hide(); }
|
||||
void reveal() { showTimer->start(500); revealAnim->start(); } //
|
||||
void unreveal() { unrevealAnim->start(); revealControls->hide(); showTimer->stop();}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -192,6 +192,7 @@ class AllPlotWindow : public GcWindow
|
||||
*revealBackground;
|
||||
QPropertyAnimation *revealAnim,
|
||||
*unrevealAnim;
|
||||
QTimer *showTimer;
|
||||
QLabel *rSmooth;
|
||||
QSlider *rSmoothSlider;
|
||||
QLineEdit *rSmoothEdit;
|
||||
@@ -218,6 +219,8 @@ class AllPlotWindow : public GcWindow
|
||||
|
||||
void plotPickerMoved(const QPoint &);
|
||||
void plotPickerSelected(const QPoint &);
|
||||
|
||||
void showRevealControls();
|
||||
};
|
||||
|
||||
#endif // _GC_AllPlotWindow_h
|
||||
|
||||
Reference in New Issue
Block a user