Commit 368843ef authored by Paweł Wegner's avatar Paweł Wegner
Browse files

Cloudbrowser: disable focus when autoplaying.

parent 53f241fe
......@@ -75,10 +75,8 @@ Window::Window(QWidget* player_widget)
connect(this, &Window::hidePlayer, this,
[this]() {
stop();
if (container()) {
if (container())
container()->show();
container()->setFocus();
}
},
Qt::QueuedConnection);
connect(this, &Window::runListDirectory, this, [this]() { listDirectory(); },
......@@ -94,6 +92,7 @@ Window::Window(QWidget* player_widget)
if (type == IItem::FileType::Audio ||
type == IItem::FileType::Video ||
type == IItem::FileType::Image) {
emit currentItemChanged(i);
play(i);
break;
}
......
......@@ -29,7 +29,7 @@
#include <QAbstractListModel>
#include <QQuickImageProvider>
#include <QQuickView>
#include <QQuickWidget>
#include <QWidget>
#include <future>
#include <vlcpp/vlc.hpp>
......@@ -136,6 +136,7 @@ class Window : public QQuickView {
void runListDirectory();
void runClearDirectory();
void playNext();
void currentItemChanged(int index);
private:
friend class CloudProviderCallback;
......
......@@ -49,9 +49,10 @@ class MainWidget : public QWidget {
void keyPressEvent(QKeyEvent* e) {
QWidget::keyPressEvent(e);
if (e->isAccepted()) return;
if (e->key() == Qt::Key_Q)
if (e->key() == Qt::Key_Q) {
window_.stop();
else if (e->key() == Qt::Key_P)
container_->setFocus();
} else if (e->key() == Qt::Key_P)
window_.media_player().pause();
}
......
......@@ -71,6 +71,9 @@ Item {
onHidePlayer: {
directory.focus = true;
}
onCurrentItemChanged: {
directory.currentIndex = index;
}
}
ListView {
......
Supports Markdown
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