mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-24 04:28:58 +00:00
feat(SettingsDirtyToastMessage): Extended with additional information component in bottom
- Updated layout using `ColumnLayout`. - Added additional text component on bottom according to new designs.
This commit is contained in:
parent
d35c0bd3d1
commit
c93a8d2c6f
@ -5,6 +5,7 @@ import QtGraphicalEffects 1.15
|
|||||||
import utils 1.0
|
import utils 1.0
|
||||||
|
|
||||||
import shared.controls 1.0
|
import shared.controls 1.0
|
||||||
|
import shared.panels 1.0
|
||||||
|
|
||||||
import StatusQ.Core 0.1
|
import StatusQ.Core 0.1
|
||||||
import StatusQ.Core.Theme 0.1
|
import StatusQ.Core.Theme 0.1
|
||||||
@ -23,6 +24,7 @@ Rectangle {
|
|||||||
property alias saveForLaterText: saveForLaterButton.text
|
property alias saveForLaterText: saveForLaterButton.text
|
||||||
property alias cancelChangesText: cancelChangesButton.text
|
property alias cancelChangesText: cancelChangesButton.text
|
||||||
property alias changesDetectedText: changesDetectedTextItem.text
|
property alias changesDetectedText: changesDetectedTextItem.text
|
||||||
|
property alias additionalComponent: additionalTextComponent
|
||||||
|
|
||||||
readonly property string defaultChangesDetectedText: qsTr("Changes detected")
|
readonly property string defaultChangesDetectedText: qsTr("Changes detected")
|
||||||
readonly property string defaultSaveChangesText: qsTr("Save changes")
|
readonly property string defaultSaveChangesText: qsTr("Save changes")
|
||||||
@ -114,50 +116,68 @@ Rectangle {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
ColumnLayout {
|
||||||
id: toastContent
|
id: toastContent
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Style.current.padding
|
||||||
|
spacing: Style.current.padding
|
||||||
|
|
||||||
anchors {
|
RowLayout {
|
||||||
fill: parent
|
Layout.alignment: Qt.AlignHCenter
|
||||||
margins: 16
|
|
||||||
|
StatusBaseText {
|
||||||
|
id: changesDetectedTextItem
|
||||||
|
Layout.fillWidth: true
|
||||||
|
padding: 8
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
color: Theme.palette.directColor1
|
||||||
|
text: root.defaultChangesDetectedText
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusButton {
|
||||||
|
id: cancelChangesButton
|
||||||
|
text: root.defaultCancelChangesText
|
||||||
|
enabled: !root.loading && root.active
|
||||||
|
visible: root.cancelButtonVisible
|
||||||
|
type: StatusBaseButton.Type.Danger
|
||||||
|
onClicked: root.resetChangesClicked()
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusFlatButton {
|
||||||
|
id: saveForLaterButton
|
||||||
|
text: root.defaultSaveForLaterText
|
||||||
|
loading: root.loading
|
||||||
|
enabled: root.active && root.saveChangesButtonEnabled
|
||||||
|
visible: root.saveForLaterButtonVisible
|
||||||
|
onClicked: root.saveForLaterClicked()
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusButton {
|
||||||
|
id: saveChangesButton
|
||||||
|
|
||||||
|
objectName: "settingsDirtyToastMessageSaveButton"
|
||||||
|
loading: root.loading
|
||||||
|
text: root.defaultSaveChangesText
|
||||||
|
interactive: root.active && root.saveChangesButtonEnabled
|
||||||
|
tooltip.text: root.saveChangesTooltipText
|
||||||
|
onClicked: root.saveChangesClicked()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
id: separator
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
visible: additionalTextComponent.visible
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusBaseText {
|
StatusBaseText {
|
||||||
id: changesDetectedTextItem
|
id: additionalTextComponent
|
||||||
Layout.fillWidth: true
|
|
||||||
padding: 8
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
color: Theme.palette.directColor1
|
|
||||||
text: root.defaultChangesDetectedText
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusButton {
|
Layout.alignment: Qt.AlignHCenter
|
||||||
id: cancelChangesButton
|
|
||||||
text: root.defaultCancelChangesText
|
|
||||||
enabled: !root.loading && root.active
|
|
||||||
visible: root.cancelButtonVisible
|
|
||||||
type: StatusBaseButton.Type.Danger
|
|
||||||
onClicked: root.resetChangesClicked()
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusFlatButton {
|
font.pixelSize: Theme.tertiaryTextFontSize
|
||||||
id: saveForLaterButton
|
visible: false
|
||||||
text: root.defaultSaveForLaterText
|
|
||||||
loading: root.loading
|
|
||||||
enabled: root.active && root.saveChangesButtonEnabled
|
|
||||||
visible: root.saveForLaterButtonVisible
|
|
||||||
onClicked: root.saveForLaterClicked()
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusButton {
|
|
||||||
id: saveChangesButton
|
|
||||||
|
|
||||||
objectName: "settingsDirtyToastMessageSaveButton"
|
|
||||||
loading: root.loading
|
|
||||||
text: root.defaultSaveChangesText
|
|
||||||
interactive: root.active && root.saveChangesButtonEnabled
|
|
||||||
tooltip.text: root.saveChangesTooltipText
|
|
||||||
onClicked: root.saveChangesClicked()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user