From 5f9d8cf3a9f455f5e698fcd5b4e2098a88848052 Mon Sep 17 00:00:00 2001 From: Damien Date: Sat, 26 Jan 2013 16:15:34 +0100 Subject: [PATCH] Wait before controls appear on AllPlot --- src/AllPlotWindow.cpp | 10 ++++++++++ src/AllPlotWindow.h | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/AllPlotWindow.cpp b/src/AllPlotWindow.cpp index 1405dc220..7bd537a0a 100644 --- a/src/AllPlotWindow.cpp +++ b/src/AllPlotWindow.cpp @@ -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(); +} diff --git a/src/AllPlotWindow.h b/src/AllPlotWindow.h index 124c14cf6..8bd8aea97 100644 --- a/src/AllPlotWindow.h +++ b/src/AllPlotWindow.h @@ -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