chore(StatusChatInput): Move inline LinkPreviewSettingsCard's menu to separate file

Because of https://bugreports.qt.io/browse/QTBUG-90740 inline context menu causes tests for StatusChatInput crashing (stack overflow) on 5.15.2 (this version is used on CI). The easiest option to solve that problem is moving inline component to a separate file.

Closes: #12435
This commit is contained in:
Michał Cieślak 2023-10-13 14:49:05 +02:00 committed by Michał
parent 520d34240a
commit ce18a52171
4 changed files with 49 additions and 11 deletions

View File

@ -214,7 +214,7 @@ Control {
} }
} }
LinkPreviewSettingsCard.ContextMenu { LinkPreviewSettingsCardMenu {
id: settingsContextMenu id: settingsContextMenu
onEnableLinkPreviewForThisMessage: root.enableLinkPreviewForThisMessage() onEnableLinkPreviewForThisMessage: root.enableLinkPreviewForThisMessage()

View File

@ -87,7 +87,7 @@ CalloutCard {
enabled: optionsComboBox.enabled enabled: optionsComboBox.enabled
} }
} }
popup: ContextMenu { popup: LinkPreviewSettingsCardMenu {
y: - (height + 4) y: - (height + 4)
onEnableLinkPreviewForThisMessage: root.enableLinkPreviewForThisMessage() onEnableLinkPreviewForThisMessage: root.enableLinkPreviewForThisMessage()
onEnableLinkPreview: root.enableLinkPreview() onEnableLinkPreview: root.enableLinkPreview()

View File

@ -0,0 +1,37 @@
import StatusQ.Popups 0.1
StatusMenu {
id: root
signal enableLinkPreviewForThisMessage
signal enableLinkPreview
signal disableLinkPreview
hideDisabledItems: false
StatusAction {
text: qsTr("Link previews")
enabled: false
}
StatusAction {
text: qsTr("Show for this message")
icon.name: "show"
onTriggered: root.enableLinkPreviewForThisMessage()
}
StatusAction {
text: qsTr("Always show previews")
icon.name: "show"
onTriggered: root.enableLinkPreview()
}
StatusMenuSeparator { }
StatusAction {
text: qsTr("Never show previews")
icon.name: "hide"
type: StatusAction.Type.Danger
onTriggered: root.disableLinkPreview()
}
}

View File

@ -1,23 +1,24 @@
CalloutCard 1.0 CalloutCard.qml CalloutCard 1.0 CalloutCard.qml
CalloutOpacityMask 1.0 CalloutOpacityMask.qml CalloutOpacityMask 1.0 CalloutOpacityMask.qml
ChatInputLinksPreviewArea 1.0 ChatInputLinksPreviewArea.qml ChatInputLinksPreviewArea 1.0 ChatInputLinksPreviewArea.qml
DateGroup 1.0 DateGroup.qml
EmojiReaction 1.0 EmojiReaction.qml
FetchMoreMessagesButton 1.0 FetchMoreMessagesButton.qml FetchMoreMessagesButton 1.0 FetchMoreMessagesButton.qml
GapComponent 1.0 GapComponent.qml GapComponent 1.0 GapComponent.qml
GasSelectorButton 1.0 GasSelectorButton.qml
LinkPreviewCard 1.0 LinkPreviewCard.qml LinkPreviewCard 1.0 LinkPreviewCard.qml
LinkPreviewMiniCard 1.0 LinkPreviewMiniCard.qml LinkPreviewMiniCard 1.0 LinkPreviewMiniCard.qml
LinkPreviewSettingsCard 1.0 LinkPreviewSettingsCard.qml LinkPreviewSettingsCard 1.0 LinkPreviewSettingsCard.qml
UsernameLabel 1.0 UsernameLabel.qml LinkPreviewSettingsCardMenu 1.0 LinkPreviewSettingsCardMenu.qml
UserProfileCard 1.0 UserProfileCard.qml
DateGroup 1.0 DateGroup.qml
UserImage 1.0 UserImage.qml
MessageMouseArea 1.0 MessageMouseArea.qml MessageMouseArea 1.0 MessageMouseArea.qml
MessageReactionsRow 1.0 MessageReactionsRow.qml
ProfileHeader 1.0 ProfileHeader.qml
RectangleCorner 1.0 RectangleCorner.qml RectangleCorner 1.0 RectangleCorner.qml
SentMessage 1.0 SentMessage.qml
Retry 1.0 Retry.qml Retry 1.0 Retry.qml
SendTransactionButton 1.0 SendTransactionButton.qml SendTransactionButton 1.0 SendTransactionButton.qml
SentMessage 1.0 SentMessage.qml
StateBubble 1.0 StateBubble.qml StateBubble 1.0 StateBubble.qml
GasSelectorButton 1.0 GasSelectorButton.qml UserImage 1.0 UserImage.qml
EmojiReaction 1.0 EmojiReaction.qml UserProfileCard 1.0 UserProfileCard.qml
ProfileHeader 1.0 ProfileHeader.qml UsernameLabel 1.0 UsernameLabel.qml
VerificationLabel 1.0 VerificationLabel.qml VerificationLabel 1.0 VerificationLabel.qml
MessageReactionsRow 1.0 MessageReactionsRow.qml