From 3dae0a2fe3daf82085fe53fb43035d8e8337a9db Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Fri, 21 Mar 2014 07:15:45 +0000 Subject: [PATCH] Less event processing in HomeWindow .. was trapping too many events, even when not visible .. also went back to multishot timer for unreveal but stop it when the unreveal even happens. --- src/GoldenCheetah.cpp | 5 +++-- src/HomeWindow.cpp | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/GoldenCheetah.cpp b/src/GoldenCheetah.cpp index e2362f3a6..8c3f6cd69 100644 --- a/src/GoldenCheetah.cpp +++ b/src/GoldenCheetah.cpp @@ -821,13 +821,14 @@ GcChartWindow:: reveal() void GcChartWindow:: unreveal() { _unrevealAnim->start(); - _unrevealTimer->setSingleShot(150); - //_unrevealTimer->start(150); + //_unrevealTimer->setSingleShot(150); + _unrevealTimer->start(150); } void GcChartWindow:: hideRevealControls() { _revealControls->hide(); + _unrevealTimer->stop(); } void GcChartWindow:: saveImage() diff --git a/src/HomeWindow.cpp b/src/HomeWindow.cpp index 40f6cc662..91b9a67e0 100644 --- a/src/HomeWindow.cpp +++ b/src/HomeWindow.cpp @@ -230,7 +230,7 @@ void HomeWindow::rideSelected() { // we need to notify of null rides immediately - if (!myRideItem || amVisible()) { + if (!myRideItem || isVisible()) { for (int i=0; i < charts.count(); i++) { // show if its not a tab @@ -250,7 +250,7 @@ HomeWindow::rideSelected() void HomeWindow::dateRangeChanged(DateRange dr) { Q_UNUSED( dr ) - if (amVisible()) { + if (isVisible()) { for (int i=0; i < charts.count(); i++) { @@ -720,7 +720,7 @@ HomeWindow::resizeEvent(QResizeEvent * /* e */) bool HomeWindow::eventFilter(QObject *object, QEvent *e) { - if (isHidden()) return false; // ignore when we aren't visible + if (!isVisible()) return false; // ignore when we aren't visible // mouse moved and tabbed -- should we show/hide chart popup controls? if (e->type() == QEvent::MouseMove && currentStyle == 0 && tabbed->currentIndex() >= 0) { @@ -756,6 +756,8 @@ HomeWindow::eventFilter(QObject *object, QEvent *e) } } + //qDebug()<type(); + // we watch the mouse when // dropping charts, to update // the cursor position