Files
amnezia-client/client/ui/qml/Components/QuestionDrawer.qml
T

93 lines
2.2 KiB
QML
Raw Normal View History

2023-06-05 15:49:10 +08:00
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
2024-07-07 13:42:38 +03:00
import Style 1.0
2023-06-05 15:49:10 +08:00
import "../Controls2"
import "../Controls2/TextTypes"
2024-04-18 17:54:55 +04:00
import "../Config"
2024-02-16 15:24:06 +05:00
DrawerType2 {
2023-06-05 15:49:10 +08:00
id: root
property string headerText
property string descriptionText
property string yesButtonText
property string noButtonText
property var yesButtonFunction
property var noButtonFunction
2024-12-31 04:16:52 +01:00
expandedStateContent: ColumnLayout {
id: content
2023-06-05 15:49:10 +08:00
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
spacing: 8
2024-02-16 15:24:06 +05:00
onImplicitHeightChanged: {
root.expandedHeight = content.implicitHeight + 32
}
2023-06-05 15:49:10 +08:00
Header2TextType {
Layout.fillWidth: true
2024-02-16 15:24:06 +05:00
Layout.topMargin: 16
Layout.rightMargin: 16
Layout.leftMargin: 16
2023-06-05 15:49:10 +08:00
text: headerText
}
ParagraphTextType {
Layout.fillWidth: true
Layout.topMargin: 8
2024-02-16 15:24:06 +05:00
Layout.rightMargin: 16
Layout.leftMargin: 16
2023-06-05 15:49:10 +08:00
text: descriptionText
}
BasicButtonType {
2024-04-18 17:54:55 +04:00
id: yesButton
2023-06-05 15:49:10 +08:00
Layout.fillWidth: true
Layout.topMargin: 16
2024-02-16 15:24:06 +05:00
Layout.rightMargin: 16
Layout.leftMargin: 16
2023-06-05 15:49:10 +08:00
text: yesButtonText
clickedFunc: function() {
2023-06-05 15:49:10 +08:00
if (yesButtonFunction && typeof yesButtonFunction === "function") {
yesButtonFunction()
}
}
}
BasicButtonType {
2024-04-18 17:54:55 +04:00
id: noButton
2023-06-05 15:49:10 +08:00
Layout.fillWidth: true
2024-02-16 15:24:06 +05:00
Layout.rightMargin: 16
Layout.leftMargin: 16
2023-06-05 15:49:10 +08:00
2024-07-07 13:42:38 +03:00
defaultColor: AmneziaStyle.color.transparent
hoveredColor: AmneziaStyle.color.translucentWhite
pressedColor: AmneziaStyle.color.sheerWhite
disabledColor: AmneziaStyle.color.mutedGray
textColor: AmneziaStyle.color.paleGray
2023-06-05 15:49:10 +08:00
borderWidth: 1
text: noButtonText
clickedFunc: function() {
2023-06-05 15:49:10 +08:00
if (noButtonFunction && typeof noButtonFunction === "function") {
noButtonFunction()
}
}
}
}
}