-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathmainwindow.h
47 lines (40 loc) · 1.14 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <DMainWindow>
#include <DListView>
#include <DButtonBox>
#include <QStackedWidget>
#include <QKeyEvent>
#include <QSystemTrayIcon>
#include "pages/itempage.h"
#include "backend/sourcemanager.h"
DWIDGET_USE_NAMESPACE
class MainWindow : public DMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
void openItem(App *app);
void setUpdateIndicatorVisible(bool value);
DListView *navView = new DListView;
QStandardItemModel *navModel = new QStandardItemModel;
private:
void initNav();
void initTitlebar();
void addPage(QString name, QString icon, QWidget *widget);
void updateIcons();
QStackedWidget *stackedWidget;
QHash<QString, QString> pageIcons;
QHash<QString, ItemPage*> itemPageList;
DViewItemAction *updateIndicator;
QList<QWidget*> pageHistory;
int pageHistoryIndex = 0;
DButtonBoxButton *backButton;
DButtonBoxButton *forwardButton;
bool buttonNavigated = false;
QSystemTrayIcon *trayIcon;
QWidget *updatesPage;
protected Q_SLOTS:
void closeEvent(QCloseEvent *event);
};
#endif // MAINWINDOW_H