From 868da6151e59709f0728d6559631a7d85b666059 Mon Sep 17 00:00:00 2001 From: hewenfei Date: Fri, 8 Mar 2024 09:50:51 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=8D?= =?UTF-8?q?=E8=B7=9F=E9=9A=8F=E7=B3=BB=E7=BB=9F=E5=AD=97=E4=BD=93=E9=97=AE?= =?UTF-8?q?=E9=A2=98"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 回退此commit以修复自动传包错误 This reverts commit 3f2c35679d7604be9cc0a48e4dbf308e889604f4. --- qml/AppControls2/StyleText.qml | 10 +++++----- src/uiconfig/theme-palette.cpp | 8 -------- src/uiconfig/theme-palette.h | 3 --- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/qml/AppControls2/StyleText.qml b/qml/AppControls2/StyleText.qml index f549a81..de4b127 100644 --- a/qml/AppControls2/StyleText.qml +++ b/qml/AppControls2/StyleText.qml @@ -11,18 +11,18 @@ Text { function updateColor() { color = themePalette.paletteColorWithCustomTransparency(paletteRole, Palette.Active, alpha); } - function updateFont() { - font = themePalette.systemFont(); + function updateFontSize() { + systemFontSize = themePalette.systemFontSize(); } Component.onCompleted: { updateColor(); - updateFont(); + updateFontSize(); themePalette.styleColorChanged.connect(updateColor); - themePalette.systemFontChanged.connect(updateFont); + themePalette.systemFontSizeChanged.connect(updateFontSize); } Component.onDestruction: { themePalette.styleColorChanged.disconnect(updateColor); - themePalette.systemFontChanged.disconnect(updateFont); + themePalette.systemFontSizeChanged.disconnect(updateFontSize); } onPaletteRoleChanged: { updateColor(); diff --git a/src/uiconfig/theme-palette.cpp b/src/uiconfig/theme-palette.cpp index 257d947..e687364 100644 --- a/src/uiconfig/theme-palette.cpp +++ b/src/uiconfig/theme-palette.cpp @@ -42,9 +42,6 @@ ThemePalette::ThemePalette(QObject *parent) : QObject(parent) connect(qGuiApp, &QGuiApplication::paletteChanged, this, [=] { Q_EMIT styleColorChanged(); }); - connect(qGuiApp, &QGuiApplication::fontChanged, this, [=] { - Q_EMIT systemFontChanged(); - }); } QColor ThemePalette::paletteColor(Palette::ColorRole colorRole, Palette::ColorGroup colorGroup) const @@ -225,8 +222,3 @@ qreal ThemePalette::systemFontSize() const { return m_fontSize; } - -QFont ThemePalette::systemFont() -{ - return QGuiApplication::font(); -} diff --git a/src/uiconfig/theme-palette.h b/src/uiconfig/theme-palette.h index 54a4f13..95272cb 100644 --- a/src/uiconfig/theme-palette.h +++ b/src/uiconfig/theme-palette.h @@ -23,7 +23,6 @@ #include #include -#include #include "settings.h" namespace UkuiMenu { @@ -95,11 +94,9 @@ public: Q_INVOKABLE QColor separator(Palette::ColorGroup colorGroup = Palette::Active) const; Q_INVOKABLE qreal systemFontSize() const; - Q_INVOKABLE QFont systemFont(); Q_SIGNALS: void styleColorChanged(); - void systemFontChanged(); void systemFontSizeChanged(); private Q_SLOTS: