Commit 2df91d68 authored by Harald Sitter's avatar Harald Sitter 🌈
Browse files

fix placeholdermessage centering

they spanned the entire height which looked super silly bc there'd be
large amounts of space between text and button. wrap them in an item so
they have something to center in and forward the parent width
accordingly.
this now correctly centers them.
parent 371c590c
......@@ -9,7 +9,7 @@ import QtQuick.Layouts 1.14
import org.kde.kirigami 2.12 as Kirigami
import org.kde.filesharing.samba 1.0 as Samba
Kirigami.PlaceholderMessage {
Item {
Samba.Installer {
id: installer
......@@ -26,26 +26,31 @@ Kirigami.PlaceholderMessage {
}
}
text: i18nc("@label", "Samba must be installed before folders can be shared.")
helpfulAction: Kirigami.Action {
iconName: "install"
text: i18nc("@button", "Install Samba")
onTriggered: installer.install()
enabled: !installer.installing && !installer.installed
}
Kirigami.PlaceholderMessage {
anchors.centerIn: parent
width: parent.width
QQC2.Label {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
text: i18nc("@label", "The Samba package failed to install.")
wrapMode: Text.Wrap
visible: installer.failed
}
QQC2.ProgressBar {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.margins: Kirigami.Units.largeSpacing * 2
indeterminate: true
visible: installer.installing
text: i18nc("@label", "Samba must be installed before folders can be shared.")
helpfulAction: Kirigami.Action {
iconName: "install"
text: i18nc("@button", "Install Samba")
onTriggered: installer.install()
enabled: !installer.installing && !installer.installed
}
QQC2.Label {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
text: i18nc("@label", "The Samba package failed to install.")
wrapMode: Text.Wrap
visible: installer.failed
}
QQC2.ProgressBar {
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.margins: Kirigami.Units.largeSpacing * 2
indeterminate: true
visible: installer.installing
}
}
}
......@@ -9,11 +9,16 @@ import QtQuick.Layouts 1.14
import org.kde.kirigami 2.12 as Kirigami
import org.kde.filesharing.samba 1.0 as Samba
Kirigami.PlaceholderMessage {
text: i18nc("@label", "Restart the computer to complete the changes.")
helpfulAction: Kirigami.Action {
iconName: "system-restart"
text: i18nc("@button restart the system", "Restart")
onTriggered: sambaPlugin.reboot()
Item {
Kirigami.PlaceholderMessage {
anchors.centerIn: parent
width: parent.width
text: i18nc("@label", "Restart the computer to complete the changes.")
helpfulAction: Kirigami.Action {
iconName: "system-restart"
text: i18nc("@button restart the system", "Restart")
onTriggered: sambaPlugin.reboot()
}
}
}
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