kcms/scripts: Move footer actions to the page header

…to avoid the "two stacked rows of buttons" effect.

Changes "Get New" button text to avoid redundancy because title already
contains the "Script" word in it.
This commit is contained in:
ivan tkachenko 2023-05-31 17:02:35 +03:00 committed by Vlad Zahorodnii
parent ae11658e0c
commit 417a7f3601

View file

@ -19,6 +19,24 @@ ScrollViewKCM {
implicitWidth: Kirigami.Units.gridUnit * 22
implicitHeight: Kirigami.Units.gridUnit * 20
actions: [
Kirigami.Action {
icon.name: "document-import"
text: i18n("Install from File…")
onTriggered: kcm.importScript()
},
NewStuff.Action {
text: i18nc("@action:button get new KWin scripts", "Get New…")
visible: KAuthorized.authorize(KAuthorized.GHNS)
configFile: "kwinscripts.knsrc"
onEntryEvent: (entry, event) => {
if (event === NewStuff.Engine.StatusChangedEvent) {
kcm.onGHNSEntriesChanged()
}
}
}
]
header: ColumnLayout {
spacing: Kirigami.Units.smallSpacing
@ -52,26 +70,4 @@ ScrollViewKCM {
]
}
}
footer: Kirigami.ActionToolBar {
flat: false
alignment: Qt.AlignRight
actions: [
Kirigami.Action {
icon.name: "document-import"
text: i18n("Install from File…")
onTriggered: kcm.importScript()
},
NewStuff.Action {
text: i18n("Get New Scripts…")
visible: KAuthorized.authorize(KAuthorized.GHNS)
configFile: "kwinscripts.knsrc"
onEntryEvent: (entry, event) => {
if (event === NewStuff.Engine.StatusChangedEvent) {
kcm.onGHNSEntriesChanged()
}
}
}
]
}
}