2020-06-16 20:51:29 +03:00
|
|
|
import QtQuick 2.0
|
|
|
|
import Sailfish.Silica 1.0
|
|
|
|
import seaprint.convertchecker 1.0
|
|
|
|
import seaprint.ippmsg 1.0
|
|
|
|
import "../pages/utils.js" as Utils
|
|
|
|
|
|
|
|
Setting {
|
2020-11-23 20:34:38 +03:00
|
|
|
id: settingEntry
|
|
|
|
|
|
|
|
height: button.height + menu.height
|
2020-06-16 20:51:29 +03:00
|
|
|
property var printer
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
if((printer.attrs["media-left-margin-supported"].value.indexOf(0) != -1) &&
|
|
|
|
(printer.attrs["media-right-margin-supported"].value.indexOf(0) != -1) &&
|
|
|
|
(printer.attrs["media-top-margin-supported"].value.indexOf(0) != -1) &&
|
|
|
|
(printer.attrs["media-bottom-margin-supported"].value.indexOf(0) != -1))
|
|
|
|
{
|
|
|
|
valid = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ValueButton {
|
2020-11-23 20:34:38 +03:00
|
|
|
id: button
|
2020-06-16 20:51:29 +03:00
|
|
|
enabled: valid
|
|
|
|
label: prettyName
|
|
|
|
value: choice ? qsTr("true") : qsTr("false")
|
|
|
|
onClicked: parent.clicked()
|
|
|
|
}
|
|
|
|
|
2020-11-23 20:34:38 +03:00
|
|
|
onClicked: menu.open(settingEntry)
|
|
|
|
|
|
|
|
ContextMenu {
|
2020-06-16 20:51:29 +03:00
|
|
|
id: menu
|
|
|
|
enabled: true
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|