]> git.sur5r.net Git - minitube/blobdiff - src/homeview.cpp
New upstream version 2.9
[minitube] / src / homeview.cpp
index c64f89181e0314415b8297a2086da19335d8f45b..a8f061b7f40e4dd575e500e5b5a9f167d8f688f8 100644 (file)
@@ -46,7 +46,7 @@ HomeView::HomeView(QWidget *parent) : View(parent),
     stackedWidget = new QStackedWidget();
     layout->addWidget(stackedWidget);
 
-    searchView = new SearchView();
+    searchView = new SearchView(this);
     connect(searchView, SIGNAL(search(SearchParams*)),
             MainWindow::instance(), SLOT(showMedia(SearchParams*)));
     stackedWidget->addWidget(searchView);
@@ -76,7 +76,8 @@ void HomeView::setupBar() {
     connect(ChannelAggregator::instance(), SIGNAL(unwatchedCountChanged(int)),
             SLOT(unwatchedCountChanged(int)));
 
-    foreach (QAction* action, bar->actions()) {
+    const auto a = bar->actions();
+    for (QAction* action : a) {
         addAction(action);
         IconUtils::setupAction(action);
     }
@@ -90,11 +91,16 @@ void HomeView::showWidget(QWidget *widget) {
     stackedWidget->setCurrentWidget(widget);
     widget->setEnabled(true);
     QMetaObject::invokeMethod(widget, "appear");
-    widget->setFocus();
+    QTimer::singleShot(0, widget, SLOT(setFocus()));
+
+#ifdef APP_MAC
+    // Workaround cursor bug on macOS
+    window()->unsetCursor();
+#endif
 }
 
 void HomeView::appear() {
-    QMetaObject::invokeMethod(stackedWidget->currentWidget(), "appear");
+    QMetaObject::invokeMethod(stackedWidget->currentWidget(), "appear", Qt::QueuedConnection);
 }
 
 void HomeView::disappear() {