Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2696,7 +2696,7 @@ All notable changes to Theseus' Ship will be documented in this file.
* **debug:** split up console along windowing systems ([e72a542](https://gitlab.com/kwinft/kwinft/commit/e72a542f3a2e5d26bf13781fa0f8a788ddfb7e90))
* **deco:** deprecate loading with the "button" keyword ([4a93627](https://gitlab.com/kwinft/kwinft/commit/4a93627aa3d58dd6f904b5d99edb1fe9f1f678a2))
* **deco:** improve decorationpalette.cpp code ([25b0fb2](https://gitlab.com/kwinft/kwinft/commit/25b0fb2c2b2aed29c784dcb096eaed9b41f7da8e))
* **deco:** port to new KDecoration2::DecorationThemeProvider class ([2d9277a](https://gitlab.com/kwinft/kwinft/commit/2d9277aa47f7c5a783cf65f7fbc13ed9e87e9abe))
* **deco:** port to new KDecoration3::DecorationThemeProvider class ([2d9277a](https://gitlab.com/kwinft/kwinft/commit/2d9277aa47f7c5a783cf65f7fbc13ed9e87e9abe))
* **deco:** remove manual lnf default handling ([cd93d9e](https://gitlab.com/kwinft/kwinft/commit/cd93d9ed2e4034016162c6dbb1f4c07b4660aa3a))
* define base output type in backend ([2534948](https://gitlab.com/kwinft/kwinft/commit/253494822f3c5ed3c5ffdfd7cc184f03f7d36d33))
* define DPMS mode outside of output class ([92ceb15](https://gitlab.com/kwinft/kwinft/commit/92ceb151d49951c7f1f770542fe07d6c9d37afc6))
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ set_package_properties(KF6Kirigami PROPERTIES
TYPE RUNTIME
)

find_package(Plasma ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}
find_package(Plasma ${CMAKE_PROJECT_VERSION_MAJOR}
CONFIG
)
set_package_properties(Plasma PROPERTIES
Expand All @@ -66,7 +66,7 @@ set_package_properties(Plasma PROPERTIES
TYPE RUNTIME
)

find_package(KDecoration2 ${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}
find_package(KDecoration3 ${CMAKE_PROJECT_VERSION_MAJOR}
CONFIG REQUIRED
)

Expand Down
4 changes: 2 additions & 2 deletions kcms/decoration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ kconfig_add_kcfg_files(kcmkwindecoration_SRCS kwindecorationsettings.kcfgc GENER
kcmutils_add_qml_kcm(kcm_kwindecoration SOURCES ${kcmkwindecoration_SRCS})

target_link_libraries(kcm_kwindecoration
KDecoration2::KDecoration
KDecoration3::KDecoration
KF6::I18n
KF6::KCMUtils
Qt::DBus
Expand All @@ -45,7 +45,7 @@ kconfig_add_kcfg_files(kwin-applywindowdecoration_SRCS kwindecorationsettings.kc
add_executable(kwin-applywindowdecoration ${kwin-applywindowdecoration_SRCS})

target_link_libraries(kwin-applywindowdecoration
KDecoration2::KDecoration
KDecoration3::KDecoration
KF6::I18n
KF6::KCMUtils
Qt::DBus
Expand Down
4 changes: 2 additions & 2 deletions kcms/decoration/declarative-plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ target_sources(kdecorationprivatedeclarative PRIVATE

target_link_libraries(kdecorationprivatedeclarative PRIVATE
como::win
KDecoration2::KDecoration
KDecoration2::KDecoration2Private
KDecoration3::KDecoration
KDecoration3::KDecoration3Private
KF6::CoreAddons
KF6::I18n
KF6::KCMUtils
Expand Down
4 changes: 2 additions & 2 deletions kcms/decoration/declarative-plugin/buttonsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <QFontDatabase>

namespace KDecoration2
namespace KDecoration3
{

namespace Preview
Expand Down Expand Up @@ -139,7 +139,7 @@ void ButtonsModel::add(DecorationButtonType type)
void ButtonsModel::add(int index, int type)
{
beginInsertRows(QModelIndex(), index, index);
m_buttons.insert(index, KDecoration2::DecorationButtonType(type));
m_buttons.insert(index, KDecoration3::DecorationButtonType(type));
endInsertRows();
}

Expand Down
4 changes: 2 additions & 2 deletions kcms/decoration/declarative-plugin/buttonsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#ifndef KDECOARTIONS_PREVIEW_BUTTONS_MODEL_H
#define KDECOARTIONS_PREVIEW_BUTTONS_MODEL_H

#include <KDecoration2/DecorationButton>
#include <KDecoration3/DecorationButton>
#include <QAbstractListModel>

#include <QQmlEngine>

namespace KDecoration2
namespace KDecoration3
{

namespace Preview
Expand Down
16 changes: 8 additions & 8 deletions kcms/decoration/declarative-plugin/previewbridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "previewitem.h"
#include "previewsettings.h"

#include <KDecoration2/DecoratedClient>
#include <KDecoration2/Decoration>
#include <KDecoration3/DecoratedWindow>
#include <KDecoration3/Decoration>

#include <KCModule>
#include <KCMultiDialog>
Expand All @@ -26,7 +26,7 @@
#include <QVBoxLayout>
#include <QWindow>

namespace KDecoration2
namespace KDecoration3
{
namespace Preview
{
Expand All @@ -45,7 +45,7 @@ PreviewBridge::PreviewBridge(QObject* parent)

PreviewBridge::~PreviewBridge() = default;

std::unique_ptr<DecoratedClientPrivate> PreviewBridge::createClient(DecoratedClient* client,
std::unique_ptr<DecoratedWindowPrivate> PreviewBridge::createClient(DecoratedWindow* client,
Decoration* decoration)
{
auto ptr = std::unique_ptr<PreviewClient>(new PreviewClient(client, decoration));
Expand Down Expand Up @@ -156,17 +156,17 @@ Decoration* PreviewBridge::createDecoration(QObject* parent)
if (!m_theme.isNull()) {
args.insert(QStringLiteral("theme"), m_theme);
}
return m_factory->create<KDecoration2::Decoration>(parent, QVariantList({args}));
return m_factory->create<KDecoration3::Decoration>(parent, QVariantList({args}));
}

DecorationButton* PreviewBridge::createButton(KDecoration2::Decoration* decoration,
KDecoration2::DecorationButtonType type,
DecorationButton* PreviewBridge::createButton(KDecoration3::Decoration* decoration,
KDecoration3::DecorationButtonType type,
QObject* parent)
{
if (!m_valid) {
return nullptr;
}
return m_factory->create<KDecoration2::DecorationButton>(
return m_factory->create<KDecoration3::DecorationButton>(
parent, QVariantList({QVariant::fromValue(type), QVariant::fromValue(decoration)}));
}

Expand Down
20 changes: 10 additions & 10 deletions kcms/decoration/declarative-plugin/previewbridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
#ifndef KDECOARTIONS_PREVIEW_BRIDGE_H
#define KDECOARTIONS_PREVIEW_BRIDGE_H

#include <KDecoration2/DecorationButton>
#include <KDecoration2/Private/DecorationBridge>
#include <KDecoration3/DecorationButton>
#include <KDecoration3/Private/DecorationBridge>
#include <KPluginFactory>

#include <QList>
#include <QPointer>
#include <QQmlEngine>
#include <QQuickItem>

namespace KDecoration2
namespace KDecoration3
{
namespace Preview
{
Expand All @@ -24,7 +24,7 @@ class PreviewClient;
class PreviewItem;
class PreviewSettings;

class PreviewBridge : public KDecoration2::DecorationBridge
class PreviewBridge : public KDecoration3::DecorationBridge
{
Q_OBJECT
QML_ANONYMOUS
Expand All @@ -37,7 +37,7 @@ class PreviewBridge : public KDecoration2::DecorationBridge
public:
explicit PreviewBridge(QObject* parent = nullptr);
~PreviewBridge() override;
std::unique_ptr<DecoratedClientPrivate> createClient(DecoratedClient* client,
std::unique_ptr<DecoratedWindowPrivate> createClient(DecoratedWindow* client,
Decoration* decoration) override;
std::unique_ptr<DecorationSettingsPrivate> settings(DecorationSettings* parent) override;

Expand All @@ -61,9 +61,9 @@ class PreviewBridge : public KDecoration2::DecorationBridge
QString theme() const;
bool isValid() const;

KDecoration2::Decoration* createDecoration(QObject* parent = nullptr);
KDecoration2::DecorationButton* createButton(KDecoration2::Decoration* decoration,
KDecoration2::DecorationButtonType type,
KDecoration3::Decoration* createDecoration(QObject* parent = nullptr);
KDecoration3::DecorationButton* createButton(KDecoration3::Decoration* decoration,
KDecoration3::DecorationButtonType type,
QObject* parent = nullptr);

public Q_SLOTS:
Expand Down Expand Up @@ -97,7 +97,7 @@ class BridgeItem : public QObject
Q_PROPERTY(
QString kcmoduleName READ kcmoduleName WRITE setKcmoduleName NOTIFY kcmoduleNameChanged)
Q_PROPERTY(bool valid READ isValid NOTIFY validChanged)
Q_PROPERTY(KDecoration2::Preview::PreviewBridge* bridge READ bridge CONSTANT)
Q_PROPERTY(KDecoration3::Preview::PreviewBridge* bridge READ bridge CONSTANT)

public:
explicit BridgeItem(QObject* parent = nullptr);
Expand Down Expand Up @@ -150,6 +150,6 @@ class BridgeItem : public QObject
}
}

Q_DECLARE_METATYPE(KDecoration2::Preview::PreviewBridge*)
Q_DECLARE_METATYPE(KDecoration3::Preview::PreviewBridge*)

#endif
15 changes: 8 additions & 7 deletions kcms/decoration/declarative-plugin/previewbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#include "previewclient.h"
#include "previewsettings.h"

#include <KDecoration2/Decoration>
#include <KDecoration3/Decoration>

#include <QPainter>

namespace KDecoration2
namespace KDecoration3
{

namespace Preview
Expand All @@ -27,10 +27,10 @@ PreviewButtonItem::~PreviewButtonItem() = default;

void PreviewButtonItem::setType(int type)
{
setType(KDecoration2::DecorationButtonType(type));
setType(KDecoration3::DecorationButtonType(type));
}

void PreviewButtonItem::setType(KDecoration2::DecorationButtonType type)
void PreviewButtonItem::setType(KDecoration3::DecorationButtonType type)
{
if (m_type == type) {
return;
Expand All @@ -39,7 +39,7 @@ void PreviewButtonItem::setType(KDecoration2::DecorationButtonType type)
Q_EMIT typeChanged();
}

KDecoration2::DecorationButtonType PreviewButtonItem::type() const
KDecoration3::DecorationButtonType PreviewButtonItem::type() const
{
return m_type;
}
Expand Down Expand Up @@ -85,7 +85,7 @@ void PreviewButtonItem::componentComplete()

void PreviewButtonItem::createButton()
{
if (m_type == KDecoration2::DecorationButtonType::Custom || m_decoration || !m_settings
if (m_type == KDecoration3::DecorationButtonType::Custom || m_decoration || !m_settings
|| !m_bridge) {
return;
}
Expand All @@ -99,6 +99,7 @@ void PreviewButtonItem::createButton()
client->setActive(false);
client->setProvidesContextHelp(true);
m_decoration->setSettings(m_settings->settings());
m_decoration->create();
m_decoration->init();
m_button = m_bridge->createButton(m_decoration, m_type);
connect(this, &PreviewButtonItem::widthChanged, this, &PreviewButtonItem::syncGeometry);
Expand All @@ -121,7 +122,7 @@ void PreviewButtonItem::paint(QPainter* painter)
}

const QRect rect(0, 0, width(), height());
if (type() == KDecoration2::DecorationButtonType::Spacer) {
if (type() == KDecoration3::DecorationButtonType::Spacer) {
static const QIcon icon = QIcon::fromTheme(QStringLiteral("distribute-horizontal"));
icon.paint(painter, rect);
} else {
Expand Down
24 changes: 12 additions & 12 deletions kcms/decoration/declarative-plugin/previewbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#ifndef KDECOARTIONS_PREVIEW_BUTTON_ITEM_H
#define KDECOARTIONS_PREVIEW_BUTTON_ITEM_H

#include <KDecoration2/DecorationButton>
#include <KDecoration3/DecorationButton>
#include <QColor>
#include <QPointer>
#include <QQuickPaintedItem>

namespace KDecoration2
namespace KDecoration3
{
class Decoration;

Expand All @@ -24,9 +24,9 @@ class PreviewButtonItem : public QQuickPaintedItem
{
Q_OBJECT
QML_NAMED_ELEMENT(Button)
Q_PROPERTY(KDecoration2::Preview::PreviewBridge* bridge READ bridge WRITE setBridge NOTIFY
Q_PROPERTY(KDecoration3::Preview::PreviewBridge* bridge READ bridge WRITE setBridge NOTIFY
bridgeChanged)
Q_PROPERTY(KDecoration2::Preview::Settings* settings READ settings WRITE setSettings NOTIFY
Q_PROPERTY(KDecoration3::Preview::Settings* settings READ settings WRITE setSettings NOTIFY
settingsChanged)
Q_PROPERTY(int type READ typeAsInt WRITE setType NOTIFY typeChanged)
Q_PROPERTY(QColor color READ color WRITE setColor)
Expand All @@ -42,9 +42,9 @@ class PreviewButtonItem : public QQuickPaintedItem
Settings* settings() const;
void setSettings(Settings* settings);

KDecoration2::DecorationButtonType type() const;
KDecoration3::DecorationButtonType type() const;
int typeAsInt() const;
void setType(KDecoration2::DecorationButtonType type);
void setType(KDecoration3::DecorationButtonType type);
void setType(int type);

const QColor& color() const
Expand All @@ -65,14 +65,14 @@ class PreviewButtonItem : public QQuickPaintedItem
void createButton();
void syncGeometry();
QColor m_color;
QPointer<KDecoration2::Preview::PreviewBridge> m_bridge;
QPointer<KDecoration2::Preview::Settings> m_settings;
KDecoration2::Decoration* m_decoration = nullptr;
KDecoration2::DecorationButton* m_button = nullptr;
KDecoration2::DecorationButtonType m_type = KDecoration2::DecorationButtonType::Custom;
QPointer<KDecoration3::Preview::PreviewBridge> m_bridge;
QPointer<KDecoration3::Preview::Settings> m_settings;
KDecoration3::Decoration* m_decoration = nullptr;
KDecoration3::DecorationButton* m_button = nullptr;
KDecoration3::DecorationButtonType m_type = KDecoration3::DecorationButtonType::Custom;
};

} // Preview
} // KDecoration2
} // KDecoration3

#endif
Loading