[kcmkwin/deco] Reconfigure deco after applying changes
Required hooks also added to KWin core and Aurorae.icc-effect-5.14.5
parent
798b1ad860
commit
521627396f
|
@ -277,6 +277,7 @@ void Decoration::init()
|
||||||
{
|
{
|
||||||
KDecoration2::Decoration::init();
|
KDecoration2::Decoration::init();
|
||||||
auto s = settings();
|
auto s = settings();
|
||||||
|
connect(s.data(), &KDecoration2::DecorationSettings::reconfigured, this, &Decoration::configChanged);
|
||||||
// recreate scene when compositing gets disabled, TODO: remove with rendercontrol
|
// recreate scene when compositing gets disabled, TODO: remove with rendercontrol
|
||||||
#if !HAVE_RENDER_CONTROL
|
#if !HAVE_RENDER_CONTROL
|
||||||
if (!m_recreateNonCompositedConnection) {
|
if (!m_recreateNonCompositedConnection) {
|
||||||
|
@ -713,46 +714,13 @@ void ConfigurationModule::init()
|
||||||
uiFile.close();
|
uiFile.close();
|
||||||
layout()->addWidget(customConfigForm);
|
layout()->addWidget(customConfigForm);
|
||||||
// connect the ui file with the skeleton
|
// connect the ui file with the skeleton
|
||||||
m_configManager = new KConfigDialogManager(customConfigForm, m_skeleton);
|
addConfig(m_skeleton, customConfigForm);
|
||||||
m_configManager->updateWidgets();
|
|
||||||
connect(m_configManager, &KConfigDialogManager::widgetModified,
|
|
||||||
this, static_cast<void (ConfigurationModule::*)()>(&KCModule::changed));
|
|
||||||
|
|
||||||
// send a custom event to the translator to retranslate using our translator
|
// send a custom event to the translator to retranslate using our translator
|
||||||
QEvent le(QEvent::LanguageChange);
|
QEvent le(QEvent::LanguageChange);
|
||||||
QCoreApplication::sendEvent(customConfigForm, &le);
|
QCoreApplication::sendEvent(customConfigForm, &le);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigurationModule::defaults()
|
|
||||||
{
|
|
||||||
if (m_configManager) {
|
|
||||||
m_configManager->updateWidgetsDefault();
|
|
||||||
}
|
|
||||||
KCModule::defaults();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigurationModule::load()
|
|
||||||
{
|
|
||||||
if (m_skeleton) {
|
|
||||||
m_skeleton->load();
|
|
||||||
}
|
|
||||||
if (m_configManager) {
|
|
||||||
m_configManager->updateWidgets();
|
|
||||||
}
|
|
||||||
KCModule::load();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ConfigurationModule::save()
|
|
||||||
{
|
|
||||||
if (m_configManager) {
|
|
||||||
m_configManager->updateSettings();
|
|
||||||
}
|
|
||||||
if (m_skeleton) {
|
|
||||||
m_skeleton->save();
|
|
||||||
}
|
|
||||||
KCModule::save();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "aurorae.moc"
|
#include "aurorae.moc"
|
||||||
|
|
|
@ -34,7 +34,6 @@ class QQuickWindow;
|
||||||
class QWindow;
|
class QWindow;
|
||||||
|
|
||||||
class KConfigLoader;
|
class KConfigLoader;
|
||||||
class KConfigDialogManager;
|
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
@ -62,6 +61,9 @@ public Q_SLOTS:
|
||||||
void init() override;
|
void init() override;
|
||||||
void installTitleItem(QQuickItem *item);
|
void installTitleItem(QQuickItem *item);
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void configChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void hoverEnterEvent(QHoverEvent *event) override;
|
void hoverEnterEvent(QHoverEvent *event) override;
|
||||||
void hoverLeaveEvent(QHoverEvent *event) override;
|
void hoverLeaveEvent(QHoverEvent *event) override;
|
||||||
|
@ -119,16 +121,10 @@ class ConfigurationModule : public KCModule
|
||||||
public:
|
public:
|
||||||
ConfigurationModule(QWidget *parent, const QVariantList &args);
|
ConfigurationModule(QWidget *parent, const QVariantList &args);
|
||||||
|
|
||||||
public Q_SLOTS:
|
|
||||||
void defaults() override;
|
|
||||||
void load() override;
|
|
||||||
void save() override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
QString m_theme;
|
QString m_theme;
|
||||||
KConfigLoader *m_skeleton = nullptr;
|
KConfigLoader *m_skeleton = nullptr;
|
||||||
KConfigDialogManager *m_configManager = nullptr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -413,4 +413,8 @@ Decoration {
|
||||||
maximizedBorders.setTitle(top.maximizedHeight);
|
maximizedBorders.setTitle(top.maximizedHeight);
|
||||||
readConfig();
|
readConfig();
|
||||||
}
|
}
|
||||||
|
Connections {
|
||||||
|
target: decoration
|
||||||
|
onConfigChanged: root.readConfig()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,6 +180,8 @@ void SettingsImpl::readSettings()
|
||||||
m_borderSize = size;
|
m_borderSize = size;
|
||||||
emit decorationSettings()->borderSizeChanged(m_borderSize);
|
emit decorationSettings()->borderSizeChanged(m_borderSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emit decorationSettings()->reconfigured();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ add_library(kdecorationprivatedeclarative SHARED ${plugin_SRCS})
|
||||||
target_link_libraries(kdecorationprivatedeclarative
|
target_link_libraries(kdecorationprivatedeclarative
|
||||||
KDecoration2::KDecoration
|
KDecoration2::KDecoration
|
||||||
KDecoration2::KDecoration2Private
|
KDecoration2::KDecoration2Private
|
||||||
|
Qt5::DBus
|
||||||
Qt5::Quick
|
Qt5::Quick
|
||||||
KF5::CoreAddons
|
KF5::CoreAddons
|
||||||
KF5::ConfigWidgets
|
KF5::ConfigWidgets
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#include <KPluginTrader>
|
#include <KPluginTrader>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDBusConnection>
|
||||||
|
#include <QDBusMessage>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
@ -195,7 +197,18 @@ void PreviewBridge::configure()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(&dialog, &QDialog::accepted, kcm, &KCModule::save);
|
auto save = [this,kcm] {
|
||||||
|
kcm->save();
|
||||||
|
if (!m_lastCreatedSettings) {
|
||||||
|
}
|
||||||
|
emit m_lastCreatedSettings->decorationSettings()->reconfigured();
|
||||||
|
// Send signal to all kwin instances
|
||||||
|
QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KWin"),
|
||||||
|
QStringLiteral("org.kde.KWin"),
|
||||||
|
QStringLiteral("reloadConfig"));
|
||||||
|
QDBusConnection::sessionBus().send(message);
|
||||||
|
};
|
||||||
|
connect(&dialog, &QDialog::accepted, this, save);
|
||||||
|
|
||||||
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok |
|
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok |
|
||||||
QDialogButtonBox::Cancel |
|
QDialogButtonBox::Cancel |
|
||||||
|
@ -211,7 +224,7 @@ void PreviewBridge::configure()
|
||||||
// Here we connect our buttons with the dialog
|
// Here we connect our buttons with the dialog
|
||||||
connect(buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
|
connect(buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
|
||||||
connect(buttons, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
connect(buttons, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
||||||
connect(apply, &QPushButton::clicked, kcm, &KCModule::save);
|
connect(apply, &QPushButton::clicked, this, save);
|
||||||
connect(reset, &QPushButton::clicked, kcm, &KCModule::load);
|
connect(reset, &QPushButton::clicked, kcm, &KCModule::load);
|
||||||
auto changedSignal = static_cast<void(KCModule::*)(bool)>(&KCModule::changed);
|
auto changedSignal = static_cast<void(KCModule::*)(bool)>(&KCModule::changed);
|
||||||
connect(kcm, changedSignal, apply, &QPushButton::setEnabled);
|
connect(kcm, changedSignal, apply, &QPushButton::setEnabled);
|
||||||
|
|
Loading…
Reference in New Issue