1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 13:33:50 +03:00

improve scheme file assignment from themeExtended

This commit is contained in:
Michail Vourlakos 2018-12-09 10:52:01 +02:00
parent a3107b7f1c
commit c81e97f24d
3 changed files with 28 additions and 1 deletions

View File

@ -71,6 +71,16 @@ bool PlasmaThemeExtended::hasShadow() const
return PanelShadows::self()->enabled();
}
bool PlasmaThemeExtended::isLightTheme() const
{
return m_isLightTheme;
}
bool PlasmaThemeExtended::isDarkTheme() const
{
return !m_isLightTheme;
}
int PlasmaThemeExtended::bottomEdgeRoundness() const
{
return (themeHasExtendedInfo() ? m_bottomEdgeRoundness : userThemeRoundness());
@ -116,6 +126,11 @@ bool PlasmaThemeExtended::themeHasExtendedInfo() const
return m_themeHasExtendedInfo;
}
SchemeColors *PlasmaThemeExtended::defaultTheme() const
{
return m_normalScheme;
}
SchemeColors *PlasmaThemeExtended::lightTheme() const
{
return m_isLightTheme ? m_normalScheme : m_reversedScheme;

View File

@ -48,12 +48,15 @@ class PlasmaThemeExtended: public QObject
{
Q_OBJECT
Q_PROPERTY(bool hasShadow READ hasShadow NOTIFY hasShadowChanged)
Q_PROPERTY(bool isLightTheme READ isLightTheme NOTIFY themeChanged)
Q_PROPERTY(bool isDarkTheme READ isDarkTheme NOTIFY themeChanged)
Q_PROPERTY(int bottomEdgeRoundness READ bottomEdgeRoundness NOTIFY roundnessChanged)
Q_PROPERTY(int leftEdgeRoundness READ leftEdgeRoundness NOTIFY roundnessChanged)
Q_PROPERTY(int topEdgeRoundness READ topEdgeRoundness NOTIFY roundnessChanged)
Q_PROPERTY(int rightEdgeRoundness READ rightEdgeRoundness NOTIFY roundnessChanged)
Q_PROPERTY(SchemeColors *defaultTheme READ defaultTheme NOTIFY themeChanged)
Q_PROPERTY(SchemeColors *lightTheme READ lightTheme NOTIFY themeChanged)
Q_PROPERTY(SchemeColors *darkTheme READ darkTheme NOTIFY themeChanged)
@ -62,6 +65,8 @@ public:
~PlasmaThemeExtended() override;;
bool hasShadow() const;
bool isLightTheme() const;
bool isDarkTheme() const;
int bottomEdgeRoundness() const;
int leftEdgeRoundness() const;
@ -71,6 +76,7 @@ public:
int userThemeRoundness() const;
void setUserThemeRoundness(int roundness);
SchemeColors *defaultTheme() const;
SchemeColors *lightTheme() const;
SchemeColors *darkTheme() const;

View File

@ -86,7 +86,13 @@ Loader{
readonly property color buttonHoverColor: theme.buttonHoverColor
readonly property color buttonFocusColor: theme.buttonFocusColor
readonly property string scheme: themeExtended ? applyTheme.schemeFile : "kdeglobals"
readonly property string scheme: {
if (applyTheme===theme) {
return applyTheme.defaultTheme.schemeFile;
}
return applyTheme.schemeFile;
}
sourceComponent: BackgroundTracker{}
}