Adjust exit dialog margins

pull/2/head
reionwong 4 years ago
parent c539266ab2
commit 1b1fdd42c8

@ -28,8 +28,8 @@ Dialog {
modal: true modal: true
width: _mainLayout.childrenRect.width + FishUI.Units.largeSpacing * 4 width: _mainLayout.implicitWidth + FishUI.Units.largeSpacing * 3
height: _mainLayout.childrenRect.height + FishUI.Units.largeSpacing * 4 height: _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 3
x: (parent.width - control.width) / 2 x: (parent.width - control.width) / 2
y: (parent.height - control.height) / 2 y: (parent.height - control.height) / 2
@ -39,8 +39,11 @@ Dialog {
ColumnLayout { ColumnLayout {
id: _mainLayout id: _mainLayout
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing spacing: FishUI.Units.largeSpacing
anchors.rightMargin: FishUI.Units.largeSpacing anchors.leftMargin: FishUI.Units.smallSpacing
anchors.rightMargin: FishUI.Units.smallSpacing
anchors.topMargin: FishUI.Units.smallSpacing
anchors.bottomMargin: FishUI.Units.smallSpacing
Label { Label {
text: qsTr("Process is running, are you sure you want to quit?") text: qsTr("Process is running, are you sure you want to quit?")
@ -59,6 +62,7 @@ Dialog {
Button { Button {
text: qsTr("OK") text: qsTr("OK")
Layout.fillWidth: true Layout.fillWidth: true
flat: true
onClicked: { onClicked: {
control.visible = false control.visible = false
control.okBtnClicked() control.okBtnClicked()

@ -54,13 +54,13 @@ Page {
if ((event.key === Qt.Key_C) if ((event.key === Qt.Key_C)
&& (event.modifiers & Qt.ControlModifier) && (event.modifiers & Qt.ControlModifier)
&& (event.modifiers & Qt.ShiftModifier)) { && (event.modifiers & Qt.ShiftModifier)) {
copyAction.triggered() _copyAction.trigger()
} }
if ((event.key === Qt.Key_V) if ((event.key === Qt.Key_V)
&& (event.modifiers & Qt.ControlModifier) && (event.modifiers & Qt.ControlModifier)
&& (event.modifiers & Qt.ShiftModifier)) { && (event.modifiers & Qt.ShiftModifier)) {
pasteAction.triggered() _pasteAction.trigger()
} }
if ((event.key === Qt.Key_Q) if ((event.key === Qt.Key_Q)
@ -98,10 +98,6 @@ Page {
Keys.enabled: true Keys.enabled: true
Keys.onPressed: control.keyPressed(event) Keys.onPressed: control.keyPressed(event)
onUsesMouseChanged: {
console.log(_terminal.getUsesMouse)
}
session: QMLTermSession { session: QMLTermSession {
id: _session id: _session
onFinished: control.terminalClosed() onFinished: control.terminalClosed()
@ -158,19 +154,30 @@ Page {
} }
} }
Action {
id: _copyAction
text: qsTr("Copy")
onTriggered: _terminal.copyClipboard()
}
Action {
id: _pasteAction
text: qsTr("Paste")
onTriggered: _terminal.pasteClipboard()
}
FishUI.DesktopMenu { FishUI.DesktopMenu {
id: terminalMenu id: terminalMenu
MenuItem { MenuItem {
id: copyAction id: copyMenuItem
text: qsTr("Copy") action: _copyAction
onTriggered: _terminal.copyClipboard()
} }
MenuItem { MenuItem {
id: pasteAction id: pasteMenuItem
text: qsTr("Paste") text: qsTr("Paste")
onTriggered: _terminal.pasteClipboard() action: _pasteAction
} }
MenuItem { MenuItem {
@ -219,7 +226,7 @@ Page {
} }
function updateMenu() { function updateMenu() {
pasteAction.visible = Utils.text() copyMenuItem.visible = _terminal.selectedText
copyAction.visible = _terminal.selectedText pasteMenuItem.visible = Utils.text()
} }
} }

@ -154,7 +154,6 @@ FishUI.Window {
} }
FishUI.RoundImageButton { FishUI.RoundImageButton {
size: 35
source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark/" : "light/") + "add.svg" source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark/" : "light/") + "add.svg"
onClicked: root.openNewTab() onClicked: root.openNewTab()
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop

Loading…
Cancel
Save