Changeset View
Changeset View
Standalone View
Standalone View
kcms/lookandfeel/kcm.cpp
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 59 | KCMLookandFeel::KCMLookandFeel(QObject* parent, const QVariantList& args) | |||
---|---|---|---|---|---|
63 | , m_applyColors(true) | 63 | , m_applyColors(true) | ||
64 | , m_applyWidgetStyle(true) | 64 | , m_applyWidgetStyle(true) | ||
65 | , m_applyIcons(true) | 65 | , m_applyIcons(true) | ||
66 | , m_applyPlasmaTheme(true) | 66 | , m_applyPlasmaTheme(true) | ||
67 | , m_applyCursors(true) | 67 | , m_applyCursors(true) | ||
68 | , m_applyWindowSwitcher(true) | 68 | , m_applyWindowSwitcher(true) | ||
69 | , m_applyDesktopSwitcher(true) | 69 | , m_applyDesktopSwitcher(true) | ||
70 | , m_resetDefaultLayout(false) | 70 | , m_resetDefaultLayout(false) | ||
71 | , m_applyWindowDecoration(true) | ||||
71 | { | 72 | { | ||
72 | //This flag seems to be needed in order for QQuickWidget to work | 73 | //This flag seems to be needed in order for QQuickWidget to work | ||
73 | //see https://bugreports.qt-project.org/browse/QTBUG-40765 | 74 | //see https://bugreports.qt-project.org/browse/QTBUG-40765 | ||
74 | //also, it seems to work only if set in the kcm, not in the systemsettings' main | 75 | //also, it seems to work only if set in the kcm, not in the systemsettings' main | ||
75 | qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); | 76 | qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); | ||
76 | qmlRegisterType<QStandardItemModel>(); | 77 | qmlRegisterType<QStandardItemModel>(); | ||
77 | qmlRegisterType<KCMLookandFeel>(); | 78 | qmlRegisterType<KCMLookandFeel>(); | ||
78 | KAboutData* about = new KAboutData(QStringLiteral("kcm_lookandfeel"), i18n("Configure Look and Feel details"), | 79 | KAboutData* about = new KAboutData(QStringLiteral("kcm_lookandfeel"), i18n("Configure Look and Feel details"), | ||
▲ Show 20 Lines • Show All 245 Lines • ▼ Show 20 Line(s) | 322 | if (m_applyWindowSwitcher) { | |||
324 | setWindowSwitcher(cg.readEntry("LayoutName", QString())); | 325 | setWindowSwitcher(cg.readEntry("LayoutName", QString())); | ||
325 | } | 326 | } | ||
326 | 327 | | |||
327 | if (m_applyDesktopSwitcher) { | 328 | if (m_applyDesktopSwitcher) { | ||
328 | cg = KConfigGroup(conf, "kwinrc"); | 329 | cg = KConfigGroup(conf, "kwinrc"); | ||
329 | cg = KConfigGroup(&cg, "DesktopSwitcher"); | 330 | cg = KConfigGroup(&cg, "DesktopSwitcher"); | ||
330 | setDesktopSwitcher(cg.readEntry("LayoutName", QString())); | 331 | setDesktopSwitcher(cg.readEntry("LayoutName", QString())); | ||
331 | } | 332 | } | ||
333 | | ||||
334 | if (m_applyWindowDecoration) { | ||||
335 | cg = KConfigGroup(conf, "kwinrc"); | ||||
336 | cg = KConfigGroup(&cg, "org.kde.kdecoration2"); | ||||
337 | setWindowDecoration(cg.readEntry("library", QStringLiteral("org.kde.breeze")), cg.readEntry("theme", QString())); | ||||
graesslin: what remains is that this is not the default used in KWin.
In KWin it's:
static const… | |||||
problem is that HAVE_BREEZE_DECO and BREEZE_KDECORATION_PLUGIN_ID are not things i could have access frmo plasma-desktop? mart: problem is that HAVE_BREEZE_DECO and BREEZE_KDECORATION_PLUGIN_ID are not things i could have… | |||||
but does aurorae work if no theme is speacified? does it have a safe fallback hardcoded one? mart: but does aurorae work if no theme is speacified? does it have a safe fallback hardcoded one? | |||||
338 | } | ||||
332 | } | 339 | } | ||
333 | 340 | | |||
334 | //TODO: option to enable/disable apply? they don't seem required by UI design | 341 | //TODO: option to enable/disable apply? they don't seem required by UI design | ||
I think you got that part wrong. The difference is the value passed to library. graesslin: I think you got that part wrong. The difference is the value passed to library. | |||||
mart: eew, sorry, that's what you get for writing that before cofee :/ | |||||
335 | setSplashScreen(m_selectedPlugin); | 342 | setSplashScreen(m_selectedPlugin); | ||
336 | setLockScreen(m_selectedPlugin); | 343 | setLockScreen(m_selectedPlugin); | ||
337 | 344 | | |||
338 | m_configGroup.sync(); | 345 | m_configGroup.sync(); | ||
339 | runRdb(KRdbExportQtColors | KRdbExportGtkTheme | KRdbExportColors | KRdbExportQtSettings | KRdbExportXftSettings); | 346 | runRdb(KRdbExportQtColors | KRdbExportGtkTheme | KRdbExportColors | KRdbExportQtSettings | KRdbExportXftSettings); | ||
340 | } | 347 | } | ||
341 | 348 | | |||
342 | void KCMLookandFeel::defaults() | 349 | void KCMLookandFeel::defaults() | ||
▲ Show 20 Lines • Show All 272 Lines • ▼ Show 20 Line(s) | 613 | { | |||
615 | cg.sync(); | 622 | cg.sync(); | ||
616 | // Reload KWin. | 623 | // Reload KWin. | ||
617 | QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KWin"), | 624 | QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KWin"), | ||
618 | QStringLiteral("org.kde.KWin"), | 625 | QStringLiteral("org.kde.KWin"), | ||
619 | QStringLiteral("reloadConfig")); | 626 | QStringLiteral("reloadConfig")); | ||
620 | QDBusConnection::sessionBus().send(message); | 627 | QDBusConnection::sessionBus().send(message); | ||
621 | } | 628 | } | ||
622 | 629 | | |||
630 | void KCMLookandFeel::setWindowDecoration(const QString &library, const QString &theme) | ||||
631 | { | ||||
632 | if (library.isEmpty()) { | ||||
633 | return; | ||||
634 | } | ||||
635 | | ||||
636 | KConfig config(QStringLiteral("kwinrc")); | ||||
637 | KConfigGroup cg(&config, "org.kde.kdecoration2"); | ||||
638 | cg.writeEntry("library", library); | ||||
639 | cg.writeEntry("theme", theme); | ||||
640 | | ||||
641 | cg.sync(); | ||||
642 | // Reload KWin. | ||||
643 | QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KWin"), | ||||
644 | QStringLiteral("org.kde.KWin"), | ||||
645 | QStringLiteral("reloadConfig")); | ||||
646 | QDBusConnection::sessionBus().send(message); | ||||
now we have two sections which will reload KWin's config. Can we merge that? A reload of KWin's config can be really expensive and we don't want to do that twice. graesslin: now we have two sections which will reload KWin's config. Can we merge that? A reload of KWin's… | |||||
mart: maybe an even compression with a timer? | |||||
graesslin: in KWin? eh, no, please not. | |||||
mart: nono, i meant in the kcm :) | |||||
ok :-) yeah that could be neat as it also allows to unstress the system a bit. graesslin: ok :-) yeah that could be neat as it also allows to unstress the system a bit. | |||||
647 | } | ||||
623 | 648 | | |||
624 | void KCMLookandFeel::setApplyColors(bool apply) | 649 | void KCMLookandFeel::setApplyColors(bool apply) | ||
625 | { | 650 | { | ||
626 | if (m_applyColors == apply) { | 651 | if (m_applyColors == apply) { | ||
627 | return; | 652 | return; | ||
628 | } | 653 | } | ||
629 | 654 | | |||
630 | m_applyColors = apply; | 655 | m_applyColors = apply; | ||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |
what remains is that this is not the default used in KWin.
In KWin it's: