Commit 7b039a45 authored by Dan Leinir Turthra Jensen's avatar Dan Leinir Turthra Jensen 🌈 Committed by Nate Graham
Browse files

Use Kirigami.ActionToolBar to auto-resize the SDDM KCM's footer

Based on the work done for the Icons KCM, this change ensures that the
buttons at the bottom of the KCM actually fit in the window, by using
Kirigami.ActionToolBar's ability to collapse buttons which don't fit
into a popup menu style list of actions. Thanks to @ilyabizyae for
noticing this one.


(cherry picked from commit 8f389bae)
parent a6792411
......@@ -95,29 +95,61 @@ KCM.GridViewKCM {
]
onClicked: kcm.sddmSettings.current = model.id
}
footer: RowLayout {
QQC2.Button {
text: i18nc("@action:button", "Behavior...")
icon.name: "settings-configure"
onClicked: kcm.push("Advanced.qml")
}
QQC2.Button {
text: i18nc("@action:button", "Synchronize Settings...")
icon.name: "view-refresh"
onClicked: syncSheet.open()
}
Item {
Layout.fillWidth: true
footer: Kirigami.ActionToolBar {
flat: false
alignment: Qt.AlignRight
actions: [
Kirigami.Action {
text: i18nc("@action:button", "Behavior...")
icon.name: "settings-configure"
onTriggered: { kcm.push("Advanced.qml") }
},
Kirigami.Action {
text: i18nc("@action:button", "Synchronize Settings...")
icon.name: "view-refresh"
onTriggered: syncSheet.open()
},
Kirigami.Action {
text: i18nc("@action:button", "Install From File...")
icon.name: "document-import"
onTriggered: themeDialog.open()
},
Kirigami.Action {
text: i18nc("@action:button", "Get New SDDM Themes...")
icon.name: "get-hot-new-stuff"
onTriggered: newStuffPage.open()
}
]
}
Loader {
id: newStuffPage
// Use this function to open the dialog. It seems roundabout, but this ensures
// that the dialog is not constructed until we want it to be shown the first time,
// since it will initialise itself on the first load (which causes it to phone
// home) and we don't want that until the user explicitly asks for it.
function open() {
if (item) {
item.open();
} else {
active = true;
}
}
QQC2.Button {
text: i18nc("@action:button", "Install From File...")
icon.name: "document-import"
onClicked: themeDialog.open()
onLoaded: {
item.open();
}
NewStuff.Button {
active: false
asynchronous: true
sourceComponent: NewStuff.Dialog {
configFile: "sddmtheme.knsrc"
downloadNewWhat: i18n("SDDM Themes")
onChangedEntriesChanged: kcm.themesModel.populate()
Connections {
target: newStuffPage.item.engine.engine
function onSignalEntryEvent(entry, event) {
kcm.themesModel.populate();
}
}
}
}
FileDialog {
......
Markdown is supported
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