| 1 |
/* |
| 2 |
* |
| 3 |
* Copyright (C) 2023, KylinSoft Co., Ltd. |
| 4 |
* |
| 5 |
* This library is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU Lesser General Public |
| 7 |
* License as published by the Free Software Foundation; either |
| 8 |
* version 3 of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This library is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* Lesser General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this library. If not, see <https://www.gnu.org/licenses/>. |
| 17 |
* |
| 18 |
* Authors: Zhenyu Wang <[email protected]> |
| 19 |
* |
| 20 |
*/ |
| 21 |
|
| 22 |
#include <QCoreApplication> |
| 23 |
#include <QDebug> |
| 24 |
#include "../src/kthememanager.h" |
| 25 |
|
| 26 |
int main(int argc, char *argv[]) |
| 27 |
{ |
| 28 |
QCoreApplication a(argc, argv); |
| 29 |
|
| 30 |
kdk::KThemeManager manager; |
| 31 |
|
| 32 |
QObject::connect(&manager, &kdk::KThemeManager::changed, [=](const QString property){ |
| 33 |
qDebug() << property << "changed"; |
| 34 |
}); |
| 35 |
|
| 36 |
qDebug() << "UKCC Global Theme: " << manager.getUkccGlobalTheme(); |
| 37 |
|
| 38 |
qDebug() << "Support style: " << manager.getSupportSystemStyle(); |
| 39 |
|
| 40 |
qDebug() << "System font: " << manager.getSystemFont(); |
| 41 |
|
| 42 |
qDebug() << "System font size: " << manager.getSystemFontSize(); |
| 43 |
|
| 44 |
qDebug() << "System color: " << manager.getSystemThemeColor(); |
| 45 |
|
| 46 |
qDebug() << "Set system style: " << manager.setSystemStyle("ukui-default"); |
| 47 |
|
| 48 |
qDebug() << "Set system font: " << manager.setSystemFont("Noto Sans CJK SC"); |
| 49 |
|
| 50 |
qDebug() << "Set system font size: " << manager.setSystemFontSize(12); |
| 51 |
|
| 52 |
qDebug() << "Set theme color: " << manager.setSystemThemeColor("daybreakBlue"); |
| 53 |
|
| 54 |
qDebug() << "Set panel special effect: " << manager.setPanelSpecialEffect(true); |
| 55 |
|
| 56 |
qDebug() << "Set transparency: " << manager.setTransparency(0.70); |
| 57 |
|
| 58 |
return a.exec(); |
| 59 |
} |