Meshroom/meshroom/ui/qml/DialogsFactory.qml
Yann Lanthony 30f99b01f2 [ui] MessageDialog: add presets and options
* add Info, Warning and Error presets
* add canCopy options to display/hide copy to clipboard button
* tweak paddings and font size
2018-08-03 17:24:04 +02:00

47 lines
1 KiB
QML

import QtQuick 2.9
import MaterialIcons 2.2
import Controls 1.0
/**
* DialogsFactory is utility object to instantiate generic purpose Dialogs.
*/
QtObject {
readonly property string defaultErrorText: "An unexpected error has occured"
property Component infoDialog: Component {
MessageDialog {
title: "Info"
preset: "Info"
visible: true
}
}
property Component warningDialog: Component {
MessageDialog {
title: "Warning"
preset: "Warning"
visible: true
}
}
property Component errorDialog: Component {
id: errorDialog
MessageDialog {
title: "Error"
preset: "Error"
text: defaultErrorText
visible: true
}
}
function info(window) {
return infoDialog.createObject(window)
}
function warning(window) {
return warningDialog.createObject(window)
}
function error(window) {
return errorDialog.createObject(window)
}
}