mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-23 01:33:50 +03:00
refactor:move schemecolors under "wm" folder
This commit is contained in:
parent
8c3d658a0d
commit
6248a0ccae
@ -4,7 +4,6 @@ set(lattedock-app_SRCS
|
||||
alternativeshelper.cpp
|
||||
infoview.cpp
|
||||
lattecorona.cpp
|
||||
schemecolors.cpp
|
||||
screenpool.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
@ -22,9 +22,9 @@
|
||||
|
||||
// local
|
||||
#include "lattecorona.h"
|
||||
#include "schemecolors.h"
|
||||
#include "../../layouts/importer.h"
|
||||
#include "../../view/panelshadows_p.h"
|
||||
#include "../../wm/schemecolors.h"
|
||||
#include "../../../liblatte2/commontools.h"
|
||||
|
||||
// Qt
|
||||
@ -149,17 +149,17 @@ float Theme::backgroundMaxOpacity() const
|
||||
return m_backgroundMaxOpacity;
|
||||
}
|
||||
|
||||
SchemeColors *Theme::defaultTheme() const
|
||||
Latte::SchemeColors *Theme::defaultTheme() const
|
||||
{
|
||||
return m_defaultScheme;
|
||||
}
|
||||
|
||||
SchemeColors *Theme::lightTheme() const
|
||||
Latte::SchemeColors *Theme::lightTheme() const
|
||||
{
|
||||
return m_isLightTheme ? m_defaultScheme : m_reversedScheme;
|
||||
}
|
||||
|
||||
SchemeColors *Theme::darkTheme() const
|
||||
Latte::SchemeColors *Theme::darkTheme() const
|
||||
{
|
||||
return !m_isLightTheme ? m_defaultScheme : m_reversedScheme;
|
||||
}
|
||||
@ -200,12 +200,12 @@ void Theme::updateDefaultScheme()
|
||||
updateDefaultSchemeValues();
|
||||
|
||||
if (m_defaultScheme) {
|
||||
disconnect(m_defaultScheme, &SchemeColors::colorsChanged, this, &Theme::loadThemeLightness);
|
||||
disconnect(m_defaultScheme, &Latte::SchemeColors::colorsChanged, this, &Theme::loadThemeLightness);
|
||||
m_defaultScheme->deleteLater();
|
||||
}
|
||||
|
||||
m_defaultScheme = new SchemeColors(this, m_defaultSchemePath, true);
|
||||
connect(m_defaultScheme, &SchemeColors::colorsChanged, this, &Theme::loadThemeLightness);
|
||||
m_defaultScheme = new Latte::SchemeColors(this, m_defaultSchemePath, true);
|
||||
connect(m_defaultScheme, &Latte::SchemeColors::colorsChanged, this, &Theme::loadThemeLightness);
|
||||
|
||||
qDebug() << "plasma theme default colors ::: " << m_defaultSchemePath;
|
||||
}
|
||||
@ -244,7 +244,7 @@ void Theme::updateReversedScheme()
|
||||
m_reversedScheme->deleteLater();
|
||||
}
|
||||
|
||||
m_reversedScheme = new SchemeColors(this, m_reversedSchemePath, true);
|
||||
m_reversedScheme = new Latte::SchemeColors(this, m_reversedSchemePath, true);
|
||||
|
||||
qDebug() << "plasma theme reversed colors ::: " << m_reversedSchemePath;
|
||||
}
|
||||
@ -299,7 +299,7 @@ void Theme::updateReversedSchemeValues()
|
||||
}
|
||||
|
||||
//! update scheme name
|
||||
QString originalSchemeName = SchemeColors::schemeName(m_originalSchemePath);
|
||||
QString originalSchemeName = Latte::SchemeColors::schemeName(m_originalSchemePath);
|
||||
KConfigGroup generalGroup(reversedPtr, "General");
|
||||
generalGroup.writeEntry("Name", originalSchemeName + "_reversed");
|
||||
generalGroup.sync();
|
||||
@ -426,17 +426,17 @@ void Theme::loadThemePaths()
|
||||
|
||||
m_kdeConnections[0] = connect(KDirWatch::self(), &KDirWatch::dirty, this, [ &, kdeSettingsFile](const QString & path) {
|
||||
if (path == kdeSettingsFile) {
|
||||
this->setOriginalSchemeFile(SchemeColors::possibleSchemeFile("kdeglobals"));
|
||||
this->setOriginalSchemeFile(Latte::SchemeColors::possibleSchemeFile("kdeglobals"));
|
||||
}
|
||||
});
|
||||
|
||||
m_kdeConnections[1] = connect(KDirWatch::self(), &KDirWatch::created, this, [ &, kdeSettingsFile](const QString & path) {
|
||||
if (path == kdeSettingsFile) {
|
||||
this->setOriginalSchemeFile(SchemeColors::possibleSchemeFile("kdeglobals"));
|
||||
this->setOriginalSchemeFile(Latte::SchemeColors::possibleSchemeFile("kdeglobals"));
|
||||
}
|
||||
});
|
||||
|
||||
setOriginalSchemeFile(SchemeColors::possibleSchemeFile("kdeglobals"));
|
||||
setOriginalSchemeFile(Latte::SchemeColors::possibleSchemeFile("kdeglobals"));
|
||||
}
|
||||
|
||||
//! this is probably not needed at all in order to provide full transparency for all
|
||||
|
@ -21,9 +21,6 @@
|
||||
#ifndef PLASMATHEMEEXTENDED_H
|
||||
#define PLASMATHEMEEXTENDED_H
|
||||
|
||||
// local
|
||||
#include "schemecolors.h"
|
||||
|
||||
// C++
|
||||
#include <array>
|
||||
|
||||
@ -41,6 +38,7 @@
|
||||
|
||||
namespace Latte {
|
||||
class Corona;
|
||||
class SchemeColors;
|
||||
}
|
||||
|
||||
namespace Latte {
|
||||
@ -62,9 +60,9 @@ class Theme: public QObject
|
||||
|
||||
Q_PROPERTY(float backgroundMaxOpacity READ backgroundMaxOpacity NOTIFY backgroundMaxOpacityChanged)
|
||||
|
||||
Q_PROPERTY(SchemeColors *defaultTheme READ defaultTheme NOTIFY themeChanged)
|
||||
Q_PROPERTY(SchemeColors *lightTheme READ lightTheme NOTIFY themeChanged)
|
||||
Q_PROPERTY(SchemeColors *darkTheme READ darkTheme NOTIFY themeChanged)
|
||||
Q_PROPERTY(Latte::SchemeColors *defaultTheme READ defaultTheme NOTIFY themeChanged)
|
||||
Q_PROPERTY(Latte::SchemeColors *lightTheme READ lightTheme NOTIFY themeChanged)
|
||||
Q_PROPERTY(Latte::SchemeColors *darkTheme READ darkTheme NOTIFY themeChanged)
|
||||
|
||||
public:
|
||||
Theme(KSharedConfig::Ptr config, QObject *parent);
|
||||
@ -84,9 +82,9 @@ public:
|
||||
|
||||
float backgroundMaxOpacity() const;
|
||||
|
||||
SchemeColors *defaultTheme() const;
|
||||
SchemeColors *lightTheme() const;
|
||||
SchemeColors *darkTheme() const;
|
||||
Latte::SchemeColors *defaultTheme() const;
|
||||
Latte::SchemeColors *lightTheme() const;
|
||||
Latte::SchemeColors *darkTheme() const;
|
||||
|
||||
void load();
|
||||
|
||||
@ -142,8 +140,8 @@ private:
|
||||
Plasma::Theme m_theme;
|
||||
|
||||
Latte::Corona *m_corona{nullptr};
|
||||
SchemeColors *m_defaultScheme{nullptr};
|
||||
SchemeColors *m_reversedScheme{nullptr};
|
||||
Latte::SchemeColors *m_defaultScheme{nullptr};
|
||||
Latte::SchemeColors *m_reversedScheme{nullptr};
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,6 @@
|
||||
|
||||
// local
|
||||
#include "../plasma/quick/containmentview.h"
|
||||
#include "../schemecolors.h"
|
||||
#include "../wm/abstractwindowinterface.h"
|
||||
#include "../wm/windowinfowrap.h"
|
||||
#include "../../liblatte2/types.h"
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "view.h"
|
||||
#include "../lattecorona.h"
|
||||
#include "../layouts/manager.h"
|
||||
#include "../wm/schemecolors.h"
|
||||
#include "../../liblatte2/types.h"
|
||||
|
||||
namespace Latte {
|
||||
@ -119,12 +120,12 @@ void WindowsTracker::setExistsWindowTouching(bool windowTouching)
|
||||
emit existsWindowTouchingChanged();
|
||||
}
|
||||
|
||||
SchemeColors *WindowsTracker::activeWindowScheme() const
|
||||
Latte::SchemeColors *WindowsTracker::activeWindowScheme() const
|
||||
{
|
||||
return m_activeScheme;
|
||||
}
|
||||
|
||||
void WindowsTracker::setActiveWindowScheme(SchemeColors *scheme)
|
||||
void WindowsTracker::setActiveWindowScheme(Latte::SchemeColors *scheme)
|
||||
{
|
||||
if (m_activeScheme == scheme) {
|
||||
return;
|
||||
@ -135,12 +136,12 @@ void WindowsTracker::setActiveWindowScheme(SchemeColors *scheme)
|
||||
emit activeWindowSchemeChanged();
|
||||
}
|
||||
|
||||
SchemeColors *WindowsTracker::touchingWindowScheme() const
|
||||
Latte::SchemeColors *WindowsTracker::touchingWindowScheme() const
|
||||
{
|
||||
return m_touchingScheme;
|
||||
}
|
||||
|
||||
void WindowsTracker::setTouchingWindowScheme(SchemeColors *scheme)
|
||||
void WindowsTracker::setTouchingWindowScheme(Latte::SchemeColors *scheme)
|
||||
{
|
||||
if (m_touchingScheme == scheme) {
|
||||
return;
|
||||
|
@ -21,7 +21,6 @@
|
||||
#define WINDOWSTRACKER_H
|
||||
|
||||
// local
|
||||
#include "../schemecolors.h"
|
||||
#include "../wm/abstractwindowinterface.h"
|
||||
#include "../wm/windowinfowrap.h"
|
||||
|
||||
@ -29,9 +28,10 @@
|
||||
#include <QObject>
|
||||
|
||||
namespace Latte{
|
||||
class AbstractWindowInterface;
|
||||
class Corona;
|
||||
class View;
|
||||
class AbstractWindowInterface;
|
||||
class Corona;
|
||||
class SchemeColors;
|
||||
class View;
|
||||
}
|
||||
|
||||
namespace Latte {
|
||||
@ -45,8 +45,8 @@ class WindowsTracker : public QObject {
|
||||
Q_PROPERTY(bool existsWindowActive READ existsWindowActive NOTIFY existsWindowActiveChanged)
|
||||
Q_PROPERTY(bool existsWindowMaximized READ existsWindowMaximized NOTIFY existsWindowMaximizedChanged)
|
||||
Q_PROPERTY(bool existsWindowTouching READ existsWindowTouching NOTIFY existsWindowTouchingChanged)
|
||||
Q_PROPERTY(SchemeColors *activeWindowScheme READ activeWindowScheme NOTIFY activeWindowSchemeChanged)
|
||||
Q_PROPERTY(SchemeColors *touchingWindowScheme READ touchingWindowScheme NOTIFY touchingWindowSchemeChanged)
|
||||
Q_PROPERTY(Latte::SchemeColors *activeWindowScheme READ activeWindowScheme NOTIFY activeWindowSchemeChanged)
|
||||
Q_PROPERTY(Latte::SchemeColors *touchingWindowScheme READ touchingWindowScheme NOTIFY touchingWindowSchemeChanged)
|
||||
|
||||
public:
|
||||
explicit WindowsTracker(Latte::View *parent);
|
||||
@ -61,8 +61,8 @@ public:
|
||||
bool existsWindowMaximized() const;
|
||||
bool existsWindowTouching() const;
|
||||
|
||||
SchemeColors *activeWindowScheme() const;
|
||||
SchemeColors *touchingWindowScheme() const;
|
||||
Latte::SchemeColors *activeWindowScheme() const;
|
||||
Latte::SchemeColors *touchingWindowScheme() const;
|
||||
|
||||
void setWindowOnActivities(QWindow &window, const QStringList &activities);
|
||||
|
||||
@ -88,8 +88,8 @@ private:
|
||||
void setExistsWindowActive(bool windowActive);
|
||||
void setExistsWindowMaximized(bool windowMaximized);
|
||||
void setExistsWindowTouching(bool windowTouching);
|
||||
void setActiveWindowScheme(SchemeColors *scheme);
|
||||
void setTouchingWindowScheme(SchemeColors *scheme);
|
||||
void setActiveWindowScheme(Latte::SchemeColors *scheme);
|
||||
void setTouchingWindowScheme(Latte::SchemeColors *scheme);
|
||||
void updateAvailableScreenGeometry();
|
||||
void updateFlags();
|
||||
|
||||
@ -120,8 +120,8 @@ private:
|
||||
std::array<QMetaObject::Connection, 7> m_connections;
|
||||
QMap<WindowId, WindowInfoWrap> m_windows;
|
||||
|
||||
SchemeColors *m_activeScheme{nullptr};
|
||||
SchemeColors *m_touchingScheme{nullptr};
|
||||
Latte::SchemeColors *m_activeScheme{nullptr};
|
||||
Latte::SchemeColors *m_touchingScheme{nullptr};
|
||||
|
||||
Latte::AbstractWindowInterface *m_wm;
|
||||
Latte::Corona *m_corona{nullptr};
|
||||
|
@ -1,6 +1,7 @@
|
||||
set(lattedock-app_SRCS
|
||||
${lattedock-app_SRCS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/abstractwindowinterface.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/schemecolors.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/waylandinterface.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/windowinfowrap.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/xwindowinterface.cpp
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "schemecolors.h"
|
||||
|
||||
// local
|
||||
#include "layouts/importer.h"
|
||||
#include "../layouts/importer.h"
|
||||
|
||||
// Qt
|
||||
#include <QDebug>
|
Loading…
Reference in New Issue
Block a user