mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 14:46:33 +02:00
Explicitly hide inactive view pages
This commit is contained in:
@@ -673,8 +673,14 @@ ViewManager::setPage( ViewPage* page, bool trackHistory )
|
|||||||
connect( obj, SIGNAL( destroyed( QWidget* ) ), SLOT( onWidgetDestroyed( QWidget* ) ), Qt::UniqueConnection );
|
connect( obj, SIGNAL( destroyed( QWidget* ) ), SLOT( onWidgetDestroyed( QWidget* ) ), Qt::UniqueConnection );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWidget *previousPage = m_stack->currentWidget();
|
||||||
|
|
||||||
m_stack->setCurrentWidget( page->widget() );
|
m_stack->setCurrentWidget( page->widget() );
|
||||||
|
|
||||||
|
//This should save the CPU cycles, especially with pages like the visualizer
|
||||||
|
if(previousPage && previousPage != page->widget())
|
||||||
|
previousPage->hide();
|
||||||
|
|
||||||
updateView();
|
updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user