Skip to content

Commit

Permalink
Merge pull request #12 from LingmoOS/helium_dev
Browse files Browse the repository at this point in the history
Remove Auto Color for Default color
  • Loading branch information
chun-awa authored Nov 29, 2024
2 parents f31dd8b + cd3f453 commit 922600e
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 82 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LingmoUI
# Lingmo UI

LingmoUI is a GUI library based on QQC2 (Qt Quick Controls 2), every Lingmo application uses it.

Expand Down
2 changes: 1 addition & 1 deletion conf/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=LingmoUI 2.2.0
VERSION=LingmoUI 2.8.0
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
lingmoui (2.3.0) hydrogen; urgency=high

[lingmo]
* update ColorManager

-- Lingmo OS Team <[email protected]> Sun, 10 Nov 2024 09:30:00 +0800

lingmoui (2.2.1) hydrogen; urgency=high

[Elysia]
Expand Down
156 changes: 78 additions & 78 deletions src/thememanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void ThemeManager::initData()
QDBusInterface iface(Service, ObjectPath, Interface, QDBusConnection::sessionBus(), this);

if (iface.isValid()) {
onDBusColorChanged();
// onDBusColorChanged();
m_darkMode = iface.property("isDarkMode").toBool();
int accentColorID = iface.property("accentColor").toInt();
setAccentColor(accentColorID);
Expand Down Expand Up @@ -87,86 +87,86 @@ void ThemeManager::initDBusSignals()
this, SLOT(onDBusFontSizeChanged()));
QDBusConnection::sessionBus().connect(Service, ObjectPath, Interface, "systemFontChanged",
this, SLOT(onDBusFontFamilyChanged()));
QDBusConnection::sessionBus().connect(Service, ObjectPath, Interface, "colorChanged",
this, SLOT(onDBusColorChanged()));
// QDBusConnection::sessionBus().connect(Service, ObjectPath, Interface, "colorChanged",
// this, SLOT(onDBusColorChanged()));
}
}

void ThemeManager::onDBusColorChanged()
{
QDBusInterface iface(Service, ObjectPath, Interface, QDBusConnection::sessionBus(), this);

QString color0 = iface.property("color0").toString();
if(color0 != m_blueColor.name() && color0.startsWith("#"))
{
m_blueColor = QColor(color0);
}

QString color1 = iface.property("color1").toString();
if(color1 != m_redColor.name() && color1.startsWith("#"))
{
m_redColor = QColor(color1);
}
\
QString color2 = iface.property("color2").toString();
if(color2 != m_greenColor.name() && color2.startsWith("#"))
{
m_greenColor = QColor(color2);
}

QString color3 = iface.property("color3").toString();
if(color3 != m_purpleColor.name() && color3.startsWith("#"))
{
m_purpleColor = QColor(color3);
}

QString color4 = iface.property("color4").toString();
if(color4 != m_pinkColor.name() && color4.startsWith("#"))
{
m_pinkColor = QColor(color4);
}

QString color5 = iface.property("color5").toString();
if(color5 != m_orangeColor.name() && color5.startsWith("#"))
{
m_orangeColor = QColor(color5);
}

QString color6 = iface.property("color6").toString();
if(color6 != m_greyColor.name() && color6.startsWith("#"))
{
m_greyColor = QColor(color6);
}

switch (m_accentColorIndex) {
case ACCENTCOLOR_BLUE:
m_accentColor = m_blueColor;
break;
case ACCENTCOLOR_RED:
m_accentColor = m_redColor;
break;
case ACCENTCOLOR_GREEN:
m_accentColor = m_greenColor;
break;
case ACCENTCOLOR_PURPLE:
m_accentColor = m_purpleColor;
break;
case ACCENTCOLOR_PINK:
m_accentColor = m_pinkColor;
break;
case ACCENTCOLOR_ORANGE:
m_accentColor = m_orangeColor;
break;
case ACCENTCOLOR_GREY:
m_accentColor = m_greyColor;
break;
default:
m_accentColor = m_blueColor;
break;
}
emit accentColorChanged();
emit colorChanged();
}
// void ThemeManager::onDBusColorChanged()
// {
// QDBusInterface iface(Service, ObjectPath, Interface, QDBusConnection::sessionBus(), this);

// QString color0 = iface.property("color0").toString();
// if(color0 != m_blueColor.name() && color0.startsWith("#"))
// {
// m_blueColor = QColor(color0);
// }

// QString color1 = iface.property("color1").toString();
// if(color1 != m_redColor.name() && color1.startsWith("#"))
// {
// m_redColor = QColor(color1);
// }

// QString color2 = iface.property("color2").toString();
// if(color2 != m_greenColor.name() && color2.startsWith("#"))
// {
// m_greenColor = QColor(color2);
// }

// QString color3 = iface.property("color3").toString();
// if(color3 != m_purpleColor.name() && color3.startsWith("#"))
// {
// m_purpleColor = QColor(color3);
// }

// QString color4 = iface.property("color4").toString();
// if(color4 != m_pinkColor.name() && color4.startsWith("#"))
// {
// m_pinkColor = QColor(color4);
// }

// QString color5 = iface.property("color5").toString();
// if(color5 != m_orangeColor.name() && color5.startsWith("#"))
// {
// m_orangeColor = QColor(color5);
// }

// QString color6 = iface.property("color6").toString();
// if(color6 != m_greyColor.name() && color6.startsWith("#"))
// {
// m_greyColor = QColor(color6);
// }

// switch (m_accentColorIndex) {
// case ACCENTCOLOR_BLUE:
// m_accentColor = m_blueColor;
// break;
// case ACCENTCOLOR_RED:
// m_accentColor = m_redColor;
// break;
// case ACCENTCOLOR_GREEN:
// m_accentColor = m_greenColor;
// break;
// case ACCENTCOLOR_PURPLE:
// m_accentColor = m_purpleColor;
// break;
// case ACCENTCOLOR_PINK:
// m_accentColor = m_pinkColor;
// break;
// case ACCENTCOLOR_ORANGE:
// m_accentColor = m_orangeColor;
// break;
// case ACCENTCOLOR_GREY:
// m_accentColor = m_greyColor;
// break;
// default:
// m_accentColor = m_blueColor;
// break;
// }
// emit accentColorChanged();
// emit colorChanged();
// }

void ThemeManager::onDBusDarkModeChanged(bool darkMode)
{
Expand Down
4 changes: 2 additions & 2 deletions src/thememanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private slots:
void initData();
void initDBusSignals();
void onDBusDarkModeChanged(bool darkMode);
void onDBusColorChanged();
// void onDBusColorChanged();
void onDBusAccentColorChanged(int accentColorID);
void onDBusFontSizeChanged();
void onDBusFontFamilyChanged();
Expand All @@ -103,7 +103,7 @@ private slots:
bool m_darkMode;
int m_accentColorIndex;

QColor m_blueColor = QColor(51, 133, 255); // #3385FF
QColor m_blueColor = QColor(34, 119, 255); // #2277FF
QColor m_redColor = QColor(255, 92, 109); // #FF5C6D
QColor m_greenColor = QColor(53, 191, 86); // #35BF56
QColor m_purpleColor = QColor(130, 102, 255); // #8266FF
Expand Down

0 comments on commit 922600e

Please sign in to comment.