fix(ui/views/App/Main/MainWindow): handle closing correctly on mac os

This commit is contained in:
Ronan Abhamon 2017-04-26 09:37:01 +02:00
parent 4dcb43092b
commit e482fb9e1c
3 changed files with 13 additions and 4 deletions

View file

@ -10,9 +10,14 @@ Flickable {
property alias text: textArea.text
readonly property alias length: textArea.length
boundsBehavior: Flickable.StopAtBounds
height: TextAreaFieldStyle.background.height
width: TextAreaFieldStyle.background.width
ScrollBar.vertical: ForceScrollBar {
id: scrollBar
}
TextArea.flickable: TextArea {
id: textArea
@ -39,8 +44,4 @@ Flickable {
rightPadding: TextAreaFieldStyle.text.padding + Number(scrollBar.visible) * scrollBar.width
topPadding: TextAreaFieldStyle.text.padding
}
ScrollBar.vertical: ForceScrollBar {
id: scrollBar
}
}

View file

@ -16,6 +16,13 @@ function handleActiveFocusItemChanged (activeFocusItem) {
}
}
function handleClosing (close) {
if (Qt.platform.os === 'osx') {
close.accepted = false
window.showMinimized()
}
}
// -----------------------------------------------------------------------------
function lockView (info) {

View file

@ -54,6 +54,7 @@ ApplicationWindow {
// ---------------------------------------------------------------------------
onActiveFocusItemChanged: Logic.handleActiveFocusItemChanged(activeFocusItem)
onClosing: Logic.handleClosing(close)
// ---------------------------------------------------------------------------