-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
84 lines (69 loc) · 2.41 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QParallelAnimationGroup>
#include <QPropertyAnimation>
#include <QPushButton>
#include <QShowEvent>
QT_BEGIN_NAMESPACE
class QGraphicsOpacityEffect;
class QGraphicsView;
QT_END_NAMESPACE
class ToolButton;
class GraphicsView;
class NavigatorView;
class BottomButtonGroup;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow() override;
void showUrls(const QList<QUrl> &urls);
void adjustWindowSizeBySceneRect();
QUrl currentImageFileUrl();
void clearGallery();
void loadGalleryBySingleLocalFile(const QString &path);
void galleryPrev();
void galleryNext();
bool isGalleryAvailable();
signals:
void galleryLoaded();
protected slots:
void showEvent(QShowEvent *event) override;
void enterEvent(QEvent *event) override;
void leaveEvent(QEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
void wheelEvent(QWheelEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void contextMenuEvent(QContextMenuEvent *event)override;
QSize sizeHint() const override;
void centerWindow();
void closeWindow();
void updateWidgetsPosition();
void toggleProtectMode();
void toggleStayOnTop();
bool stayOnTop();
void quitAppAction(bool force = false);
void toggleFullscreen(); // 全屏/正常
void toggleMaximize();
private:
QPoint m_oldMousePos;
QPropertyAnimation *m_fadeOutAnimation;
QPropertyAnimation *m_floatUpAnimation;
QParallelAnimationGroup *m_exitAnimationGroup;
ToolButton *m_closeButton;
ToolButton *m_prevButton;
ToolButton *m_nextButton;
GraphicsView *m_graphicsView;
NavigatorView *m_gv;
BottomButtonGroup *m_bottomButtonGroup;
bool m_protectMode = false;
bool m_clickedOnWindow = false;
QList<QUrl> m_files;
int m_currentFileIndex = -1;
};
#endif // MAINWINDOW_H