Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85653221
D356.1788342934.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
27 KB
Referenced Files
None
Subscribers
None
D356.1788342934.diff
View Options
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -274,6 +274,14 @@
shortcuts/ActionSettings.qml
shortcuts/ShortcutInput.qml
+ actions/GlobalDrawerActions.qml
+ actions/RoomPageActions.qml
+ actions/BubbleActions.qml
+ actions/RoomListActions.qml
+ actions/DialogActions.qml
+ actions/SettingsActions.qml
+ actions/AllActions.qml
+
MessageNotification.qml
Notifier.qml
NotificationAction.qml
diff --git a/src/contents/ui/AcceptRejectNoopOverlay.qml b/src/contents/ui/AcceptRejectNoopOverlay.qml
--- a/src/contents/ui/AcceptRejectNoopOverlay.qml
+++ b/src/contents/ui/AcceptRejectNoopOverlay.qml
@@ -20,6 +20,24 @@
property var noopButtonText
property var onNoopButtonClicked: () => {}
+ Kazv.KazvAction {
+ id: acceptAction
+ objectName: 'dialog-accept'
+ onTriggered: {
+ confirmationOverlay.onConfirmButtonClicked();
+ confirmationOverlay.close();
+ }
+ }
+
+ Kazv.KazvAction {
+ id: rejectAction
+ objectName: 'dialog-reject'
+ onTriggered: {
+ confirmationOverlay.onRejectButtonClicked();
+ confirmationOverlay.close();
+ }
+ }
+
ColumnLayout {
Label {
Layout.fillWidth: true
@@ -37,21 +55,15 @@
Button {
objectName: 'confirmButton'
+ action: acceptAction
text: confirmationOverlay.confirmButtonText
- onClicked: {
- confirmationOverlay.onConfirmButtonClicked();
- confirmationOverlay.close();
- }
}
Button {
objectName: 'rejectButton'
+ action: rejectAction
text: confirmationOverlay.rejectButtonText
- onClicked: {
- confirmationOverlay.onRejectButtonClicked();
- confirmationOverlay.close();
- }
}
Button {
diff --git a/src/contents/ui/Bubble.qml b/src/contents/ui/Bubble.qml
--- a/src/contents/ui/Bubble.qml
+++ b/src/contents/ui/Bubble.qml
@@ -65,46 +65,41 @@
Menu {
objectName: 'bubbleContextMenu'
property list<QtObject> staticItems: [
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'replyToMenuItem'
- text: l10n.get('event-reply-action')
onTriggered: setDraftRelation('m.in_reply_to', currentEvent.eventId)
enabled: event && !event.redacted
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'editMenuItem'
- text: l10n.get('event-edit-action')
onTriggered: {
setDraftRelation('m.replace', currentEvent.eventId, Helpers.getEventBodyForEditing(event));
}
enabled: event && !event.redacted && !event.isLocalEcho && getIsEditable(event)
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'deleteMenuItem'
- text: l10n.get('event-delete')
onTriggered: deleteEventRequested(event.isLocalEcho ? event.txnId : event.eventId, event.isLocalEcho)
enabled: event && !event.redacted
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'reactMenuItem'
- text: l10n.get('event-react-action')
onTriggered: reactionPopupComp.createObject(applicationWindow().overlay).open()
enabled: event && !event.redacted
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'pinUnpinMenuItem'
enabled: !event.isLocalEcho
text: eventPinned ? l10n.get('event-unpin-action') : l10n.get('event-pin-action')
onTriggered: eventPinned ? unpinEventRequested(event.eventId) : pinEventRequested(event.eventId)
},
MenuSeparator {},
- Kirigami.Action {
- text: l10n.get('event-view-source')
+ Kazv.KazvAction {
+ objectName: 'view-source'
onTriggered: eventSourcePopupComp.createObject(applicationWindow().overlay).open()
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'viewHistoryMenuItem'
- text: l10n.get('event-view-history')
enabled: event && !!event.isEdited
onTriggered: viewEventHistoryRequested(event.eventId)
}
@@ -189,10 +184,9 @@
}
}
- property var popupAction: Kirigami.Action {
+ property var popupAction: Kazv.KazvAction {
id: popupAction
- text: l10n.get('event-popup-action')
- icon.name: 'view-more-horizontal-symbolic'
+ objectName: 'popupAction'
onTriggered: maybePopupMenu()
}
diff --git a/src/contents/ui/ConfirmationOverlay.qml b/src/contents/ui/ConfirmationOverlay.qml
--- a/src/contents/ui/ConfirmationOverlay.qml
+++ b/src/contents/ui/ConfirmationOverlay.qml
@@ -21,6 +21,21 @@
signal accepted()
+ Kazv.KazvAction {
+ id: acceptAction
+ objectName: 'dialog-accept'
+ onTriggered: {
+ confirmationOverlay.accepted();
+ confirmationOverlay.close();
+ }
+ }
+
+ Kazv.KazvAction {
+ id: rejectAction
+ objectName: 'dialog-reject'
+ onTriggered: confirmationOverlay.close()
+ }
+
ColumnLayout {
Label {
Layout.fillWidth: true
@@ -37,17 +52,14 @@
Layout.alignment: Qt.AlignHCenter
Button {
objectName: 'confirmButton'
+ action: acceptAction
text: confirmActionText
- onClicked: {
- accepted();
- confirmationOverlay.close();
- }
}
Button {
objectName: 'cancelButton'
+ action: rejectAction
text: cancelActionText
- onClicked: confirmationOverlay.close();
}
}
}
diff --git a/src/contents/ui/Main.qml b/src/contents/ui/Main.qml
--- a/src/contents/ui/Main.qml
+++ b/src/contents/ui/Main.qml
@@ -12,6 +12,7 @@
import '.' as Kazv
import 'shortcuts' as KazvShortcuts
+import 'actions' as KazvActions
import 'l10n.js' as L10n
@@ -161,74 +162,56 @@
titleIcon: "applications-graphics"
property var actionGroupName: l10n.get('action-group-global-drawer-actions')
actions: [
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'switch-account'
- text: l10n.get('global-drawer-action-switch-account')
- icon.name: 'system-switch-user'
onTriggered: switchAccount()
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'hard-logout'
- text: l10n.get('global-drawer-action-hard-logout')
- icon.name: 'application-exit'
onTriggered: confirmLogoutPopup.open()
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'save'
- text: l10n.get('global-drawer-action-save-session')
- icon.name: 'document-save'
onTriggered: {
recordLastSession()
matrixSdk.serializeToFile()
}
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'configure-shortcuts'
- text: l10n.get('global-drawer-action-configure-shortcuts')
- icon.name: 'configure-shortcuts'
onTriggered: {
pushActionSettingsPage();
}
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'settings'
- text: l10n.get('global-drawer-action-settings')
- icon.name: 'configure'
onTriggered: {
pushSettingsPage();
}
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'create-room'
enabled: root.loggedIn
- icon.name: 'contact-new'
- text: l10n.get('global-drawer-action-create-room')
onTriggered: {
pushCreateRoomPage();
}
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'join-room'
enabled: root.loggedIn
- text: l10n.get('global-drawer-action-join-room')
- icon.name: 'list-add-user'
onTriggered: {
pushJoinRoomPage();
}
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'verifications'
enabled: root.loggedIn
- icon.name: 'checkmark'
- text: l10n.get('global-drawer-action-verifications')
onTriggered: {
pushVerificationsPage();
}
},
- Kirigami.Action {
+ Kazv.KazvAction {
objectName: 'aboutAction'
- text: l10n.get('global-drawer-action-about')
- icon.name: 'help-about'
onTriggered: pageStack.pushDialogLayer(Qt.resolvedUrl('About.qml'))
}
]
@@ -241,64 +224,8 @@
property var actionGroupName: l10n.get('action-group-context-drawer-actions')
}
- property var roomPageActions: QtObject {
- property var actionGroupName: l10n.get('action-group-room-page-actions')
- property list<Kirigami.Action> actions: [
- Kirigami.Action {
- objectName: 'send-message'
- icon.name: 'document-send'
- text: l10n.get('send-message-box-send')
- property var defaultShortcut: 'Ctrl+Return'
- },
- Kirigami.Action {
- objectName: 'send-file'
- icon.name: 'document-open-data'
- text: l10n.get('send-message-box-send-file')
- },
- Kirigami.Action {
- objectName: 'send-stickers'
- icon.name: 'smiley'
- text: l10n.get('send-message-box-stickers')
- },
- Kirigami.Action {
- objectName: 'remove-related-to-event'
- icon.name: 'window-close-symbolic'
- text: l10n.get('action-settings-remove-related-to-event-action')
- },
- Kirigami.Action {
- objectName: 'room-invite-accept-action'
- icon.name: 'checkmark'
- text: l10n.get('room-invite-accept-action')
- },
- Kirigami.Action {
- objectName: 'room-invite-reject-action'
- icon.name: 'im-ban-kick-user'
- text: l10n.get('room-invite-reject-action')
- },
- Kirigami.Action {
- objectName: 'pinnedEventsAction'
- icon.name: 'pin'
- text: l10n.get('action-settings-room-pinned-events-action')
- },
- Kirigami.Action {
- objectName: 'scrollToLatestAction'
- icon.name: "go-down"
- text: l10n.get("room-timeline-scroll-to-latest-action")
- },
- Kirigami.Action {
- objectName: 'room-settings-action'
- icon.name: 'settings-configure'
- text: l10n.get('room-settings-action')
- }
- ]
- }
-
- property var actionCollection: KazvShortcuts.ActionCollection {
+ property var actionCollection: KazvActions.AllActions {
id: globalActionCollection
- children: [
- root.globalDrawer,
- root.roomPageActions
- ]
shortcutsConfig: kazvConfig
}
diff --git a/src/contents/ui/MediaFileMenu.qml b/src/contents/ui/MediaFileMenu.qml
--- a/src/contents/ui/MediaFileMenu.qml
+++ b/src/contents/ui/MediaFileMenu.qml
@@ -31,15 +31,15 @@
matrixSession: mediaFileMenu.session
}
- property var viewAction: Kirigami.Action {
- text: l10n.get('media-file-menu-option-view')
+ property var viewAction: Kazv.KazvAction {
+ objectName: 'media-view-action'
onTriggered: {
fileHandler.openFile();
}
}
- property var saveAction: Kirigami.Action {
- text: l10n.get('media-file-menu-option-save-as')
+ property var saveAction: Kazv.KazvAction {
+ objectName: 'media-save-action'
onTriggered: {
fileDialog.saveAs(mediaFileMenu.eventContent, mediaFileMenu.eventId);
}
diff --git a/src/contents/ui/RoomListViewItemDelegate.qml b/src/contents/ui/RoomListViewItemDelegate.qml
--- a/src/contents/ui/RoomListViewItemDelegate.qml
+++ b/src/contents/ui/RoomListViewItemDelegate.qml
@@ -130,16 +130,15 @@
}
}
ContextMenu.menu: Menu {
- Kirigami.Action {
- text: l10n.get("room-list-view-room-item-fav-action")
+ Kazv.KazvAction {
+ objectName: 'toggle-favourite'
checkable: true
checked: isFavourite
icon.name: isFavourite ? 'starred-symbolic' : 'non-starred-symbolic'
onTriggered: toggleFavourite()
}
- Kirigami.Action {
- text: l10n.get('room-list-view-room-item-more-action')
- icon.name: 'view-more-horizontal-symbolic'
+ Kazv.KazvAction {
+ objectName: 'room-more-settings'
onTriggered: activateRoomSettingsPage(item)
}
}
diff --git a/src/contents/ui/SettingsPage.qml b/src/contents/ui/SettingsPage.qml
--- a/src/contents/ui/SettingsPage.qml
+++ b/src/contents/ui/SettingsPage.qml
@@ -18,9 +18,8 @@
title: l10n.get('settings-page-title')
contextualActions: [
- Kirigami.Action {
- icon.name: 'document-save'
- text: l10n.get('settings-save')
+ Kazv.KazvAction {
+ objectName: 'settings-save'
onTriggered: { settingsPage.saveRecursively() }
}
]
diff --git a/src/contents/ui/actions/AllActions.qml b/src/contents/ui/actions/AllActions.qml
new file mode 100644
--- /dev/null
+++ b/src/contents/ui/actions/AllActions.qml
@@ -0,0 +1,21 @@
+/*
+ * This file is part of kazv.
+ * SPDX-FileCopyrightText: 2026 nannanko <nannanko@kazv.moe>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import '.' as KazvActions
+import '../shortcuts' as KazvShortcuts
+
+KazvShortcuts.ActionCollection {
+ id: globalActionCollection
+
+ children: [
+ KazvActions.GlobalDrawerActions {},
+ KazvActions.RoomPageActions {},
+ KazvActions.BubbleActions {},
+ KazvActions.RoomListActions {},
+ KazvActions.DialogActions {},
+ KazvActions.SettingsActions {}
+ ]
+}
diff --git a/src/contents/ui/actions/BubbleActions.qml b/src/contents/ui/actions/BubbleActions.qml
new file mode 100644
--- /dev/null
+++ b/src/contents/ui/actions/BubbleActions.qml
@@ -0,0 +1,77 @@
+/*
+ * This file is part of kazv.
+ * SPDX-FileCopyrightText: 2026 nannanko <nannanko@kazv.moe>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import QtQml
+
+import org.kde.kirigami as Kirigami
+
+import '../shortcuts' as Shortcuts
+
+Shortcuts.ActionCollection {
+ actionGroupName: l10n.get('action-group-bubble-context-menu-actions')
+ actions: [
+ Kirigami.Action {
+ objectName: 'replyToMenuItem'
+ icon.name: 'edit-reply'
+ text: l10n.get('event-reply-action')
+ },
+ Kirigami.Action {
+ objectName: 'editMenuItem'
+ icon.name: 'document-edit'
+ text: l10n.get('event-edit-action')
+ },
+ Kirigami.Action {
+ objectName: 'deleteMenuItem'
+ icon.name: 'edit-delete'
+ text: l10n.get('event-delete')
+ },
+ Kirigami.Action {
+ objectName: 'reactMenuItem'
+ icon.name: 'face-smile'
+ text: l10n.get('event-react-action')
+ },
+ Kirigami.Action {
+ objectName: 'pinUnpinMenuItem'
+ icon.name: 'pin'
+ text: l10n.get('event-pin-action')
+ },
+ Kirigami.Action {
+ objectName: 'view-source'
+ icon.name: 'text-html'
+ text: l10n.get('event-view-source')
+ },
+ Kirigami.Action {
+ objectName: 'viewHistoryMenuItem'
+ icon.name: 'view-history'
+ text: l10n.get('event-view-history')
+ },
+ Kirigami.Action {
+ objectName: 'popupAction'
+ icon.name: 'view-more-horizontal-symbolic'
+ text: l10n.get('event-popup-action')
+ },
+ Kirigami.Action {
+ objectName: 'requestKeyAction'
+ icon.name: 'dialog-password'
+ text: l10n.get('event-request-key-action')
+ },
+ Kirigami.Action {
+ objectName: 'add-sticker-action'
+ icon.name: 'smiley'
+ text: l10n.get('media-file-menu-add-sticker-action')
+ },
+ Kirigami.Action {
+ objectName: 'media-view-action'
+ icon.name: 'document-open'
+ text: l10n.get('media-file-menu-option-view')
+ },
+ Kirigami.Action {
+ objectName: 'media-save-action'
+ icon.name: 'document-save-as'
+ text: l10n.get('media-file-menu-option-save-as')
+ }
+ ]
+}
diff --git a/src/contents/ui/actions/DialogActions.qml b/src/contents/ui/actions/DialogActions.qml
new file mode 100644
--- /dev/null
+++ b/src/contents/ui/actions/DialogActions.qml
@@ -0,0 +1,25 @@
+/*
+ * This file is part of kazv.
+ * SPDX-FileCopyrightText: 2026 nannanko <nannanko@kazv.moe>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import QtQml
+
+import org.kde.kirigami as Kirigami
+
+import '../shortcuts' as Shortcuts
+
+Shortcuts.ActionCollection {
+ actionGroupName: l10n.get('action-group-dialog-actions')
+ actions: [
+ Kirigami.Action {
+ objectName: 'dialog-accept'
+ text: l10n.get('dialog-accept-action')
+ },
+ Kirigami.Action {
+ objectName: 'dialog-reject'
+ text: l10n.get('dialog-reject-action')
+ }
+ ]
+}
diff --git a/src/contents/ui/actions/GlobalDrawerActions.qml b/src/contents/ui/actions/GlobalDrawerActions.qml
new file mode 100644
--- /dev/null
+++ b/src/contents/ui/actions/GlobalDrawerActions.qml
@@ -0,0 +1,62 @@
+/*
+ * This file is part of kazv.
+ * SPDX-FileCopyrightText: 2026 nannanko <nannanko@kazv.moe>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import QtQml
+
+import org.kde.kirigami as Kirigami
+
+import '../shortcuts' as Shortcuts
+
+Shortcuts.ActionCollection {
+ actionGroupName: l10n.get('action-group-global-drawer-actions')
+ actions: [
+ Kirigami.Action {
+ objectName: 'switch-account'
+ text: l10n.get('global-drawer-action-switch-account')
+ icon.name: 'system-switch-user'
+ },
+ Kirigami.Action {
+ objectName: 'hard-logout'
+ text: l10n.get('global-drawer-action-hard-logout')
+ icon.name: 'application-exit'
+ },
+ Kirigami.Action {
+ objectName: 'save'
+ text: l10n.get('global-drawer-action-save-session')
+ icon.name: 'document-save'
+ },
+ Kirigami.Action {
+ objectName: 'configure-shortcuts'
+ text: l10n.get('global-drawer-action-configure-shortcuts')
+ icon.name: 'configure-shortcuts'
+ },
+ Kirigami.Action {
+ objectName: 'settings'
+ text: l10n.get('global-drawer-action-settings')
+ icon.name: 'configure'
+ },
+ Kirigami.Action {
+ objectName: 'create-room'
+ icon.name: 'contact-new'
+ text: l10n.get('global-drawer-action-create-room')
+ },
+ Kirigami.Action {
+ objectName: 'join-room'
+ text: l10n.get('global-drawer-action-join-room')
+ icon.name: 'list-add-user'
+ },
+ Kirigami.Action {
+ objectName: 'verifications'
+ icon.name: 'checkmark'
+ text: l10n.get('global-drawer-action-verifications')
+ },
+ Kirigami.Action {
+ objectName: 'aboutAction'
+ text: l10n.get('global-drawer-action-about')
+ icon.name: 'help-about'
+ }
+ ]
+}
diff --git a/src/contents/ui/actions/RoomListActions.qml b/src/contents/ui/actions/RoomListActions.qml
new file mode 100644
--- /dev/null
+++ b/src/contents/ui/actions/RoomListActions.qml
@@ -0,0 +1,27 @@
+/*
+ * This file is part of kazv.
+ * SPDX-FileCopyrightText: 2026 nannanko <nannanko@kazv.moe>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import QtQml
+
+import org.kde.kirigami as Kirigami
+
+import '../shortcuts' as Shortcuts
+
+Shortcuts.ActionCollection {
+ actionGroupName: l10n.get('action-group-room-list-context-menu-actions')
+ actions: [
+ Kirigami.Action {
+ objectName: 'toggle-favourite'
+ icon.name: 'starred-symbolic'
+ text: l10n.get('room-list-view-room-item-fav-action')
+ },
+ Kirigami.Action {
+ objectName: 'room-more-settings'
+ icon.name: 'view-more-horizontal-symbolic'
+ text: l10n.get('room-list-view-room-item-more-action')
+ }
+ ]
+}
diff --git a/src/contents/ui/actions/RoomPageActions.qml b/src/contents/ui/actions/RoomPageActions.qml
new file mode 100644
--- /dev/null
+++ b/src/contents/ui/actions/RoomPageActions.qml
@@ -0,0 +1,63 @@
+/*
+ * This file is part of kazv.
+ * SPDX-FileCopyrightText: 2026 nannanko <nannanko@kazv.moe>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import QtQml
+
+import org.kde.kirigami as Kirigami
+
+import '../shortcuts' as Shortcuts
+
+Shortcuts.ActionCollection {
+ actionGroupName: l10n.get('action-group-room-page-actions')
+ actions: [
+ Kirigami.Action {
+ objectName: 'send-message'
+ icon.name: 'document-send'
+ text: l10n.get('send-message-box-send')
+ property var defaultShortcut: 'Ctrl+Return'
+ },
+ Kirigami.Action {
+ objectName: 'send-file'
+ icon.name: 'document-open-data'
+ text: l10n.get('send-message-box-send-file')
+ },
+ Kirigami.Action {
+ objectName: 'send-stickers'
+ icon.name: 'smiley'
+ text: l10n.get('send-message-box-stickers')
+ },
+ Kirigami.Action {
+ objectName: 'remove-related-to-event'
+ icon.name: 'window-close-symbolic'
+ text: l10n.get('action-settings-remove-related-to-event-action')
+ },
+ Kirigami.Action {
+ objectName: 'room-invite-accept-action'
+ icon.name: 'checkmark'
+ text: l10n.get('room-invite-accept-action')
+ },
+ Kirigami.Action {
+ objectName: 'room-invite-reject-action'
+ icon.name: 'im-ban-kick-user'
+ text: l10n.get('room-invite-reject-action')
+ },
+ Kirigami.Action {
+ objectName: 'pinnedEventsAction'
+ icon.name: 'pin'
+ text: l10n.get('action-settings-room-pinned-events-action')
+ },
+ Kirigami.Action {
+ objectName: 'scrollToLatestAction'
+ icon.name: "go-down"
+ text: l10n.get("room-timeline-scroll-to-latest-action")
+ },
+ Kirigami.Action {
+ objectName: 'room-settings-action'
+ icon.name: 'settings-configure'
+ text: l10n.get('room-settings-action')
+ }
+ ]
+}
diff --git a/src/contents/ui/actions/SettingsActions.qml b/src/contents/ui/actions/SettingsActions.qml
new file mode 100644
--- /dev/null
+++ b/src/contents/ui/actions/SettingsActions.qml
@@ -0,0 +1,22 @@
+/*
+ * This file is part of kazv.
+ * SPDX-FileCopyrightText: 2026 nannanko <nannanko@kazv.moe>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import QtQml
+
+import org.kde.kirigami as Kirigami
+
+import '../shortcuts' as Shortcuts
+
+Shortcuts.ActionCollection {
+ actionGroupName: l10n.get('action-group-settings-actions')
+ actions: [
+ Kirigami.Action {
+ objectName: 'settings-save'
+ icon.name: 'document-save'
+ text: l10n.get('settings-save')
+ }
+ ]
+}
diff --git a/src/contents/ui/event-types/Fallback.qml b/src/contents/ui/event-types/Fallback.qml
--- a/src/contents/ui/event-types/Fallback.qml
+++ b/src/contents/ui/event-types/Fallback.qml
@@ -10,14 +10,15 @@
import org.kde.kirigami 2.13 as Kirigami
+import '..' as Kazv
import '.' as Types
Types.TextTemplate {
id: upper
text: getText()
- property var requestKeyAction: Kirigami.Action {
- text: l10n.get('event-request-key-action')
+ property var requestKeyAction: Kazv.KazvAction {
+ objectName: 'requestKeyAction'
onTriggered: matrixSession.requestShareRoomSessionKey(event)
}
diff --git a/src/contents/ui/event-types/Image.qml b/src/contents/ui/event-types/Image.qml
--- a/src/contents/ui/event-types/Image.qml
+++ b/src/contents/ui/event-types/Image.qml
@@ -95,8 +95,8 @@
}
}
- property var addStickerAction: Kirigami.Action {
- text: l10n.get('media-file-menu-add-sticker-action')
+ property var addStickerAction: Kazv.KazvAction {
+ objectName: 'add-sticker-action'
onTriggered: bubble.addStickerPopupComp.createObject(applicationWindow().overlay).open()
}
diff --git a/src/contents/ui/shortcuts/ActionCollection.qml b/src/contents/ui/shortcuts/ActionCollection.qml
--- a/src/contents/ui/shortcuts/ActionCollection.qml
+++ b/src/contents/ui/shortcuts/ActionCollection.qml
@@ -11,11 +11,11 @@
default property var data
/// Children of the action collection. Will be used for action lookup.
- property var children: []
+ property list<QtObject> children: []
/// Name of the group.
property var actionGroupName: ''
/// The actions of this ActionCollection.
- property var actions: []
+ property list<QtObject> actions: []
property var shortcutsConfig
diff --git a/src/l10n/cmn-Hans/100-ui.ftl b/src/l10n/cmn-Hans/100-ui.ftl
--- a/src/l10n/cmn-Hans/100-ui.ftl
+++ b/src/l10n/cmn-Hans/100-ui.ftl
@@ -20,6 +20,13 @@
action-group-global-drawer-actions = 全局操作
action-group-context-drawer-actions = 页面操作
action-group-room-page-actions = 房间页面操作
+action-group-bubble-context-menu-actions = 消息操作
+action-group-room-list-context-menu-actions = 房间列表操作
+action-group-dialog-actions = 对话框操作
+action-group-settings-actions = 设置操作
+
+dialog-accept-action = 确认
+dialog-reject-action = 取消
user-name-with-id = { $name } ({ $userId })
user-name-overrided = { $overridedName } ({ $globalName })
diff --git a/src/l10n/en/100-ui.ftl b/src/l10n/en/100-ui.ftl
--- a/src/l10n/en/100-ui.ftl
+++ b/src/l10n/en/100-ui.ftl
@@ -20,6 +20,13 @@
action-group-global-drawer-actions = Global Actions
action-group-context-drawer-actions = Page Actions
action-group-room-page-actions = Room Page Actions
+action-group-bubble-context-menu-actions = Message Actions
+action-group-room-list-context-menu-actions = Room List Actions
+action-group-dialog-actions = Dialog Actions
+action-group-settings-actions = Settings Actions
+
+dialog-accept-action = Confirm
+dialog-reject-action = Cancel
user-name-with-id = { $name } ({ $userId })
user-name-overrided = { $overridedName } ({ $globalName })
diff --git a/src/tests/quick-tests/test-helpers/TestItem.qml b/src/tests/quick-tests/test-helpers/TestItem.qml
--- a/src/tests/quick-tests/test-helpers/TestItem.qml
+++ b/src/tests/quick-tests/test-helpers/TestItem.qml
@@ -8,6 +8,7 @@
import QtTest
import '.' as QmlHelpers
import '../test-helpers.js' as JsHelpers
+import '../../../contents/ui/actions' as KazvActions
Item {
id: item
@@ -40,6 +41,13 @@
property var pageStack: QtObject {
property var removePage: mockHelper.noop()
}
+ property var actionCollection: KazvActions.AllActions {
+ shortcutsConfig: QtObject {
+ function shortcutForAction(a) {
+ return [];
+ }
+ }
+ }
function applicationWindow() {
return Window.window;
diff --git a/src/tests/quick-tests/tst_SendMessageBox.qml b/src/tests/quick-tests/tst_SendMessageBox.qml
--- a/src/tests/quick-tests/tst_SendMessageBox.qml
+++ b/src/tests/quick-tests/tst_SendMessageBox.qml
@@ -56,26 +56,6 @@
}
}
- // Mirror the global action the application registers for the send
- // shortcut, so that KazvAction in SendMessageBox can resolve it.
- property var sendMessageGlobalAction: Kirigami.Action {
- objectName: 'send-message'
- shortcut: 'Ctrl+Enter'
- }
-
- property var actionCollection: QtObject {
- property var actions: [item.sendMessageGlobalAction]
-
- function action(name) {
- for (let i = 0; i < actions.length; ++i) {
- if (actions[i].objectName === name) {
- return actions[i];
- }
- }
- return null;
- }
- }
-
Kazv.SendMessageBox {
id: sendMessageBox
y: 400
@@ -230,12 +210,12 @@
const textArea = findChild(sendMessageBox, 'draftMessage');
// The configured send shortcut must not send an empty message.
- item.sendMessageGlobalAction.trigger();
+ item.actionCollection.action('send-message').trigger();
verify(room.sendTextMessage.calledTimes() === 0);
// It should send and clear the box once the input is non-empty.
textArea.text = 'some test';
- item.sendMessageGlobalAction.trigger();
+ item.actionCollection.action('send-message').trigger();
tryVerify(() => room.sendTextMessage.calledTimes() === 1);
verify(textArea.text === '');
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 2, 2:55 AM (19 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1738973
Default Alt Text
D356.1788342934.diff (27 KB)
Attached To
Mode
D356: Make more actions configurable
Attached
Detach File
Event Timeline
Log In to Comment