mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Try to improve the native menu situation on Qt 6.8
This commit is contained in:
parent
50859f2535
commit
ae9d8ba4ae
5 changed files with 51 additions and 10 deletions
|
@ -209,6 +209,13 @@ Page {
|
||||||
popup(parent);
|
popup(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (communityContextMenu.popupType != undefined) {
|
||||||
|
communityContextMenu.popupType = 2; // Popup.Native with fallback on older Qt (<6.8.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: communityContextMenu.muted
|
checked: communityContextMenu.muted
|
||||||
|
|
|
@ -447,6 +447,12 @@ Item {
|
||||||
ReportMessage {}
|
ReportMessage {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (messageContextMenuC.popupType != undefined) {
|
||||||
|
messageContextMenuC.popupType = 2; // Popup.Native with fallback on older Qt (<6.8.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
enabled: visible
|
enabled: visible
|
||||||
text: qsTr("Go to &message")
|
text: qsTr("Go to &message")
|
||||||
|
@ -472,6 +478,7 @@ Item {
|
||||||
onTriggered: Clipboard.text = messageContextMenuC.link
|
onTriggered: Clipboard.text = messageContextMenuC.link
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
enabled: visible
|
||||||
id: reactionOption
|
id: reactionOption
|
||||||
|
|
||||||
text: qsTr("Re&act")
|
text: qsTr("Re&act")
|
||||||
|
@ -483,6 +490,7 @@ Item {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
enabled: visible
|
||||||
text: qsTr("Repl&y")
|
text: qsTr("Repl&y")
|
||||||
visible: room ? room.permissions.canSend(MtxEvent.TextMessage) : false
|
visible: room ? room.permissions.canSend(MtxEvent.TextMessage) : false
|
||||||
|
|
||||||
|
@ -510,11 +518,13 @@ Item {
|
||||||
onTriggered: visible && room.pinnedMessages.includes(messageContextMenuC.eventId) ? room.unpin(messageContextMenuC.eventId) : room.pin(messageContextMenuC.eventId)
|
onTriggered: visible && room.pinnedMessages.includes(messageContextMenuC.eventId) ? room.unpin(messageContextMenuC.eventId) : room.pin(messageContextMenuC.eventId)
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
enabled: visible
|
||||||
text: qsTr("&Read receipts")
|
text: qsTr("&Read receipts")
|
||||||
|
|
||||||
onTriggered: room.showReadReceipts(messageContextMenuC.eventId)
|
onTriggered: room.showReadReceipts(messageContextMenuC.eventId)
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
enabled: visible
|
||||||
text: qsTr("&Forward")
|
text: qsTr("&Forward")
|
||||||
visible: messageContextMenuC.eventType == MtxEvent.ImageMessage || messageContextMenuC.eventType == MtxEvent.VideoMessage || messageContextMenuC.eventType == MtxEvent.AudioMessage || messageContextMenuC.eventType == MtxEvent.FileMessage || messageContextMenuC.eventType == MtxEvent.Sticker || messageContextMenuC.eventType == MtxEvent.TextMessage || messageContextMenuC.eventType == MtxEvent.LocationMessage || messageContextMenuC.eventType == MtxEvent.EmoteMessage || messageContextMenuC.eventType == MtxEvent.NoticeMessage
|
visible: messageContextMenuC.eventType == MtxEvent.ImageMessage || messageContextMenuC.eventType == MtxEvent.VideoMessage || messageContextMenuC.eventType == MtxEvent.AudioMessage || messageContextMenuC.eventType == MtxEvent.FileMessage || messageContextMenuC.eventType == MtxEvent.Sticker || messageContextMenuC.eventType == MtxEvent.TextMessage || messageContextMenuC.eventType == MtxEvent.LocationMessage || messageContextMenuC.eventType == MtxEvent.EmoteMessage || messageContextMenuC.eventType == MtxEvent.NoticeMessage
|
||||||
|
|
||||||
|
@ -526,9 +536,11 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
enabled: visible
|
||||||
text: qsTr("&Mark as read")
|
text: qsTr("&Mark as read")
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
enabled: visible
|
||||||
text: qsTr("View raw message")
|
text: qsTr("View raw message")
|
||||||
|
|
||||||
onTriggered: room.viewRawMessage(messageContextMenuC.eventId)
|
onTriggered: room.viewRawMessage(messageContextMenuC.eventId)
|
||||||
|
@ -542,6 +554,7 @@ Item {
|
||||||
onTriggered: room.viewDecryptedRawMessage(messageContextMenuC.eventId)
|
onTriggered: room.viewDecryptedRawMessage(messageContextMenuC.eventId)
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
|
enabled: visible
|
||||||
text: qsTr("Remo&ve message")
|
text: qsTr("Remo&ve message")
|
||||||
visible: (room ? room.permissions.canRedact() : false) || messageContextMenuC.isSender
|
visible: (room ? room.permissions.canRedact() : false) || messageContextMenuC.isSender
|
||||||
|
|
||||||
|
@ -605,6 +618,13 @@ Item {
|
||||||
open();
|
open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (replyContextMenuC.popupType != undefined) {
|
||||||
|
replyContextMenuC.popupType = 2; // Popup.Native with fallback on older Qt (<6.8.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
enabled: visible
|
enabled: visible
|
||||||
text: qsTr("&Copy")
|
text: qsTr("&Copy")
|
||||||
|
|
|
@ -732,14 +732,6 @@ Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component {
|
|
||||||
id: nestedSpaceMenuLevel
|
|
||||||
|
|
||||||
SpaceMenuLevel {
|
|
||||||
childMenu: rootSpaceMenu.childMenu
|
|
||||||
roomid: roomContextMenu.roomid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Menu {
|
Menu {
|
||||||
id: roomContextMenu
|
id: roomContextMenu
|
||||||
|
|
||||||
|
@ -752,6 +744,21 @@ Page {
|
||||||
popup(parent);
|
popup(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (roomContextMenu.popupType != undefined) {
|
||||||
|
roomContextMenu.popupType = 2; // Popup.Native with fallback on older Qt (<6.8.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: nestedSpaceMenuLevel
|
||||||
|
|
||||||
|
SpaceMenuLevel {
|
||||||
|
childMenu: rootSpaceMenu.childMenu
|
||||||
|
roomid: roomContextMenu.roomid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
InputDialog {
|
InputDialog {
|
||||||
id: newTag
|
id: newTag
|
||||||
|
|
||||||
|
|
|
@ -239,9 +239,16 @@ Pane {
|
||||||
Menu {
|
Menu {
|
||||||
id: roomOptionsMenu
|
id: roomOptionsMenu
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (roomOptionsMenu.popupType != undefined) {
|
||||||
|
roomOptionsMenu.popupType = 2; // Popup.Native with fallback on older Qt (<6.8.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: qsTr("Invite users")
|
text: qsTr("Invite users")
|
||||||
visible: room ? room.permissions.canInvite() : false
|
enabled: room ? room.permissions.canInvite() : false
|
||||||
|
|
||||||
onTriggered: TimelineManager.openInviteUsers(roomId)
|
onTriggered: TimelineManager.openInviteUsers(roomId)
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ Menu {
|
||||||
onObjectAdded: (idx, o) => {
|
onObjectAdded: (idx, o) => {
|
||||||
spacesMenu.insertMenu(idx + (spacesMenu.position != -1 ? 6 : 0), o)
|
spacesMenu.insertMenu(idx + (spacesMenu.position != -1 ? 6 : 0), o)
|
||||||
}
|
}
|
||||||
//onObjectRemoved: spacesMenu.removeMenu(object)
|
onObjectRemoved: (index, object) => tagsMenu.removeItem(object)
|
||||||
|
|
||||||
delegate: childMenu
|
delegate: childMenu
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue