Revert "fix: 修复不跟随系统字体问题"

回退此commit以修复自动传包错误
This reverts commit 3f2c35679d.
This commit is contained in:
hewenfei 2024-03-08 09:50:51 +08:00
parent af460e19da
commit 868da6151e
3 changed files with 5 additions and 16 deletions

View File

@ -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();

View File

@ -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();
}

View File

@ -23,7 +23,6 @@
#include <QObject>
#include <QPalette>
#include <QFont>
#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: