From: Flavio Tordini Date: Wed, 22 Jul 2015 15:51:39 +0000 (+0200) Subject: Fixed playlist not resign after showing search filters X-Git-Tag: 2.5~73 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=21024692b05831827af85d8d2c9e2878abf8cc2c;p=minitube Fixed playlist not resign after showing search filters --- diff --git a/src/sidebarwidget.cpp b/src/sidebarwidget.cpp index 3149b47..676cf4f 100644 --- a/src/sidebarwidget.cpp +++ b/src/sidebarwidget.cpp @@ -31,7 +31,7 @@ QHash* globalActions(); } SidebarWidget::SidebarWidget(QWidget *parent) : - QWidget(parent) { + QWidget(parent), playlistWidth(0) { playlist = 0; QBoxLayout *layout = new QVBoxLayout(this); @@ -94,6 +94,8 @@ void SidebarWidget::showPlaylist() { void SidebarWidget::showRefineSearchWidget() { if (!refineSearchWidget->isEnabled()) return; + playlistWidth = playlist->width(); + refineSearchWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); refineSearchWidget->setDirty(false); stackedWidget->setCurrentWidget(refineSearchWidget); // refineSearchWidget->setFocus(); @@ -105,6 +107,8 @@ void SidebarWidget::showRefineSearchWidget() { } void SidebarWidget::hideRefineSearchWidget() { + refineSearchWidget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); + playlist->resize(playlistWidth, playlist->height()); stackedWidget->setCurrentWidget(playlist); playlist->setFocus(); #ifdef APP_EXTRA diff --git a/src/sidebarwidget.h b/src/sidebarwidget.h index 2a1da99..d936b97 100644 --- a/src/sidebarwidget.h +++ b/src/sidebarwidget.h @@ -70,6 +70,8 @@ private: QTimer *mouseTimer; QLabel *messageLabel; SidebarHeader *sidebarHeader; + + int playlistWidth; }; #endif // SIDEBARWIDGET_H