harbour-seaprint/qml/components/MediaColSetting.qml

37 lines
1.1 KiB
QML
Raw Normal View History

2020-06-16 20:51:29 +03:00
import QtQuick 2.0
import Sailfish.Silica 1.0
import seaprint.ippmsg 1.0
Setting {
2021-03-21 16:01:19 +03:00
valid: ((parent.printer.attrs["media-left-margin-supported"].value.indexOf(0) != -1) &&
(parent.printer.attrs["media-right-margin-supported"].value.indexOf(0) != -1) &&
(parent.printer.attrs["media-top-margin-supported"].value.indexOf(0) != -1) &&
(parent.printer.attrs["media-bottom-margin-supported"].value.indexOf(0) != -1))
2020-06-16 20:51:29 +03:00
displayValue: choice ? qsTr("true") : qsTr("false")
2020-06-16 20:51:29 +03:00
2020-11-23 22:29:59 +03:00
menu: ContextMenu {
2020-06-16 20:51:29 +03:00
id: menu
MenuItem {
text: qsTr("true")
onClicked:
{
choice = {"media-left-margin": {"tag": IppMsg.Integer, "value": 0},
"media-right-margin": {"tag": IppMsg.Integer, "value": 0},
"media-top-margin": {"tag": IppMsg.Integer, "value": 0},
"media-bottom-margin": {"tag": IppMsg.Integer, "value": 0}}
}
}
MenuItem {
text: qsTr("false")
onClicked:
{
choice = undefined
}
}
}
}