Skip to content

Commit 3a55b95

Browse files
authored
fix: [Font-size] The Font size can not change by dde-control-center. (#1105)
-- Dtk enables the font size of upper-layer applications to change with the control center through DApplication. -- The desktop program has embedded dde-shell, but dde-shell uses QApplication, causing the font size of upper-layer applications not to follow changes when the control center's font size is adjusted. -- Modify dde-shell's QApplication to DApplication. Log: fix issue PMS: BUG-285621
1 parent 52fe31a commit 3a55b95

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

shell/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# SPDX-License-Identifier: CC0-1.0
44

5+
find_package(Dtk${DTK_VERSION_MAJOR} COMPONENTS Widget REQUIRED)
56
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Widgets Gui WaylandClient)
67
find_package(TreelandProtocols REQUIRED)
78
pkg_check_modules(WaylandClient REQUIRED IMPORTED_TARGET wayland-client)
@@ -41,6 +42,7 @@ target_link_libraries(dde-shell PRIVATE
4142
Qt${QT_VERSION_MAJOR}::Widgets
4243
Qt${QT_VERSION_MAJOR}::WaylandClient
4344
Dtk${DTK_VERSION_MAJOR}::Gui
45+
Dtk${DTK_VERSION_MAJOR}::Widget
4446
Qt${QT_VERSION_MAJOR}::DBus
4547
PkgConfig::WaylandClient
4648
)

shell/main.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <QCommandLineParser>
88
#include <QStandardPaths>
99

10+
#include <DApplication>
1011
#include <DGuiApplicationHelper>
1112
#include <DLog>
1213
#include <QQuickWindow>
@@ -24,6 +25,7 @@
2425

2526
DS_USE_NAMESPACE
2627
DGUI_USE_NAMESPACE
28+
DWIDGET_USE_NAMESPACE
2729

2830
DS_BEGIN_NAMESPACE
2931
Q_DECLARE_LOGGING_CATEGORY(dsLog)
@@ -95,7 +97,7 @@ int main(int argc, char *argv[])
9597
{
9698
setenv("DSG_APP_ID", "org.deepin.dde.shell", 0);
9799
DGuiApplicationHelper::setAttribute(DGuiApplicationHelper::UseInactiveColorGroup, false);
98-
QApplication a(argc, argv);
100+
DApplication a(argc, argv);
99101
// Don't apply to plugins
100102
qunsetenv("QT_SCALE_FACTOR");
101103
// dde-shell contains UI controls based on QML and Widget technologies.

0 commit comments

Comments
 (0)