fix(StatusChatInfoButton): missing lock icon
- propagate and set `requiresPermissions` + `locked` from the `chatContentModule.chatDetails` - set the icon accordingly for community chats Fixes #16502
This commit is contained in:
parent
0bb2bc0e03
commit
6ba74fae8e
|
@ -15,7 +15,8 @@ Button {
|
|||
property string subTitle
|
||||
property bool muted
|
||||
property int pinnedMessagesCount
|
||||
|
||||
property bool requiresPermissions
|
||||
property bool locked
|
||||
property bool forceHideTypeIcon: false
|
||||
|
||||
property StatusAssetSettings asset: StatusAssetSettings {
|
||||
|
@ -108,8 +109,12 @@ Button {
|
|||
return "tiny/public-chat"
|
||||
case StatusChatInfoButton.Type.GroupChat:
|
||||
return "tiny/group"
|
||||
case StatusChatInfoButton.Type.CommunityChat:
|
||||
return "tiny/channel"
|
||||
case StatusChatInfoButton.Type.CommunityChat: {
|
||||
var iconName = "tiny/channel"
|
||||
if (root.requiresPermissions)
|
||||
iconName = root.locked ? "tiny/channel-locked" : "tiny/channel-unlocked"
|
||||
return Theme.palette.name === "light" ? iconName : iconName+"-white"
|
||||
}
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
|
|
@ -270,7 +270,8 @@ Item {
|
|||
|
||||
objectName: "chatInfoBtnInHeader"
|
||||
title: chatContentModule? chatContentModule.chatDetails.name : ""
|
||||
|
||||
requiresPermissions: chatContentModule ? chatContentModule.chatDetails.requiresPermissions : false
|
||||
locked: requiresPermissions && (chatContentModule ? !chatContentModule.chatDetails.canPost : false)
|
||||
subTitle: {
|
||||
if(!chatContentModule)
|
||||
return ""
|
||||
|
|
Loading…
Reference in New Issue