mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Focusing the current comics view allows to use keyboard arrow keys to choose among the visible comics. The shortcut for this new action should not be a single character without modifiers because it won't work when the search line has focus. The Qt::FocusReason parameter in ComicsView::focusComicsNavigation() allows to reuse this function for other keyboard navigation features. For instance the search line can transfer focus to comics navigation when the user presses Return or Enter key. In this case Qt::OtherFocusReason can be used (an application-specific reason).
55 lines
1.5 KiB
C++
55 lines
1.5 KiB
C++
#ifndef INFOCOMICSVIEW_H
|
|
#define INFOCOMICSVIEW_H
|
|
|
|
#include "comics_view.h"
|
|
|
|
class QQuickView;
|
|
|
|
class YACReaderComicsSelectionHelper;
|
|
class YACReaderComicInfoHelper;
|
|
|
|
class InfoComicsView : public ComicsView
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit InfoComicsView(QWidget *parent = nullptr);
|
|
~InfoComicsView() override;
|
|
void setToolBar(QToolBar *toolBar) override;
|
|
void setModel(ComicModel *model) override;
|
|
void setCurrentIndex(const QModelIndex &index) override;
|
|
QModelIndex currentIndex() override;
|
|
QItemSelectionModel *selectionModel() override;
|
|
void scrollTo(const QModelIndex &mi, QAbstractItemView::ScrollHint hint) override;
|
|
void toFullScreen() override;
|
|
void toNormal() override;
|
|
void updateConfig(QSettings *settings) override;
|
|
void enableFilterMode(bool enabled) override;
|
|
void selectIndex(int index) override;
|
|
void updateCurrentComicView() override;
|
|
void focusComicsNavigation(Qt::FocusReason reason) override;
|
|
|
|
public slots:
|
|
void setShowMarks(bool show);
|
|
void selectAll() override;
|
|
|
|
protected slots:
|
|
void setCurrentIndex(int index);
|
|
|
|
bool canDropUrls(const QList<QUrl> &urls, Qt::DropAction action);
|
|
void droppedFiles(const QList<QUrl> &urls, Qt::DropAction action);
|
|
|
|
void requestedContextMenu(const QPoint &point);
|
|
|
|
void selectedItem(int index);
|
|
|
|
protected:
|
|
QToolBar *toolbar;
|
|
QObject *flow;
|
|
QObject *list;
|
|
|
|
YACReaderComicsSelectionHelper *selectionHelper;
|
|
YACReaderComicInfoHelper *comicInfoHelper;
|
|
};
|
|
|
|
#endif // INFOCOMICSVIEW_H
|