Verified Commit 8b412aa7 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

Fix QML/JavaScript code style & bump imports

parent 2434ff10
Pipeline #190540 passed with stage
in 14 minutes and 49 seconds
......@@ -3,8 +3,9 @@
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
import QtQuick 2.7
import org.kde.kirigami 2.4 as Kirigami
import QtQuick 2.15
import org.kde.kirigami 2.20 as Kirigami
import org.kde.kwin.private.kdecoration 1.0 as KDecoration
ListView {
......
......@@ -4,12 +4,12 @@
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.4 as QQC2
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15 as QQC2
import org.kde.kcm 1.3 as KCM
import org.kde.kirigami 2.5 as Kirigami
import org.kde.kcm 1.6 as KCM
import org.kde.kirigami 2.20 as Kirigami
import org.kde.kwin.private.kdecoration 1.0 as KDecoration
// Fake Window
......
......@@ -4,20 +4,20 @@
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
import QtQuick 2.7
import QtQuick 2.15
import org.kde.kcm 1.3 as KCM
import org.kde.kirigami 2.2 as Kirigami
import org.kde.kcm 1.6 as KCM
import org.kde.kirigami 2.20 as Kirigami
import org.kde.kwin.private.kdecoration 1.0 as KDecoration
KCM.GridView {
function updateDecoration(item, marginTopLeft, marginBottomRight) {
var mainMargin = Kirigami.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)
const mainMargin = Kirigami.Units.largeSpacing;
const 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
......@@ -45,7 +45,7 @@ KCM.GridView {
id: settingsItem
bridge: bridgeItem.bridge
Component.onCompleted: {
settingsItem.borderSizesIndex = kcm.borderSize
settingsItem.borderSizesIndex = kcm.borderSize;
}
}
KDecoration.Decoration {
......@@ -55,9 +55,9 @@ KCM.GridView {
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)
client.active = false;
client.caption = model.display;
updateDecoration(inactivePreview, 0, client.decoration.titleBar.height);
}
}
KDecoration.Decoration {
......@@ -67,22 +67,22 @@ KCM.GridView {
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)
client.active = true;
client.caption = model.display;
updateDecoration(activePreview, client.decoration.titleBar.height, 0);
}
}
MouseArea {
anchors.fill: parent
onClicked: {
kcm.theme = index
view.currentIndex = index
kcm.theme = index;
view.currentIndex = index;
}
}
Connections {
target: kcm
function onBorderSizeChanged() {
settingsItem.borderSizesIndex = kcm.borderSize
settingsItem.borderSizesIndex = kcm.borderSize;
}
}
}
......@@ -92,16 +92,16 @@ KCM.GridView {
tooltip: i18n("Edit %1 Theme", model.display)
enabled: model.configureable
onTriggered: {
kcm.theme = index
view.currentIndex = index
bridgeItem.bridge.configure(delegate)
kcm.theme = index;
view.currentIndex = index;
bridgeItem.bridge.configure(delegate);
}
}
]
onClicked: {
kcm.theme = index
view.currentIndex = index
kcm.theme = index;
view.currentIndex = index;
}
onDoubleClicked: {
kcm.save();
......@@ -110,7 +110,7 @@ KCM.GridView {
Connections {
target: kcm
function onThemeChanged() {
view.currentIndex = kcm.theme
view.currentIndex = kcm.theme;
}
}
}
......
......@@ -4,14 +4,14 @@
SPDX-License-Identifier: LGPL-2.0-only
*/
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.4 as QQC2
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15 as QQC2
import org.kde.kcm 1.5 as KCM
import org.kde.kconfig 1.0 // for KAuthorized
import org.kde.kirigami 2.4 as Kirigami
import org.kde.newstuff 1.62 as NewStuff
import org.kde.kcm 1.6 as KCM
import org.kde.kconfig 1.0
import org.kde.kirigami 2.20 as Kirigami
import org.kde.newstuff 1.85 as NewStuff
Kirigami.Page {
id: root
......@@ -97,11 +97,9 @@ Kirigami.Page {
id: borderSizeComboBox
model: kcm.borderSizesModel
currentIndex: kcm.borderIndex
onActivated: {
kcm.borderIndex = currentIndex
}
onActivated: kcm.borderIndex = currentIndex;
KCM.SettingHighlighter {
highlight: kcm.borderIndex != 0
highlight: kcm.borderIndex !== 0
}
}
......@@ -115,11 +113,11 @@ Kirigami.Page {
icon.name: "get-hot-new-stuff"
visible: KAuthorized.authorize("ghns")
configFile: "window-decorations.knsrc"
onEntryEvent: function (entry, event) {
onEntryEvent: (entry, event) => {
if (event === NewStuff.Engine.StatusChangedEvent) {
kcm.reloadKWinSettings()
kcm.reloadKWinSettings();
} else if (event === NewStuff.Engine.EntryAdoptedEvent) {
kcm.load()
kcm.load();
}
}
}
......@@ -143,8 +141,8 @@ Kirigami.Page {
text: i18nc("checkbox label", "Close windows by double clicking the menu button")
checked: kcm.settings.closeOnDoubleClickOnMenu
onToggled: {
kcm.settings.closeOnDoubleClickOnMenu = checked
infoLabel.visible = checked
kcm.settings.closeOnDoubleClickOnMenu = checked;
infoLabel.visible = checked;
}
KCM.SettingStateBinding {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment