moment/src/gui/Base/HPopup.qml

39 lines
978 B
QML
Raw Normal View History

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