| 1 |
/* |
| 2 |
* Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co., Ltd. |
| 3 |
* |
| 4 |
* Author: ZhangYong <[email protected]> |
| 5 |
* |
| 6 |
* Maintainer: ZhangYong <[email protected]> |
| 7 |
* |
| 8 |
* This program is free software: you can redistribute it and/or modify |
| 9 |
* it under the terms of the GNU General Public License as published by |
| 10 |
* the Free Software Foundation, either version 3 of the License, or |
| 11 |
* any later version. |
| 12 |
* |
| 13 |
* This program is distributed in the hope that it will be useful, |
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
* GNU General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU General Public License |
| 19 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 |
*/ |
| 21 |
#ifndef THEMEWIDGET_H |
| 22 |
#define THEMEWIDGET_H |
| 23 |
|
| 24 |
#include "controller/viewerthememanager.h" |
| 25 |
|
| 26 |
#include <QWidget> |
| 27 |
#include <QScrollArea> |
| 28 |
#include <DScrollArea> |
| 29 |
#include <QFile> |
| 30 |
|
| 31 |
class ThemeWidget : public QWidget |
| 32 |
{ |
| 33 |
Q_OBJECT |
| 34 |
public: |
| 35 |
ThemeWidget(const QString &darkFile, const QString &lightFile, |
| 36 |
QWidget *parent = nullptr); |
| 37 |
~ThemeWidget(); |
| 38 |
|
| 39 |
public slots: |
| 40 |
void onThemeChanged(ViewerThemeManager::AppTheme theme); |
| 41 |
// bool isDeepMode(); |
| 42 |
private: |
| 43 |
QString m_darkStyle; |
| 44 |
QString m_lightStyle; |
| 45 |
bool m_deepMode; |
| 46 |
}; |
| 47 |
|
| 48 |
//TODO: if a widget Multiple Inheritance from ThemeWidget and |
| 49 |
// QScrollArea. warning(QWidget is an ambiguous base). |
| 50 |
//class ThemeScrollArea : public QScrollArea |
| 51 |
//{ |
| 52 |
// Q_OBJECT |
| 53 |
//public: |
| 54 |
// ThemeScrollArea(const QString &darkFile, const QString &lightFile, |
| 55 |
// QWidget *parent = nullptr); |
| 56 |
// ~ThemeScrollArea(); |
| 57 |
|
| 58 |
//public slots: |
| 59 |
// void onThemeChanged(ViewerThemeManager::AppTheme theme); |
| 60 |
// bool isDeepMode(); |
| 61 |
//private: |
| 62 |
// QString m_darkStyle; |
| 63 |
// QString m_lightStyle; |
| 64 |
// bool m_deepMode; |
| 65 |
//}; |
| 66 |
#endif // THEMEWIDGET_H |