5#ifndef DGUIAPPLICATIONHELPER_H
6#define DGUIAPPLICATIONHELPER_H
8#include <dtkgui_global.h>
12#include <QGuiApplication>
19class DGuiApplicationHelperPrivate;
25 Q_PROPERTY(ColorType themeType READ themeType NOTIFY themeTypeChanged)
26 Q_PROPERTY(ColorType paletteType READ paletteType WRITE setPaletteType NOTIFY paletteTypeChanged)
27 Q_PROPERTY(
bool hasUserManual READ hasUserManual)
45 UseInactiveColorGroup = 1 << 0,
46 ColorCompositing = 1 << 1,
49 ReadOnlyLimit = 1 << 22,
50 IsDeepinPlatformTheme = ReadOnlyLimit << 0,
51 IsDXcbPlatform = ReadOnlyLimit << 1,
52 IsXWindowPlatform = ReadOnlyLimit << 2,
53 IsTableEnvironment = ReadOnlyLimit << 3,
54 IsDeepinEnvironment = ReadOnlyLimit << 4,
55 IsSpecialEffectsEnvironment = ReadOnlyLimit << 5
58 Q_DECLARE_FLAGS(Attributes, Attribute)
61 D_DECL_DEPRECATED
static void registerInstanceCreator(HelperCreator creator);
65 static QColor adjustColor(
const QColor &base, qint8 hueFloat, qint8 saturationFloat, qint8 lightnessFloat,
66 qint8 redFloat, qint8 greenFloat, qint8 blueFloat, qint8 alphaFloat);
67 static QImage adjustColor(
const QImage &base, qint8 hueFloat, qint8 saturationFloat, qint8 lightnessFloat,
68 qint8 redFloat, qint8 greenFloat, qint8 blueFloat, qint8 alphaFloat);
69 static QColor blendColor(
const QColor &substrate,
const QColor &superstratum);
70 static DPalette standardPalette(ColorType type);
71 static void generatePaletteColor(
DPalette &base, QPalette::ColorRole role, ColorType type);
72 static void generatePaletteColor(
DPalette &base, DPalette::ColorType role, ColorType type);
73 static void generatePalette(
DPalette &base, ColorType type = UnknownType);
75 Q_DECL_DEPRECATED_X(
"Use UseInactiveColorGroup enum with setAttribute.")
static void setUseInactiveColorGroup(
bool on);
76 Q_DECL_DEPRECATED_X(
"Use ColorCompositing enum with setAttribute.")
static void setColorCompositingEnabled(
bool on);
77 static bool isXWindowPlatform();
78 static bool isTabletEnvironment();
79 static bool isSpecialEffectsEnvironment();
80 static void setAttribute(Attribute attribute,
bool enable);
81 static bool testAttribute(Attribute attribute);
85 D_DECL_DEPRECATED
DPlatformTheme *windowTheme(QWindow *window)
const;
88 void setApplicationPalette(
const DPalette &palette);
89 D_DECL_DEPRECATED
DPalette windowPalette(QWindow *window)
const;
93 static ColorType toColorType(
const QColor &color);
94 static ColorType toColorType(
const QPalette &palette);
95 ColorType themeType()
const;
96 ColorType paletteType()
const;
98 static bool setSingleInstance(
const QString &key, SingleScope singleScope = UserScope);
99 static void setSingleInstanceInterval(
int interval = 3000);
100 D_DECL_DEPRECATED
static void setSingelInstanceInterval(
int interval = 3000);
102 bool hasUserManual()
const;
105 D_DECL_DEPRECATED_X(
"Plase use setPaletteType")
void setThemeType(ColorType themeType);
106 void setPaletteType(ColorType paletteType);
107 void handleHelpAction();
108 static void openUrl(
const QString &url);
111 void themeTypeChanged(ColorType themeType);
112 void paletteTypeChanged(ColorType paletteType);
113 void newProcessInstance(qint64 pid,
const QStringList &arguments);
114 void fontChanged(
const QFont &font);
115 void applicationPaletteChanged();
119 virtual void initialize();
122 D_PRIVATE_SLOT(
void _q_initApplicationTheme(
bool))
字体大小设置的一个类,系统默认只设置T6.
Definition: dfontmanager.h:18
DGuiApplicationHelper 应用程序的 GUI ,如主题、调色板等.
Definition: dguiapplicationhelper.h:21
DPalette提供了修改的 QPalette 类.
Definition: dpalette.h:17
Definition: dguiapplicationhelper.cpp:108