kcmkwin/kwindecoration: use Kirigami.ActionToolBar for the footer actions

This way, the footer actions collapse into a menu when there's not enough space
to show them all, instead of being cut off.

BUG: 460793
FIXED-IN: 5.26.2
This commit is contained in:
jrv ezg 2022-10-25 02:37:45 +00:00 committed by Nate Graham
parent 00b7f0394c
commit 7f7fa69135

View file

@ -9,7 +9,6 @@ import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15 as QQC2
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
@ -103,23 +102,22 @@ Kirigami.Page {
}
}
Item {
Layout.fillWidth: true
}
NewStuff.Button {
id: newstuffButton
text: i18nc("button text", "Get New Window Decorations...")
icon.name: "get-hot-new-stuff"
visible: KAuthorized.authorize("ghns")
configFile: "window-decorations.knsrc"
onEntryEvent: (entry, event) => {
if (event === NewStuff.Engine.StatusChangedEvent) {
kcm.reloadKWinSettings();
} else if (event === NewStuff.Engine.EntryAdoptedEvent) {
kcm.load();
Kirigami.ActionToolBar {
flat: false
alignment: Qt.AlignRight
actions: [
NewStuff.Action {
text: i18nc("button text", "Get New Window Decorations...")
configFile: "window-decorations.knsrc"
onEntryEvent: (entry, event) => {
if (event === NewStuff.Engine.StatusChangedEvent) {
kcm.reloadKWinSettings();
} else if (event === NewStuff.Engine.EntryAdoptedEvent) {
kcm.load();
}
}
}
}
]
}
}
}