Remove ApplicationStyleSettings

This commit is contained in:
xibowen 2024-03-11 20:30:22 +08:00
parent 6acc6d5deb
commit faba92327c
3 changed files with 29 additions and 29 deletions

View File

@ -163,27 +163,27 @@ UKUIConfigStyle::UKUIConfigStyle(bool dark, bool useDefault, QString type) : QPr
m_window_manager = new WindowManager(this);
m_app_style_settings = ApplicationStyleSettings::getInstance();
if (m_app_style_settings) {
connect(m_app_style_settings, &ApplicationStyleSettings::colorStretageChanged, [=](const ApplicationStyleSettings::ColorStretagy &stretagy) {
////todo implemet palette switch.
switch (stretagy) {
case ApplicationStyleSettings::System: {
break;
}
case ApplicationStyleSettings::Bright: {
break;
}
case ApplicationStyleSettings::Dark: {
break;
}
default:
break;
}
});
} else {
qWarning("org.ukui.style is null!");
}
// m_app_style_settings = ApplicationStyleSettings::getInstance();
// if (m_app_style_settings) {
// connect(m_app_style_settings, &ApplicationStyleSettings::colorStretageChanged, [=](const ApplicationStyleSettings::ColorStretagy &stretagy) {
// ////todo implemet palette switch.
// switch (stretagy) {
// case ApplicationStyleSettings::System: {
// break;
// }
// case ApplicationStyleSettings::Bright: {
// break;
// }
// case ApplicationStyleSettings::Dark: {
// break;
// }
// default:
// break;
// }
// });
// } else {
// qWarning("org.ukui.style is null!");
// }
if (QGSettings::isSchemaInstalled("org.ukui.peripherals-mouse")) {
QGSettings *settings = new QGSettings("org.ukui.peripherals-mouse");

View File

@ -46,7 +46,7 @@ class BlurHelper;
class GestureHelper;
class WindowManager;
class ApplicationStyleSettings;
//class ApplicationStyleSettings;
//QT_BEGIN_NAMESPACE
//namespace UKUIConfigStyleSpace { class UKUIConfigStyle; }
//QT_END_NAMESPACE
@ -201,7 +201,7 @@ private:
GestureHelper *m_gesture_helper = nullptr;
WindowManager *m_window_manager = nullptr;
ApplicationStyleSettings *m_app_style_settings = nullptr;
// ApplicationStyleSettings *m_app_style_settings = nullptr;
bool m_blink_cursor = true;
int m_blink_cursor_time = 1200;

View File

@ -53,9 +53,9 @@ UKUIStylePlugin::UKUIStylePlugin(QObject *parent) :
if (QApplication::style()->inherits("InternalStyle"))
return;
auto appStyleSettings = ApplicationStyleSettings::getInstance();
if (appStyleSettings->currentStyleStretagy() != ApplicationStyleSettings::Default)
return;
// auto appStyleSettings = ApplicationStyleSettings::getInstance();
// if (appStyleSettings->currentStyleStretagy() != ApplicationStyleSettings::Default)
// return;
auto styleName = settings->get("styleName").toString();
auto widgetThemeName = settings->get("widgetThemeName").toString();
@ -191,9 +191,9 @@ void UKUIStylePlugin::tableModeChanged(bool isTableMode)
if (QApplication::style()->inherits("InternalStyle"))
return;
auto appStyleSettings = ApplicationStyleSettings::getInstance();
if (appStyleSettings->currentStyleStretagy() != ApplicationStyleSettings::Default)
return;
// auto appStyleSettings = ApplicationStyleSettings::getInstance();
// if (appStyleSettings->currentStyleStretagy() != ApplicationStyleSettings::Default)
// return;
auto settings = UKUIStyleSettings::globalInstance();
auto styleName = settings->get("styleName").toString();