2019-12-19 07:46:16 -04:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2019-09-08 12:17:42 -04:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
|
|
|
|
Popup {
|
|
|
|
id: popup
|
|
|
|
anchors.centerIn: Overlay.overlay
|
|
|
|
modal: true
|
2019-09-09 06:44:06 -04:00
|
|
|
focus: true
|
2019-09-08 12:17:42 -04:00
|
|
|
padding: 0
|
2019-12-07 10:59:43 -04:00
|
|
|
margins: theme.spacing
|
2019-09-08 12:17:42 -04:00
|
|
|
|
|
|
|
enter: Transition {
|
2019-12-16 04:42:41 -04:00
|
|
|
HNumberAnimation { property: "scale"; from: 0; to: 1; overshoot: 4 }
|
2019-09-08 12:17:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
exit: Transition {
|
|
|
|
HNumberAnimation { property: "scale"; to: 0 }
|
|
|
|
}
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
color: theme.controls.popup.background
|
|
|
|
}
|
2019-12-11 12:42:59 -04:00
|
|
|
|
2020-03-15 18:01:56 -04:00
|
|
|
Overlay.modal: Rectangle {
|
|
|
|
color: "transparent"
|
|
|
|
|
|
|
|
HColorAnimation on color { to: theme.controls.popup.windowOverlay }
|
|
|
|
}
|
|
|
|
|
2019-12-12 08:39:26 -04:00
|
|
|
onAboutToShow: previouslyFocused = window.activeFocusItem
|
2019-12-20 10:29:45 -04:00
|
|
|
onClosed: if (focusOnClosed) focusOnClosed.forceActiveFocus()
|
2019-12-12 08:39:26 -04:00
|
|
|
|
|
|
|
|
|
|
|
property var previouslyFocused: null
|
2019-12-20 10:29:45 -04:00
|
|
|
property Item focusOnClosed: previouslyFocused
|
2019-12-11 12:42:59 -04:00
|
|
|
|
|
|
|
readonly property int maximumPreferredWidth:
|
|
|
|
window.width - leftMargin - rightMargin - leftInset - rightInset
|
|
|
|
|
|
|
|
readonly property int maximumPreferredHeight:
|
|
|
|
window.height - topMargin - bottomMargin - topInset - bottomInset
|
2019-09-08 12:17:42 -04:00
|
|
|
}
|