Skip to content
Snippets Groups Projects
Commit fcd8a907 authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

conf: fix participant menu focus

Superposing a MouseArea and a hover in a child
component may cause focus problems.
This replaces MouseArea for a HoverHandler
in the participant moderator menu.

Change-Id: Ic4eb763c79f04198d3a2a2f24636fb2a09dca172
GitLab: #601
parent b3dcabb9
No related branches found
No related tags found
No related merge requests found
...@@ -61,8 +61,6 @@ Item { ...@@ -61,8 +61,6 @@ Item {
} }
} }
z: 1
function setAvatar(show, uri, isLocal) { function setAvatar(show, uri, isLocal) {
if (!show) if (!show)
avatar.active = false avatar.active = false
...@@ -136,31 +134,20 @@ Item { ...@@ -136,31 +134,20 @@ Item {
} }
} }
// Participant background and buttons for moderation HoverHandler {
MouseArea { onPointChanged: {
id: participantRect participantRect.opacity = 1
fadeOutTimer.restart()
anchors.fill: parent }
opacity: 0
z: 1
propagateComposedEvents: true onHoveredChanged: {
hoverEnabled: true if (overlayMenu.hovered) {
onPositionChanged: {
participantRect.opacity = 1 participantRect.opacity = 1
fadeOutTimer.restart() fadeOutTimer.restart()
// Here we could call: root.parent.positionChanged(mouse) return
// to relay the event to a main overlay mouse area, either
// as a parent object or some property passed in. But, this
// will still fail when hovering over menus, etc.
} }
onExited: { participantRect.opacity = hovered ? 1 : 0
root.z = 1
participantRect.opacity = 0
} }
onEntered: {
root.z = 2
participantRect.opacity = 1
} }
// Timer to decide when ParticipantOverlay fade out // Timer to decide when ParticipantOverlay fade out
...@@ -168,15 +155,35 @@ Item { ...@@ -168,15 +155,35 @@ Item {
id: fadeOutTimer id: fadeOutTimer
interval: JamiTheme.overlayFadeDelay interval: JamiTheme.overlayFadeDelay
onTriggered: { onTriggered: {
if (overlayMenu.hovered) if (overlayMenu.hovered) {
fadeOutTimer.restart()
return return
}
participantRect.opacity = 0 participantRect.opacity = 0
} }
} }
// Participant background and buttons for moderation
Rectangle {
id: participantRect
width: parent.width
height: parent.height
color: "transparent"
opacity: 0
ParticipantOverlayMenu { ParticipantOverlayMenu {
id: overlayMenu id: overlayMenu
visible: isMe || meModerator visible: isMe || meModerator
onHoveredChanged: {
if (hovered) {
participantRect.opacity = 1
fadeOutTimer.restart()
} else {
participantRect.opacity = 0
}
}
} }
// Participant footer with host, moderator and mute indicators // Participant footer with host, moderator and mute indicators
......
...@@ -32,6 +32,7 @@ PushButton { ...@@ -32,6 +32,7 @@ PushButton {
pressedColor: JamiTheme.buttonConferencePressed pressedColor: JamiTheme.buttonConferencePressed
imageColor: JamiTheme.whiteColor imageColor: JamiTheme.whiteColor
hoverEnabled: false
Rectangle { Rectangle {
id: toolTipRect id: toolTipRect
...@@ -44,7 +45,7 @@ PushButton { ...@@ -44,7 +45,7 @@ PushButton {
} }
color : isBarLayout? JamiTheme.darkGreyColorOpacity color : isBarLayout? JamiTheme.darkGreyColorOpacity
: "transparent" : "transparent"
visible: root.hovered && !isSmall visible: hover.hovered && !isSmall
radius: 2 radius: 2
Text { Text {
...@@ -55,4 +56,9 @@ PushButton { ...@@ -55,4 +56,9 @@ PushButton {
font.pointSize: JamiTheme.tinyFontSize font.pointSize: JamiTheme.tinyFontSize
} }
} }
Item {
anchors.fill: parent
HoverHandler { id: hover }
}
} }
...@@ -49,10 +49,12 @@ Item { ...@@ -49,10 +49,12 @@ Item {
property int buttonPreferredSize: 24 property int buttonPreferredSize: 24
property int iconButtonPreferredSize: 16 property int iconButtonPreferredSize: 16
property bool hovered: false property alias hovered: hover.hovered
anchors.fill: parent anchors.fill: parent
HoverHandler { id: hover }
Loader { sourceComponent: isBarLayout ? barComponent : rectComponent } Loader { sourceComponent: isBarLayout ? barComponent : rectComponent }
Component { Component {
...@@ -61,8 +63,7 @@ Item { ...@@ -61,8 +63,7 @@ Item {
Control { Control {
width: root.width width: root.width
height: root.height height: root.height
hoverEnabled: false
onHoveredChanged: root.hovered = hovered
background: Rectangle { background: Rectangle {
property int buttonsSize: buttonsRect.visibleButtons * 24 + 8 * 2 property int buttonsSize: buttonsRect.visibleButtons * 24 + 8 * 2
...@@ -77,16 +78,9 @@ Item { ...@@ -77,16 +78,9 @@ Item {
height: isOverlayRect ? 80 : parent.height height: isOverlayRect ? 80 : parent.height
} }
ColumnLayout {
anchors.centerIn: parent
ParticipantControlLayout { ParticipantControlLayout {
id: buttonsRect id: buttonsRect
anchors.centerIn: parent
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.preferredWidth: implicitWidth
Layout.preferredHeight: shapeHeight
}
} }
} }
} }
...@@ -95,18 +89,17 @@ Item { ...@@ -95,18 +89,17 @@ Item {
id: barComponent id: barComponent
Control { Control {
width: buttonsRect.implicitWidth width: barButtons.implicitWidth
height: shapeHeight height: shapeHeight
hoverEnabled: false
onHoveredChanged: root.hovered = hovered
background: Item { background: Item {
clip: true clip: true
Rectangle { Rectangle {
color: JamiTheme.darkGreyColorOpacity color: JamiTheme.darkGreyColorOpacity
radius: shapeRadius radius: shapeRadius
width: parent.width + radius width: parent.width + 2 * radius
height: parent.height + radius height: parent.height + 2 * radius
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: -radius anchors.leftMargin: -radius
anchors.topMargin: -radius anchors.topMargin: -radius
...@@ -114,11 +107,7 @@ Item { ...@@ -114,11 +107,7 @@ Item {
} }
ParticipantControlLayout { ParticipantControlLayout {
id: buttonsRect id: barButtons
Layout.rightMargin: 8
Layout.preferredWidth: implicitWidth
Layout.preferredHeight: shapeHeight
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment