]> git.sur5r.net Git - minitube/commitdiff
Less flicker and crossfades
authorFlavio Tordini <flavio.tordini@gmail.com>
Tue, 4 Aug 2015 19:16:31 +0000 (21:16 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Tue, 4 Aug 2015 19:16:31 +0000 (21:16 +0200)
src/mainwindow.cpp
src/searchview.cpp

index ce5bedd2391e37c481f0b373a92fa92ec0b8ec6e..cfafa38af2aa3b1bfc7d0b186f6104f72887970b 100644 (file)
@@ -162,7 +162,7 @@ MainWindow::MainWindow() :
         showActivationView(false);
 #endif
 
-    QTimer::singleShot(100, this, SLOT(lazyInit()));
+    QTimer::singleShot(0, this, SLOT(lazyInit()));
 }
 
 MainWindow::~MainWindow() {
@@ -225,6 +225,11 @@ void MainWindow::lazyInit() {
 
     // Hack to give focus to searchlineedit
     QMetaObject::invokeMethod(views->currentWidget(), "appear");
+    View* view = dynamic_cast<View *> (views->currentWidget());
+    QString desc = view->metadata().value("description").toString();
+    if (!desc.isEmpty()) showMessage(desc);
+
+    ChannelAggregator::instance()->start();
 }
 
 void MainWindow::changeEvent(QEvent *e) {
@@ -874,7 +879,8 @@ void MainWindow::showActionInStatusBar(QAction* action, bool show) {
 #endif
     if (show) {
         statusToolBar->insertAction(statusToolBar->actions().first(), action);
-        if (statusBar()->isHidden()) setStatusBarVisibility(true);
+        if (statusBar()->isHidden())
+            setStatusBarVisibility(true);
     } else {
         statusToolBar->removeAction(action);
         if (statusBar()->isVisible() && !needStatusBar())
@@ -941,11 +947,11 @@ void MainWindow::goBack() {
 }
 
 void MainWindow::showWidget(QWidget* widget, bool transition) {
+    Q_UNUSED(transition);
+
     if (compactViewAct->isChecked())
         compactViewAct->toggle();
 
-    setUpdatesEnabled(false);
-
     // call hide method on the current view
     View* oldView = dynamic_cast<View *> (views->currentWidget());
     if (oldView) {
@@ -992,20 +998,12 @@ void MainWindow::showWidget(QWidget* widget, bool transition) {
         adjustStatusBarVisibility();
         messageLabel->hide();
 
+        /*
         QString desc = metadata.value("description").toString();
         if (!desc.isEmpty()) showMessage(desc);
+        */
     }
 
-    setUpdatesEnabled(true);
-
-#ifdef APP_EXTRA
-    if (transition && (oldWidget != mediaView)) // || !mediaView->getVideoArea()->isVideoShown()
-    // if (transition)
-        Extra::fadeInWidget(oldWidget, widget);
-#else
-    Q_UNUSED(transition);
-#endif
-
     history->push(widget);
 }
 
@@ -1206,6 +1204,8 @@ void MainWindow::fullscreen() {
     if (compactViewAct->isChecked())
         compactViewAct->toggle();
 
+    m_fullscreen = !m_fullscreen;
+
 #ifdef APP_MAC
     WId handle = winId();
     if (mac::CanGoFullScreen(handle)) {
@@ -1215,8 +1215,6 @@ void MainWindow::fullscreen() {
     }
 #endif
 
-    m_fullscreen = !m_fullscreen;
-
     if (m_fullscreen) {
         // Enter full screen
 
index f72751bbafa9e50abcef4af389b8ebeedaed5561..d09c51e3ba749f194c1522c91992acd20ded9373 100644 (file)
@@ -197,14 +197,12 @@ SearchView::SearchView(QWidget *parent) : QWidget(parent) {
 }
 
 void SearchView::appear() {
-    setUpdatesEnabled(false);
+    MainWindow::instance()->showActionInStatusBar(The::globalActions()->value("definition"), true);
+
     updateRecentKeywords();
     updateRecentChannels();
     queryEdit->selectAll();
     queryEdit->enableSuggest();
-    setUpdatesEnabled(true);
-
-    MainWindow::instance()->showActionInStatusBar(The::globalActions()->value("definition"), true);
 
     if (!queryEdit->hasFocus()) queryEdit->setFocus();
 }