[kcmkwin/kwindecoration] Rewrite the KWin decorations settings as a ConfigModule
Summary:
* Wrote new KCM based on KQuickAddons::ConfigModule.
* Remade QMLs for Buttons and Themes tabs.
* Updated bridge model code for new plugin lookup API (fixes warnings).
* Fixed decoration shadow changing messing with the previews sizes.
* Fixed button drag and drop issues (see D18104).
* Fixed default settings button behavior and detection of settings changes.
* Updated Get Hot New Stuff.
* Removed apply button in previewbridge.cpp: After applying changes, a theme's KCModule is invalidated.
BUG: 389431
BUG: 350122
BUG: 346222
BUG: 342816
BUG: 397595
{F6574963} | {F6574962} | {F6574961} | {F6574960}
Test Plan:
* Verified saving and loading for every setting
* Checked shadows of Breeze and Oxygen
* Tested all possible drag&drop operations on both sides of the fake titlebar
* Changed color schemes (with `kcmshell5 colors`) while showing the Themes tab to see if all previews update correctly their palettes
* Tested on a fresh Neon-developer account, via kcmshell and systemsettings
Reviewers: #vdg, abetts, ngraham, #kwin, davidedmundson
Reviewed By: #vdg, #kwin, davidedmundson
Subscribers: zzag, GB_2, ngraham, broulik, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18458
2019-02-07 15:32:05 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
* Copyright (c) 2019 Valerio Pilo <vpilo@coldshock.net>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License or (at your option) version 3 or any later version
|
|
|
|
* accepted by the membership of KDE e.V. (or its successor approved
|
|
|
|
* by the membership of KDE e.V.), which shall act as a proxy
|
|
|
|
* defined in Section 14 of version 3 of the license.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
import QtQuick 2.7
|
|
|
|
import org.kde.kcm 1.1 as KCM
|
|
|
|
import org.kde.kirigami 2.2 as Kirigami
|
|
|
|
import org.kde.kwin.private.kdecoration 1.0 as KDecoration
|
|
|
|
|
|
|
|
KCM.GridView {
|
|
|
|
function updateDecoration(item, marginTopLeft, marginBottomRight) {
|
|
|
|
var mainMargin = units.largeSpacing
|
|
|
|
var shd = item.shadow
|
|
|
|
item.anchors.leftMargin = mainMargin + marginTopLeft - (shd ? shd.paddingLeft : 0)
|
|
|
|
item.anchors.rightMargin = mainMargin + marginBottomRight - (shd ? shd.paddingRight : 0)
|
|
|
|
item.anchors.topMargin = mainMargin + marginTopLeft - (shd ? shd.paddingTop : 0)
|
|
|
|
item.anchors.bottomMargin = mainMargin + marginBottomRight - (shd ? shd.paddingBottom : 0)
|
|
|
|
}
|
|
|
|
|
|
|
|
view.model: kcm.themesModel
|
|
|
|
view.currentIndex: kcm.theme
|
|
|
|
view.onContentHeightChanged: view.positionViewAtIndex(view.currentIndex, GridView.Visible)
|
|
|
|
|
2019-03-14 08:34:48 +00:00
|
|
|
view.implicitCellWidth: Kirigami.Units.gridUnit * 18
|
[kcmkwin/kwindecoration] Rewrite the KWin decorations settings as a ConfigModule
Summary:
* Wrote new KCM based on KQuickAddons::ConfigModule.
* Remade QMLs for Buttons and Themes tabs.
* Updated bridge model code for new plugin lookup API (fixes warnings).
* Fixed decoration shadow changing messing with the previews sizes.
* Fixed button drag and drop issues (see D18104).
* Fixed default settings button behavior and detection of settings changes.
* Updated Get Hot New Stuff.
* Removed apply button in previewbridge.cpp: After applying changes, a theme's KCModule is invalidated.
BUG: 389431
BUG: 350122
BUG: 346222
BUG: 342816
BUG: 397595
{F6574963} | {F6574962} | {F6574961} | {F6574960}
Test Plan:
* Verified saving and loading for every setting
* Checked shadows of Breeze and Oxygen
* Tested all possible drag&drop operations on both sides of the fake titlebar
* Changed color schemes (with `kcmshell5 colors`) while showing the Themes tab to see if all previews update correctly their palettes
* Tested on a fresh Neon-developer account, via kcmshell and systemsettings
Reviewers: #vdg, abetts, ngraham, #kwin, davidedmundson
Reviewed By: #vdg, #kwin, davidedmundson
Subscribers: zzag, GB_2, ngraham, broulik, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18458
2019-02-07 15:32:05 +00:00
|
|
|
|
|
|
|
view.delegate: KCM.GridDelegate {
|
2020-05-06 13:15:03 +00:00
|
|
|
id: delegate
|
[kcmkwin/kwindecoration] Rewrite the KWin decorations settings as a ConfigModule
Summary:
* Wrote new KCM based on KQuickAddons::ConfigModule.
* Remade QMLs for Buttons and Themes tabs.
* Updated bridge model code for new plugin lookup API (fixes warnings).
* Fixed decoration shadow changing messing with the previews sizes.
* Fixed button drag and drop issues (see D18104).
* Fixed default settings button behavior and detection of settings changes.
* Updated Get Hot New Stuff.
* Removed apply button in previewbridge.cpp: After applying changes, a theme's KCModule is invalidated.
BUG: 389431
BUG: 350122
BUG: 346222
BUG: 342816
BUG: 397595
{F6574963} | {F6574962} | {F6574961} | {F6574960}
Test Plan:
* Verified saving and loading for every setting
* Checked shadows of Breeze and Oxygen
* Tested all possible drag&drop operations on both sides of the fake titlebar
* Changed color schemes (with `kcmshell5 colors`) while showing the Themes tab to see if all previews update correctly their palettes
* Tested on a fresh Neon-developer account, via kcmshell and systemsettings
Reviewers: #vdg, abetts, ngraham, #kwin, davidedmundson
Reviewed By: #vdg, #kwin, davidedmundson
Subscribers: zzag, GB_2, ngraham, broulik, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18458
2019-02-07 15:32:05 +00:00
|
|
|
text: model.display
|
|
|
|
|
|
|
|
thumbnailAvailable: true
|
|
|
|
thumbnail: Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
color: palette.base
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
KDecoration.Bridge {
|
|
|
|
id: bridgeItem
|
|
|
|
plugin: model.plugin
|
|
|
|
theme: model.theme
|
|
|
|
}
|
|
|
|
KDecoration.Settings {
|
|
|
|
id: settingsItem
|
|
|
|
bridge: bridgeItem.bridge
|
|
|
|
}
|
|
|
|
KDecoration.Decoration {
|
|
|
|
id: inactivePreview
|
|
|
|
bridge: bridgeItem.bridge
|
|
|
|
settings: settingsItem
|
|
|
|
anchors.fill: parent
|
|
|
|
onShadowChanged: updateDecoration(inactivePreview, 0, client.decoration.titleBar.height)
|
|
|
|
Component.onCompleted: {
|
|
|
|
client.active = false
|
|
|
|
client.caption = model.display
|
|
|
|
updateDecoration(inactivePreview, 0, client.decoration.titleBar.height)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
KDecoration.Decoration {
|
|
|
|
id: activePreview
|
|
|
|
bridge: bridgeItem.bridge
|
|
|
|
settings: settingsItem
|
|
|
|
anchors.fill: parent
|
|
|
|
onShadowChanged: updateDecoration(activePreview, client.decoration.titleBar.height, 0)
|
|
|
|
Component.onCompleted: {
|
|
|
|
client.active = true
|
|
|
|
client.caption = model.display
|
|
|
|
updateDecoration(activePreview, client.decoration.titleBar.height, 0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
2019-12-06 13:11:29 +00:00
|
|
|
onClicked: {
|
|
|
|
kcm.theme = index
|
|
|
|
view.currentIndex = index
|
|
|
|
}
|
[kcmkwin/kwindecoration] Rewrite the KWin decorations settings as a ConfigModule
Summary:
* Wrote new KCM based on KQuickAddons::ConfigModule.
* Remade QMLs for Buttons and Themes tabs.
* Updated bridge model code for new plugin lookup API (fixes warnings).
* Fixed decoration shadow changing messing with the previews sizes.
* Fixed button drag and drop issues (see D18104).
* Fixed default settings button behavior and detection of settings changes.
* Updated Get Hot New Stuff.
* Removed apply button in previewbridge.cpp: After applying changes, a theme's KCModule is invalidated.
BUG: 389431
BUG: 350122
BUG: 346222
BUG: 342816
BUG: 397595
{F6574963} | {F6574962} | {F6574961} | {F6574960}
Test Plan:
* Verified saving and loading for every setting
* Checked shadows of Breeze and Oxygen
* Tested all possible drag&drop operations on both sides of the fake titlebar
* Changed color schemes (with `kcmshell5 colors`) while showing the Themes tab to see if all previews update correctly their palettes
* Tested on a fresh Neon-developer account, via kcmshell and systemsettings
Reviewers: #vdg, abetts, ngraham, #kwin, davidedmundson
Reviewed By: #vdg, #kwin, davidedmundson
Subscribers: zzag, GB_2, ngraham, broulik, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18458
2019-02-07 15:32:05 +00:00
|
|
|
}
|
|
|
|
Connections {
|
|
|
|
target: kcm
|
|
|
|
onBorderSizeChanged: settingsItem.borderSizesIndex = kcm.borderSize
|
|
|
|
}
|
|
|
|
}
|
|
|
|
actions: [
|
|
|
|
Kirigami.Action {
|
|
|
|
iconName: "edit-entry"
|
|
|
|
tooltip: i18n("Edit %1 Theme", model.display)
|
|
|
|
enabled: model.configureable
|
|
|
|
onTriggered: {
|
2019-12-06 13:11:29 +00:00
|
|
|
kcm.theme = index
|
[kcmkwin/kwindecoration] Rewrite the KWin decorations settings as a ConfigModule
Summary:
* Wrote new KCM based on KQuickAddons::ConfigModule.
* Remade QMLs for Buttons and Themes tabs.
* Updated bridge model code for new plugin lookup API (fixes warnings).
* Fixed decoration shadow changing messing with the previews sizes.
* Fixed button drag and drop issues (see D18104).
* Fixed default settings button behavior and detection of settings changes.
* Updated Get Hot New Stuff.
* Removed apply button in previewbridge.cpp: After applying changes, a theme's KCModule is invalidated.
BUG: 389431
BUG: 350122
BUG: 346222
BUG: 342816
BUG: 397595
{F6574963} | {F6574962} | {F6574961} | {F6574960}
Test Plan:
* Verified saving and loading for every setting
* Checked shadows of Breeze and Oxygen
* Tested all possible drag&drop operations on both sides of the fake titlebar
* Changed color schemes (with `kcmshell5 colors`) while showing the Themes tab to see if all previews update correctly their palettes
* Tested on a fresh Neon-developer account, via kcmshell and systemsettings
Reviewers: #vdg, abetts, ngraham, #kwin, davidedmundson
Reviewed By: #vdg, #kwin, davidedmundson
Subscribers: zzag, GB_2, ngraham, broulik, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18458
2019-02-07 15:32:05 +00:00
|
|
|
view.currentIndex = index
|
2020-05-06 13:15:03 +00:00
|
|
|
bridgeItem.bridge.configure(delegate)
|
[kcmkwin/kwindecoration] Rewrite the KWin decorations settings as a ConfigModule
Summary:
* Wrote new KCM based on KQuickAddons::ConfigModule.
* Remade QMLs for Buttons and Themes tabs.
* Updated bridge model code for new plugin lookup API (fixes warnings).
* Fixed decoration shadow changing messing with the previews sizes.
* Fixed button drag and drop issues (see D18104).
* Fixed default settings button behavior and detection of settings changes.
* Updated Get Hot New Stuff.
* Removed apply button in previewbridge.cpp: After applying changes, a theme's KCModule is invalidated.
BUG: 389431
BUG: 350122
BUG: 346222
BUG: 342816
BUG: 397595
{F6574963} | {F6574962} | {F6574961} | {F6574960}
Test Plan:
* Verified saving and loading for every setting
* Checked shadows of Breeze and Oxygen
* Tested all possible drag&drop operations on both sides of the fake titlebar
* Changed color schemes (with `kcmshell5 colors`) while showing the Themes tab to see if all previews update correctly their palettes
* Tested on a fresh Neon-developer account, via kcmshell and systemsettings
Reviewers: #vdg, abetts, ngraham, #kwin, davidedmundson
Reviewed By: #vdg, #kwin, davidedmundson
Subscribers: zzag, GB_2, ngraham, broulik, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18458
2019-02-07 15:32:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
2019-12-06 13:11:29 +00:00
|
|
|
onClicked: {
|
|
|
|
kcm.theme = index
|
|
|
|
view.currentIndex = index
|
|
|
|
}
|
[kcmkwin/kwindecoration] Rewrite the KWin decorations settings as a ConfigModule
Summary:
* Wrote new KCM based on KQuickAddons::ConfigModule.
* Remade QMLs for Buttons and Themes tabs.
* Updated bridge model code for new plugin lookup API (fixes warnings).
* Fixed decoration shadow changing messing with the previews sizes.
* Fixed button drag and drop issues (see D18104).
* Fixed default settings button behavior and detection of settings changes.
* Updated Get Hot New Stuff.
* Removed apply button in previewbridge.cpp: After applying changes, a theme's KCModule is invalidated.
BUG: 389431
BUG: 350122
BUG: 346222
BUG: 342816
BUG: 397595
{F6574963} | {F6574962} | {F6574961} | {F6574960}
Test Plan:
* Verified saving and loading for every setting
* Checked shadows of Breeze and Oxygen
* Tested all possible drag&drop operations on both sides of the fake titlebar
* Changed color schemes (with `kcmshell5 colors`) while showing the Themes tab to see if all previews update correctly their palettes
* Tested on a fresh Neon-developer account, via kcmshell and systemsettings
Reviewers: #vdg, abetts, ngraham, #kwin, davidedmundson
Reviewed By: #vdg, #kwin, davidedmundson
Subscribers: zzag, GB_2, ngraham, broulik, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18458
2019-02-07 15:32:05 +00:00
|
|
|
}
|
|
|
|
Connections {
|
|
|
|
target: kcm
|
|
|
|
onThemeChanged: view.currentIndex = kcm.theme
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|