From 21024692b05831827af85d8d2c9e2878abf8cc2c Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Wed, 22 Jul 2015 17:51:39 +0200 Subject: [PATCH] Fixed playlist not resign after showing search filters --- src/sidebarwidget.cpp | 6 +++++- src/sidebarwidget.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.5