From 7baac67149a68b66087c5d688dbeda2869485765 Mon Sep 17 00:00:00 2001 From: Michal Labedzki Date: Sat, 5 Dec 2015 16:22:09 +0100 Subject: [PATCH] Qt: Try to fix Main Welcome Interfaces List Scrollbar Bug: 11733 Change-Id: Ic144634acce7b9e9eb9821ca6452694cb2dcf4dd Reviewed-on: https://code.wireshark.org/review/12684 Petri-Dish: Michal Labedzki Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo Reviewed-by: Michal Labedzki --- ui/qt/accordion_frame.cpp | 6 ++++-- ui/qt/accordion_frame.h | 3 ++- ui/qt/main_welcome.cpp | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/qt/accordion_frame.cpp b/ui/qt/accordion_frame.cpp index 9a0e7b3559..87d7c31ac4 100644 --- a/ui/qt/accordion_frame.cpp +++ b/ui/qt/accordion_frame.cpp @@ -50,7 +50,7 @@ AccordionFrame::AccordionFrame(QWidget *parent) : animation_ = new QPropertyAnimation(this, "maximumHeight", this); animation_->setDuration(duration_); animation_->setEasingCurve(QEasingCurve::InOutQuad); - connect(animation_, SIGNAL(finished()), this, SLOT(animationFinished())); + connect(animation_, SIGNAL(finished()), this, SLOT(animationFinish())); } void AccordionFrame::animatedShow() @@ -98,12 +98,14 @@ void AccordionFrame::animatedHide() } } -void AccordionFrame::animationFinished() +void AccordionFrame::animationFinish() { if (animation_->currentValue().toInt() < 1) { hide(); setMaximumHeight(frame_height_); } + + emit animationFinished(); } /* diff --git a/ui/qt/accordion_frame.h b/ui/qt/accordion_frame.h index 778b86d1d6..ce484ff028 100644 --- a/ui/qt/accordion_frame.h +++ b/ui/qt/accordion_frame.h @@ -36,6 +36,7 @@ public: signals: void visibilityChanged(bool visible); + void animationFinished(); protected: virtual void hideEvent(QHideEvent *) { emit visibilityChanged(false); } @@ -46,7 +47,7 @@ private: QPropertyAnimation *animation_; private slots: - void animationFinished(); + void animationFinish(); }; diff --git a/ui/qt/main_welcome.cpp b/ui/qt/main_welcome.cpp index 4eb08a17ee..521c2aa6a9 100644 --- a/ui/qt/main_welcome.cpp +++ b/ui/qt/main_welcome.cpp @@ -176,6 +176,8 @@ MainWelcome::MainWelcome(QWidget *parent) : connect(welcome_ui_->captureFilterComboBox, SIGNAL(startCapture()), this, SIGNAL(startCapture())); connect(recent_files_, SIGNAL(itemActivated(QListWidgetItem *)), this, SLOT(openRecentItem(QListWidgetItem *))); + connect(welcome_ui_->openFrame, SIGNAL(animationFinished()), + welcome_ui_->interfaceTree, SLOT(reset())); updateRecentFiles(); #if !defined(Q_OS_MAC) || QT_VERSION > QT_VERSION_CHECK(5, 0, 0) @@ -317,6 +319,7 @@ void MainWelcome::resizeEvent(QResizeEvent *event) // event->accept(); QFrame::resizeEvent(event); + welcome_ui_->interfaceTree->reset(); } void MainWelcome::changeEvent(QEvent* event)