fix: category item style (#13975)
This commit is contained in:
parent
da4105784a
commit
ad7f39f91c
|
@ -139,6 +139,7 @@ Item {
|
||||||
showAddButton: showCategoryActionButtons
|
showAddButton: showCategoryActionButtons
|
||||||
showMenuButton: !!root.popupMenu
|
showMenuButton: !!root.popupMenu
|
||||||
hasUnreadMessages: model.hasUnreadMessages
|
hasUnreadMessages: model.hasUnreadMessages
|
||||||
|
muted: model.muted
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (mouse.button === Qt.RightButton && showCategoryActionButtons && !!root.categoryPopupMenu) {
|
if (mouse.button === Qt.RightButton && showCategoryActionButtons && !!root.categoryPopupMenu) {
|
||||||
statusChatListCategoryItem.setupPopup()
|
statusChatListCategoryItem.setupPopup()
|
||||||
|
|
|
@ -21,6 +21,7 @@ Control {
|
||||||
property bool showMenuButton: showActionButtons
|
property bool showMenuButton: showActionButtons
|
||||||
property bool showAddButton: showActionButtons
|
property bool showAddButton: showActionButtons
|
||||||
property bool hasUnreadMessages: false
|
property bool hasUnreadMessages: false
|
||||||
|
property bool muted: false
|
||||||
property alias addButton: addButton
|
property alias addButton: addButton
|
||||||
property alias menuButton: menuButton
|
property alias menuButton: menuButton
|
||||||
property alias toggleButton: toggleButton
|
property alias toggleButton: toggleButton
|
||||||
|
@ -44,10 +45,19 @@ Control {
|
||||||
StatusBaseText {
|
StatusBaseText {
|
||||||
width: Math.min(implicitWidth, parent.width)
|
width: Math.min(implicitWidth, parent.width)
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
font.weight: Font.Medium
|
font.weight: root.hasUnreadMessages ? Font.Bold : Font.Medium
|
||||||
font.pixelSize: 15
|
font.pixelSize: 15
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
color: Theme.palette.directColor4
|
color: {
|
||||||
|
if (root.muted && !hoverHandler.hovered && !root.highlighted) {
|
||||||
|
return Theme.palette.directColor5
|
||||||
|
}
|
||||||
|
if (root.hasUnreadMessages || root.highlighted || hoverHandler.hovered) {
|
||||||
|
return Theme.palette.directColor1
|
||||||
|
}
|
||||||
|
return Theme.palette.directColor4
|
||||||
|
}
|
||||||
|
|
||||||
text: root.text
|
text: root.text
|
||||||
}
|
}
|
||||||
Row {
|
Row {
|
||||||
|
@ -80,3 +90,4 @@ Control {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue