mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-16 08:05:19 -04:00
fix(clipboard): restore Save button targets in editor
This commit is contained in:
@@ -139,12 +139,8 @@ Item {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleSaveMenu() {
|
function positionSaveMenu() {
|
||||||
if (saveMenu.visible) {
|
saveMenu.width = Math.max(saveMenuColumn.implicitWidth + saveMenu.padding * 2, saveButton.width);
|
||||||
saveMenu.close();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
saveMenu.open();
|
|
||||||
const pos = saveButton.mapToItem(Overlay.overlay, 0, 0);
|
const pos = saveButton.mapToItem(Overlay.overlay, 0, 0);
|
||||||
const popupW = saveMenu.width;
|
const popupW = saveMenu.width;
|
||||||
const popupH = saveMenu.height;
|
const popupH = saveMenu.height;
|
||||||
@@ -164,6 +160,16 @@ Item {
|
|||||||
saveMenu.y = y;
|
saveMenu.y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleSaveMenu() {
|
||||||
|
if (saveMenu.visible) {
|
||||||
|
saveMenu.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
saveMenu.open();
|
||||||
|
positionSaveMenu();
|
||||||
|
Qt.callLater(positionSaveMenu);
|
||||||
|
}
|
||||||
|
|
||||||
Shortcut {
|
Shortcut {
|
||||||
sequences: ["Escape"]
|
sequences: ["Escape"]
|
||||||
enabled: modal.mode === "editor"
|
enabled: modal.mode === "editor"
|
||||||
@@ -304,9 +310,12 @@ Item {
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: saveButton
|
id: saveButton
|
||||||
property int arrowWidth: Theme.iconSize + Theme.spacingS
|
|
||||||
width: cancelButton.implicitWidth
|
readonly property int buttonHeight: cancelButton.buttonHeight
|
||||||
height: cancelButton.implicitHeight
|
readonly property int arrowWidth: Theme.iconSizeLarge
|
||||||
|
|
||||||
|
width: cancelButton.width
|
||||||
|
height: buttonHeight
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -340,7 +349,7 @@ Item {
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: 1
|
width: 1
|
||||||
height: parent.height - Theme.spacingM
|
height: parent.height - cancelButton.horizontalPadding
|
||||||
color: Theme.withAlpha(Theme.onPrimary, 0.2)
|
color: Theme.withAlpha(Theme.onPrimary, 0.2)
|
||||||
anchors.right: saveArrowArea.left
|
anchors.right: saveArrowArea.left
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -354,12 +363,14 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
|
z: 1
|
||||||
anchors.fill: saveMainArea
|
anchors.fill: saveMainArea
|
||||||
stateColor: Theme.onPrimary
|
stateColor: Theme.onPrimary
|
||||||
onClicked: root.saveEntry("history")
|
onClicked: root.saveEntry("history")
|
||||||
}
|
}
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
|
z: 1
|
||||||
anchors.fill: saveArrowArea
|
anchors.fill: saveArrowArea
|
||||||
stateColor: Theme.onPrimary
|
stateColor: Theme.onPrimary
|
||||||
onClicked: root.toggleSaveMenu()
|
onClicked: root.toggleSaveMenu()
|
||||||
@@ -370,9 +381,9 @@ Item {
|
|||||||
Popup {
|
Popup {
|
||||||
id: saveMenu
|
id: saveMenu
|
||||||
parent: Overlay.overlay
|
parent: Overlay.overlay
|
||||||
width: saveMenuColumn.implicitWidth + padding * 2
|
|
||||||
padding: Theme.spacingM
|
padding: Theme.spacingM
|
||||||
modal: false
|
modal: true
|
||||||
|
dim: false
|
||||||
focus: true
|
focus: true
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user