Page MenuHomePhorge

D356.1787514960.diff
No OneTemporary

Size
13 KB
Referenced Files
None
Subscribers
None

D356.1787514960.diff

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
@@ -293,11 +293,122 @@
]
}
+ property var bubbleContextActions: QtObject {
+ property var actionGroupName: l10n.get('action-group-bubble-context-menu-actions')
+ property list<Kirigami.Action> 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')
+ }
+ ]
+ }
+
+ property var roomListContextActions: QtObject {
+ property var actionGroupName: l10n.get('action-group-room-list-context-menu-actions')
+ property list<Kirigami.Action> 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')
+ }
+ ]
+ }
+
+ property var dialogActions: QtObject {
+ property var actionGroupName: l10n.get('action-group-dialog-actions')
+ property list<Kirigami.Action> actions: [
+ Kirigami.Action {
+ objectName: 'dialog-accept'
+ text: l10n.get('dialog-accept-action')
+ },
+ Kirigami.Action {
+ objectName: 'dialog-reject'
+ text: l10n.get('dialog-reject-action')
+ }
+ ]
+ }
+
+ property var settingsActions: QtObject {
+ property var actionGroupName: l10n.get('action-group-settings-actions')
+ property list<Kirigami.Action> actions: [
+ Kirigami.Action {
+ objectName: 'settings-save'
+ icon.name: 'document-save'
+ text: l10n.get('settings-save')
+ }
+ ]
+ }
+
property var actionCollection: KazvShortcuts.ActionCollection {
id: globalActionCollection
children: [
root.globalDrawer,
- root.roomPageActions
+ root.roomPageActions,
+ root.bubbleContextActions,
+ root.roomListContextActions,
+ root.dialogActions,
+ root.settingsActions
]
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/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/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 })

File Metadata

Mime Type
text/plain
Expires
Sun, Aug 23, 12:56 PM (23 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1734367
Default Alt Text
D356.1787514960.diff (13 KB)

Event Timeline