Commit 64b95b30 authored by Michael Pyne's avatar Michael Pyne
Browse files

ui: Fix bug in scrolling from playlist to search line.

When the search filter was activated then the test for being the topmost
item would be wrong (there would be a topmost item but it's probably
filtered out!). Instead use the existing check for the *visible* item,
which wasn't even reached by the buggy code.
parent b70139c9
Pipeline #15227 passed with stage
in 9 minutes and 53 seconds
......@@ -790,10 +790,9 @@ bool Playlist::eventFilter(QObject *watched, QEvent *e)
void Playlist::keyPressEvent(QKeyEvent *event)
{
if(event->key() == Qt::Key_Up) {
const auto topItem = topLevelItem(0);
if(topItem && topItem == currentItem()) {
if(const auto activeItem = currentItem()) {
QTreeWidgetItemIterator visible(this, QTreeWidgetItemIterator::NotHidden);
if(topItem == *visible) {
if(activeItem == *visible) {
emit signalMoveFocusAway();
event->accept();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment