]> git.sur5r.net Git - minitube/commitdiff
Fixed playlist not resign after showing search filters
authorFlavio Tordini <flavio.tordini@gmail.com>
Wed, 22 Jul 2015 15:51:39 +0000 (17:51 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Wed, 22 Jul 2015 15:51:39 +0000 (17:51 +0200)
src/sidebarwidget.cpp
src/sidebarwidget.h

index 3149b470042a75f81925ec15ec9c415838a28747..676cf4fcbb15c1778c4f81a5efd08a919817538c 100644 (file)
@@ -31,7 +31,7 @@ QHash<QString, QAction*>* 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
index 2a1da99b90f26533e09070baae32840147902080..d936b979ac50a2a600ad692e3595ef5f070bb6ee 100644 (file)
@@ -70,6 +70,8 @@ private:
     QTimer *mouseTimer;
     QLabel *messageLabel;
     SidebarHeader *sidebarHeader;
+
+    int playlistWidth;
 };
 
 #endif // SIDEBARWIDGET_H