diff --git a/src/gui/Base/HMenuSeparator.qml b/src/gui/Base/HMenuSeparator.qml index ed7925b3..775646f8 100644 --- a/src/gui/Base/HMenuSeparator.qml +++ b/src/gui/Base/HMenuSeparator.qml @@ -8,6 +8,6 @@ MenuSeparator { id: separator padding: 0 contentItem: Item { - implicitHeight: theme.spacing + implicitHeight: separator.visible ? theme.spacing : 0 } } diff --git a/src/gui/Base/HTextContextMenu.qml b/src/gui/Base/HTextContextMenu.qml index b3f7ddb3..cde72905 100644 --- a/src/gui/Base/HTextContextMenu.qml +++ b/src/gui/Base/HTextContextMenu.qml @@ -34,6 +34,7 @@ HMenu { HMenuItem { icon.name: "undo" text: qsTr("Undo") + visible: ! control.readOnly enabled: control.canUndo onTriggered: control.undo() } @@ -41,15 +42,19 @@ HMenu { HMenuItem { icon.name: "redo" text: qsTr("Redo") + visible: ! control.readOnly enabled: control.canRedo onTriggered: control.redo() } - HMenuSeparator {} + HMenuSeparator { + visible: ! control.readOnly + } HMenuItem { icon.name: "cut-text" text: qsTr("Cut") + visible: ! control.readOnly enabled: control.selectedPlainText onTriggered: control.cut() } @@ -67,11 +72,14 @@ HMenu { icon.name: "paste-text" text: qsTr("Paste") + visible: ! control.readOnly enabled: control.canPaste || pasteImage onTriggered: pasteImage ? menu.customImagePaste() : control.paste() } - HMenuSeparator {} + HMenuSeparator { + visible: ! control.readOnly + } HMenuItem { icon.name: "select-all-text"