mirror of
https://github.com/savoirfairelinux/jami-client-qt.git
synced 2026-01-03 10:35:05 +08:00
Popup : Close all popups by pressing escape
Using a key OnPressed instead of Shortcut Making all popups closable with escape (focus true and a close policy) GitLab: #1234 Change-Id: I1a612834c439aea94a59e91cb915b18b4ef5cf84
This commit is contained in:
committed by
Sébastien Blin
parent
c8ec980a3b
commit
fe2f3258b2
@@ -47,6 +47,7 @@ Popup {
|
||||
|
||||
// A popup is invisible until opened.
|
||||
visible: false
|
||||
focus: true
|
||||
closePolicy: autoClose ? (Popup.CloseOnEscape | Popup.CloseOnPressOutside) : Popup.NoAutoClose
|
||||
|
||||
Rectangle {
|
||||
|
||||
@@ -42,6 +42,7 @@ Popup {
|
||||
padding: 0
|
||||
|
||||
visible: false
|
||||
focus: true
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
|
||||
Rectangle {
|
||||
|
||||
@@ -30,6 +30,9 @@ Popup {
|
||||
padding: 0
|
||||
property list<Action> menuTypoActionsSecond
|
||||
|
||||
focus: true
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
|
||||
contentItem: ListView {
|
||||
id: listViewTypoSecond
|
||||
|
||||
|
||||
@@ -49,6 +49,9 @@ Popup {
|
||||
property bool closeWithoutAnimation: false
|
||||
property var emojiPicker
|
||||
|
||||
focus: true
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
|
||||
function xPositionProvider(width) {
|
||||
// Use the width at function scope to retrigger property evaluation.
|
||||
const listViewWidth = listView.width
|
||||
|
||||
@@ -149,13 +149,12 @@ Rectangle {
|
||||
onActivated: layoutManager.toggleWindowFullScreen()
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequence: "Escape"
|
||||
context: Qt.ApplicationShortcut
|
||||
onActivated: {
|
||||
MessagesAdapter.replyToId = ""
|
||||
MessagesAdapter.editId = ""
|
||||
layoutManager.popFullScreenItem()
|
||||
Keys.onPressed: function (keyEvent) {
|
||||
if (keyEvent.key === Qt.Key_Escape) {
|
||||
MessagesAdapter.replyToId = "";
|
||||
MessagesAdapter.editId = "";
|
||||
layoutManager.popFullScreenItem();
|
||||
keyEvent.accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@ Popup {
|
||||
color: JamiTheme.transparentColor
|
||||
}
|
||||
|
||||
focus: true
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
|
||||
@@ -220,10 +220,7 @@ Rectangle {
|
||||
|
||||
Keys.onShortcutOverride: function (keyEvent) {
|
||||
if (keyEvent.key === Qt.Key_Escape) {
|
||||
if (emojiPicker != null && emojiPicker.opened) {
|
||||
emojiPicker.closeEmojiPicker();
|
||||
}
|
||||
else if (recordBox != null && recordBox.opened) {
|
||||
if (recordBox != null && recordBox.opened) {
|
||||
recordBox.closeRecorder();
|
||||
}
|
||||
else if (PositionManager.isMapActive(CurrentAccount.id)){
|
||||
|
||||
@@ -51,6 +51,9 @@ Popup {
|
||||
|
||||
signal validatePhoto(string photo)
|
||||
|
||||
modal: true
|
||||
closePolicy: Popup.CloseOnPressOutsideParent
|
||||
|
||||
function openRecorder(vid) {
|
||||
isVideo = vid;
|
||||
updateState(RecordBox.States.INIT);
|
||||
@@ -121,9 +124,6 @@ Popup {
|
||||
time.text = min + ":" + sec;
|
||||
}
|
||||
|
||||
modal: true
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
|
||||
onActiveFocusChanged: {
|
||||
if (visible) {
|
||||
closeRecorder();
|
||||
|
||||
@@ -32,6 +32,9 @@ Popup {
|
||||
required property ListView listView
|
||||
signal emojiIsPicked(string content)
|
||||
|
||||
focus: true
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
||||
|
||||
// Close the picker when attached to a listView that receives height/scroll
|
||||
// property changes.
|
||||
property real listViewHeight: listView ? listView.height : 0
|
||||
|
||||
@@ -42,6 +42,7 @@ Popup {
|
||||
padding: 0
|
||||
|
||||
visible: false
|
||||
focus: true
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
Rectangle {
|
||||
id: container
|
||||
|
||||
@@ -42,6 +42,7 @@ Popup {
|
||||
padding: 0
|
||||
|
||||
visible: false
|
||||
focus: true
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
|
||||
Rectangle {
|
||||
|
||||
Reference in New Issue
Block a user