Restore image editor
This commit is contained in:
@@ -60,39 +60,63 @@ Item {
|
|||||||
implicitWidth: mediaSizeHelper.currentSize.width
|
implicitWidth: mediaSizeHelper.currentSize.width
|
||||||
implicitHeight: mediaSizeHelper.currentSize.height
|
implicitHeight: mediaSizeHelper.currentSize.height
|
||||||
|
|
||||||
QQC2.Button {
|
RowLayout {
|
||||||
anchors.top: root.top
|
anchors.top: root.top
|
||||||
anchors.topMargin: Kirigami.Units.smallSpacing
|
anchors.topMargin: Kirigami.Units.smallSpacing
|
||||||
anchors.right: root.right
|
anchors.right: root.right
|
||||||
anchors.rightMargin: root.rightAnchorMargin + Kirigami.Units.smallSpacing
|
anchors.rightMargin: root.rightAnchorMargin + Kirigami.Units.smallSpacing
|
||||||
visible: !_private.hideImage && !root.editable
|
|
||||||
icon.name: "view-hidden"
|
|
||||||
text: i18nc("@action:button", "Hide Image")
|
|
||||||
display: QQC2.Button.IconOnly
|
|
||||||
z: 10
|
|
||||||
onClicked: {
|
|
||||||
_private.hideImage = true;
|
|
||||||
Controller.markImageHidden(root.eventId)
|
|
||||||
}
|
|
||||||
|
|
||||||
QQC2.ToolTip.text: text
|
QQC2.Button {
|
||||||
QQC2.ToolTip.visible: hovered
|
|
||||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
visible: !_private.hideImage && !root.editable
|
||||||
}
|
icon.name: "view-hidden"
|
||||||
QQC2.Button {
|
text: i18nc("@action:button", "Hide Image")
|
||||||
id: cancelButton
|
display: QQC2.Button.IconOnly
|
||||||
anchors.top: root.top
|
z: 10
|
||||||
anchors.topMargin: Kirigami.Units.smallSpacing
|
onClicked: {
|
||||||
anchors.right: root.right
|
_private.hideImage = true;
|
||||||
anchors.rightMargin: root.rightAnchorMargin + Kirigami.Units.smallSpacing
|
Controller.markImageHidden(root.eventId)
|
||||||
visible: root.editable
|
}
|
||||||
display: QQC2.AbstractButton.IconOnly
|
|
||||||
text: i18nc("@action:button", "Remove attachment")
|
QQC2.ToolTip.text: text
|
||||||
icon.name: "dialog-close"
|
QQC2.ToolTip.visible: hovered
|
||||||
onClicked: root.Message.contentModel?.removeAttachment()
|
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||||
QQC2.ToolTip.text: text
|
}
|
||||||
QQC2.ToolTip.visible: hovered
|
QQC2.Button {
|
||||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
id: editImageButton
|
||||||
|
visible: root.editable
|
||||||
|
icon.name: "document-edit"
|
||||||
|
text: i18n("Edit")
|
||||||
|
display: QQC2.AbstractButton.IconOnly
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: imageEditorPage
|
||||||
|
ImageEditorPage {
|
||||||
|
imagePath: root.componentAttributes.source
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
let imageEditor = (Kirigami.PageStack.pageStack as Kirigami.PageRow).pushDialogLayer(imageEditorPage);
|
||||||
|
imageEditor.newPathChanged.connect(function (newPath) {
|
||||||
|
imageEditor.closeDialog();
|
||||||
|
Message.contentModel?.addAttachment(newPath);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
QQC2.ToolTip.text: text
|
||||||
|
QQC2.ToolTip.visible: hovered
|
||||||
|
}
|
||||||
|
QQC2.Button {
|
||||||
|
id: cancelButton
|
||||||
|
visible: root.editable
|
||||||
|
display: QQC2.AbstractButton.IconOnly
|
||||||
|
text: i18nc("@action:button", "Remove attachment")
|
||||||
|
icon.name: "dialog-close"
|
||||||
|
onClicked: root.Message.contentModel?.removeAttachment()
|
||||||
|
QQC2.ToolTip.text: text
|
||||||
|
QQC2.ToolTip.visible: hovered
|
||||||
|
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
|||||||
Reference in New Issue
Block a user