Deactivate action buttons and menus if chat room has been left.

This commit is contained in:
Julien Wadel 2023-02-15 14:52:36 +01:00
parent 8931a01d4e
commit ad37fb0222
4 changed files with 40 additions and 33 deletions

View file

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Crash on ending call in conference.
- Crash after showing participant devices.
- Deactivate action buttons and menus if chat room has been left.
- Display of non-Ascii avatar
- Remove duplicated nat policies.
- Save Stun/Turn proxy configuration.

View file

@ -117,7 +117,8 @@ Item {
if(color)
return color
else{
console.warn("No color defined for :"+debugVar+ " on "+_getIcon())
if( debugVar )
console.warn("No color defined for :"+debugVar+ " on "+_getIcon())
return defaultColor
}
}
@ -128,10 +129,11 @@ Item {
//return getColor(wrappedButton.colorSet.backgroundNormalColor, defaultColor, 'backgroundNormalColor')
if (wrappedButton.updating || wrappedButton.toggled)
return getColor(wrappedButton.colorSet.backgroundUpdatingColor, defaultColor, 'backgroundUpdatingColor')
var normalColor = getColor(wrappedButton.colorSet.backgroundNormalColor, defaultColor, 'backgroundNormalColor')
if (!useStates)
return getColor(wrappedButton.colorSet.backgroundNormalColor, defaultColor, 'backgroundNormalColor')
return normalColor
if (!wrappedButton.enabled)
return getColor(wrappedButton.colorSet.backgroundDisabledColor, defaultColor, 'backgroundDisabledColor')
return getColor(wrappedButton.colorSet.backgroundDisabledColor, normalColor)
return button.down ? getColor(wrappedButton.colorSet.backgroundPressedColor, defaultColor, 'backgroundPressedColor')
: (button.hovered ? getColor(wrappedButton.colorSet.backgroundHoveredColor, defaultColor, 'backgroundHoveredColor')
: getColor(wrappedButton.colorSet.backgroundNormalColor, defaultColor, 'backgroundNormalColor'))
@ -145,10 +147,11 @@ Item {
//return getColor(wrappedButton.colorSet.foregroundNormalColor, defaultColor, 'foregroundNormalColor')
if (wrappedButton.updating || wrappedButton.toggled)
return getColor(wrappedButton.colorSet.foregroundUpdatingColor, defaultColor, 'foregroundUpdatingColor')
var normalColor = getColor(wrappedButton.colorSet.foregroundNormalColor, defaultColor, 'foregroundNormalColor')
if (!useStates)
return getColor(wrappedButton.colorSet.foregroundNormalColor, defaultColor, 'foregroundNormalColor')
return normalColor
if (!wrappedButton.enabled)
return getColor(wrappedButton.colorSet.foregroundDisabledColor, defaultColor, 'foregroundDisabledColor')
return getColor(wrappedButton.colorSet.foregroundDisabledColor, normalColor)
return button.down ? getColor(wrappedButton.colorSet.foregroundPressedColor, defaultColor, 'foregroundPressedColor')
: (button.hovered ? getColor(wrappedButton.colorSet.foregroundHoveredColor, defaultColor, 'foregroundHoveredColor')
: getColor(wrappedButton.colorSet.foregroundNormalColor, defaultColor, 'foregroundNormalColor'))
@ -194,7 +197,7 @@ Item {
property int fitWidth: iconWidth || iconSize || parent.iconSize || parent.width
height: fitHeight
width: fitWidth
opacity: enabled ? 1.0 : 0.5
Button {
id: button
@ -296,6 +299,7 @@ Item {
hoverEnabled: true
acceptedButtons: Qt.NoButton
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
visible: wrappedButton.enabled
}
}
@ -318,6 +322,7 @@ Item {
hoverEnabled: true
acceptedButtons: Qt.NoButton
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
visible: wrappedButton.enabled
}
}
TooltipArea {
@ -330,7 +335,7 @@ Item {
hoverEnabled: true
acceptedButtons: Qt.NoButton
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
visible: !iconIsCustom && !tooltip.visible
visible: wrappedButton.enabled && !iconIsCustom && !tooltip.visible
}
}

View file

@ -24,18 +24,28 @@ Controls.MenuItem {
property int offsetTopMargin : 0
property int offsetBottomMargin : 0
property color _textColor:
(button.down
? menuItemStyle.text.color.pressed
: (
button.hovered
? menuItemStyle.text.color.hovered
: menuItemStyle.text.color.normal
))
height:visible?undefined:0
Component.onCompleted: menu.width = Math.max(menu.width, implicitWidth)
opacity: enabled ? 1.0 : 0.5
background: Rectangle {
color: button.down
? menuItemStyle.background.color.pressed
: (
button.hovered
? menuItemStyle.background.color.hovered
: menuItemStyle.background.color.normal
)
? menuItemStyle.background.color.pressed
: (
button.hovered
? menuItemStyle.background.color.hovered
: menuItemStyle.background.color.normal
)
implicitHeight: button.menuItemStyle.background.height
}
contentItem:RowLayout{
@ -51,15 +61,7 @@ Controls.MenuItem {
visible: icon
anchors.centerIn: parent
iconSize: rowText.lineCount > 0 ? rowText.contentHeight/rowText.lineCount + 2 : 0
overwriteColor: button.enabled
? (button.down
? menuItemStyle.text.color.pressed
: (
button.hovered
? menuItemStyle.text.color.hovered
: menuItemStyle.text.color.normal
))
: menuItemStyle.text.color.disabled
overwriteColor: button._textColor
}
}
Text {
@ -68,15 +70,7 @@ Controls.MenuItem {
Layout.fillHeight: true
Layout.leftMargin:(iconLayoutDirection == Qt.LeftToRight ? 0 : menuItemStyle.leftMargin)
Layout.rightMargin:(iconLayoutDirection == Qt.LeftToRight ? menuItemStyle.rightMargin : 0)
color: button.enabled
? (button.down
? menuItemStyle.text.color.pressed
: (
button.hovered
? menuItemStyle.text.color.hovered
: menuItemStyle.text.color.normal
))
: menuItemStyle.text.color.disabled
color: button._textColor
elide: Text.ElideRight

View file

@ -266,6 +266,7 @@ ColumnLayout {
colorSet: ConversationStyle.bar.actions.videoCall
visible: SettingsModel.videoSupported && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton && !conversation.haveMoreThanOneParticipants
enabled: !conversation.chatRoomModel.isReadOnly
onClicked: CallsListModel.launchVideoCall(chatRoomModel.participants.addressesToString)
}
@ -275,6 +276,7 @@ ColumnLayout {
colorSet: ConversationStyle.bar.actions.call
visible: SettingsModel.outgoingCallsEnabled && !conversation.haveMoreThanOneParticipants
enabled: !conversation.chatRoomModel.isReadOnly
onClicked: CallsListModel.launchAudioCall(chatRoomModel.participants.addressesToString)
}
@ -284,6 +286,7 @@ ColumnLayout {
colorSet: ConversationStyle.bar.actions.chat
visible: SettingsModel.standardChatEnabled && SettingsModel.getShowStartChatButton() && !conversation.haveMoreThanOneParticipants && conversation.securityLevel != 1
enabled: !conversation.chatRoomModel.isReadOnly
onClicked: CallsListModel.launchChat(chatRoomModel.participants.addressesToString, 0)
}
@ -292,6 +295,7 @@ ColumnLayout {
backgroundRadius: 1000
colorSet: ConversationStyle.bar.actions.chat
visible: SettingsModel.secureChatEnabled && SettingsModel.getShowStartChatButton() && !conversation.haveMoreThanOneParticipants && conversation.securityLevel == 1
enabled: !conversation.chatRoomModel.isReadOnly
onClicked: CallsListModel.launchChat(chatRoomModel.participants.addressesToString, 1)
Icon{
@ -318,9 +322,9 @@ ColumnLayout {
backgroundRadius: 1000
colorSet: ConversationStyle.bar.actions.groupChat
visible: conversation.chatRoomModel && !conversation.chatRoomModel.isReadOnly && conversation.haveMoreThanOneParticipants && SettingsModel.outgoingCallsEnabled && (SettingsModel.videoConferenceEnabled || conversation.haveLessThanMinParticipantsForCall)
visible: conversation.chatRoomModel && conversation.haveMoreThanOneParticipants && SettingsModel.outgoingCallsEnabled && (SettingsModel.videoConferenceEnabled || conversation.haveLessThanMinParticipantsForCall)
enabled: !conversation.chatRoomModel.isReadOnly
//onClicked: CallsListModel. Logic.openConferenceManager({chatRoomModel:conversation.chatRoomModel, autoCall:true})
onClicked:{
if( SettingsModel.videoConferenceEnabled ){
groupCallButton.toggled = true
@ -442,6 +446,7 @@ ColumnLayout {
text: qsTr('conversationMenuDevices')
iconMenu: MenuItemStyle.devices.icon
visible: conversationMenu.showDevices
enabled: !conversation.chatRoomModel.isReadOnly
iconSizeMenu: 40
menuItemStyle : MenuItemStyle.aux2
onTriggered: {
@ -464,6 +469,7 @@ ColumnLayout {
iconSizeMenu: 40
menuItemStyle : MenuItemStyle.aux2
visible: conversationMenu.showEphemerals
enabled: !conversation.chatRoomModel.isReadOnly
onTriggered: {
window.detachVirtualWindow()
window.attachVirtualWindow(Qt.resolvedUrl('Dialogs/EphemeralChatRoom.qml')
@ -486,6 +492,7 @@ ColumnLayout {
iconSizeMenu: 40
menuItemStyle : MenuItemStyle.aux2
visible: conversationMenu.showScheduleMeeting
enabled: !conversation.chatRoomModel.isReadOnly
onClicked: {
conferenceInfoModel.resetConferenceInfo()
conferenceInfoModel.isScheduled = true