#include "mainwindow.h"
#include "mediaview.h"
#include "ytstandardfeed.h"
-#include "utils.h"
+#include "iconutils.h"
#include "channelaggregator.h"
#ifdef APP_MAC
#include "macutils.h"
#endif
-HomeView::HomeView(QWidget *parent) : QWidget(parent),
+HomeView::HomeView(QWidget *parent) : View(parent),
standardFeedsView(0),
channelsView(0) {
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);
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);
- Utils::setupAction(action);
+ IconUtils::setupAction(action);
}
}
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() {