mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-17 00:56:39 +00:00
uiux(Chat): change channel background when hovering over them
This commit is contained in:
parent
8bf82e1dd6
commit
6f138f2d44
@ -18,9 +18,15 @@ Rectangle {
|
|||||||
property bool isCompact: appSettings.compactMode
|
property bool isCompact: appSettings.compactMode
|
||||||
property int contentType: 1
|
property int contentType: 1
|
||||||
property bool muted: false
|
property bool muted: false
|
||||||
|
property bool hovered: false
|
||||||
|
|
||||||
id: wrapper
|
id: wrapper
|
||||||
color: ListView.isCurrentItem ? Style.current.secondaryBackground : Style.current.transparent
|
color: {
|
||||||
|
if (ListView.isCurrentItem || wrapper.hovered) {
|
||||||
|
return Style.current.secondaryBackground
|
||||||
|
}
|
||||||
|
return Style.current.transparent
|
||||||
|
}
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: applicationWindow.top
|
anchors.top: applicationWindow.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
@ -30,20 +36,6 @@ Rectangle {
|
|||||||
visible: isVisible ? true : false
|
visible: isVisible ? true : false
|
||||||
height: isVisible ? !isCompact ? 64 : contactImage.height + Style.current.smallPadding * 2 : 0
|
height: isVisible ? !isCompact ? 64 : contactImage.height + Style.current.smallPadding * 2 : 0
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
|
||||||
if (mouse.button & Qt.RightButton) {
|
|
||||||
channelContextMenu.openMenu(index, muted, chatType, name, chatId, identicon)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
chatsModel.setActiveChannelByIndex(index)
|
|
||||||
chatGroupsListView.currentIndex = index
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusIdenticon {
|
StatusIdenticon {
|
||||||
id: contactImage
|
id: contactImage
|
||||||
height: !isCompact ? 40 : 20
|
height: !isCompact ? 40 : 20
|
||||||
@ -178,6 +170,28 @@ Rectangle {
|
|||||||
color: Style.current.white
|
color: Style.current.white
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
onEntered: {
|
||||||
|
wrapper.hovered = true
|
||||||
|
}
|
||||||
|
onExited: {
|
||||||
|
wrapper.hovered = false
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
if (mouse.button & Qt.RightButton) {
|
||||||
|
channelContextMenu.openMenu(index, muted, chatType, name, chatId, identicon)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
chatsModel.setActiveChannelByIndex(index)
|
||||||
|
chatGroupsListView.currentIndex = index
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*##^##
|
/*##^##
|
||||||
|
Loading…
x
Reference in New Issue
Block a user