Commit 8dffa309 authored by Chupligin Sergey's avatar Chupligin Sergey

Fix desigin of QueryDialog

parent 484bd20e
...@@ -42,10 +42,14 @@ Page { ...@@ -42,10 +42,14 @@ Page {
headerTools: HeaderToolsLayout { showBackButton: true; title: "Query dialog example" } headerTools: HeaderToolsLayout { showBackButton: true; title: "Query dialog example" }
QueryDialog { QueryDialog {
cancelText: "Cancel" cancelText: qsTr("Cancel")
acceptText: "Delete" acceptText: qsTr("Delete")
headingText: "Are you sure you want to delete this?" headingText: qsTr("Are you sure you want to delete this?")
subLabelText: "Continue?" subLabelText: qsTr("Do you want to continue?")
icon: "image://theme/trash"
image: "/usr/share/glacier-components/images/example.jpg"
onAccepted: { onAccepted: {
result.text = "User accepted" result.text = "User accepted"
} }
......
...@@ -31,6 +31,7 @@ qml.files += \ ...@@ -31,6 +31,7 @@ qml.files += \
qml.path = /usr/share/glacier-components/content qml.path = /usr/share/glacier-components/content
images.files = images/*.png images.files = images/*.png
images.files += images/*.jpg
images.path = /usr/share/glacier-components/images images.path = /usr/share/glacier-components/images
OTHER_FILES += $$qml.files OTHER_FILES += $$qml.files
......
...@@ -11,30 +11,61 @@ Item { ...@@ -11,30 +11,61 @@ Item {
property alias headingText: heading.text property alias headingText: heading.text
property alias subLabelText: subLabel.text property alias subLabelText: subLabel.text
property string icon: ""
property string image: ""
Rectangle { Image{
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectCrop
source: shell.image
visible: shell.image != ""
}
Rectangle {
id: shadow
width: parent.width
height: (shell.image != "" && shell.icon == "") ? (parent.height-cancel.height)/3 : parent.height-cancel.height
opacity: 0.65 opacity: 0.65
color: Theme.backgroundColor color: Theme.backgroundColor
anchors.bottom: cancel.top
}
Image{
id: icon
source: shell.icon
width: Theme.itemHeightMedium
height: width
anchors{
top: shell.top
topMargin: Theme.itemSpacingHuge
horizontalCenter: shell.horizontalCenter
}
visible: shell.icon != ""
fillMode: Image.PreserveAspectCrop
} }
Label { Label {
width: parent.width*0.8
id: heading id: heading
anchors.centerIn: parent width: parent.width*0.95
anchors{
centerIn: (shell.image != "" && shell.icon == "") ? shadow : parent
}
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
font.weight: Theme.fontWeightLarge font.weight: Theme.fontWeightLarge
font.pixelSize: (shell.image != "" && shell.icon == "") ? Theme.fontSizeTiny : Theme.fontSizeSmall
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
Label { Label {
id:subLabel id:subLabel
width: parent.width*0.8 width: parent.width*0.95
wrapMode: Text.Wrap wrapMode: Text.Wrap
font.weight: Theme.fontWeightMedium font.weight: Theme.fontWeightMedium
font.pixelSize: (shell.image != "" && shell.icon == "") ? Theme.fontSizeTiny : Theme.fontSizeSmall
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
anchors { anchors {
top:heading.bottom top:heading.bottom
topMargin: Theme.itemSpacingLarge topMargin: (shell.image != "" && shell.icon == "") ? Theme.itemSpacingSmall : Theme.itemSpacingLarge
horizontalCenter: shell.horizontalCenter horizontalCenter: shell.horizontalCenter
} }
} }
......
TEMPLATE = lib
TARGET = nemouxdialogs
PLUGIN_IMPORT_PATH = Nemo/Dialogs PLUGIN_IMPORT_PATH = Nemo/Dialogs
qmlfiles.files = qmldir qmlfiles.files = qmldir
......
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