Wait before controls appear on AllPlot

This commit is contained in:
Damien
2013-01-26 16:15:34 +01:00
parent 9ce5f1207f
commit 5f9d8cf3a9
2 changed files with 15 additions and 2 deletions

View File

@@ -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();
}

View File

@@ -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