diff --git a/src/MpvPlayerBackend.cpp b/src/MpvPlayerBackend.cpp index d8294e8..3abb98a 100644 --- a/src/MpvPlayerBackend.cpp +++ b/src/MpvPlayerBackend.cpp @@ -533,7 +533,6 @@ MpvPlayerBackend::handle_mpv_event(mpv_event* event) } } else if (strcmp(prop->name, "mute") == 0 || strcmp(prop->name, "volume") == 0) { - return; double volume = getProperty("volume").toDouble(); bool mute = getProperty("mute").toBool(); if (mute || volume == 0) { diff --git a/src/qml/UIComponents/.VolumeButton.qml.kate-swp b/src/qml/UIComponents/.VolumeButton.qml.kate-swp new file mode 100644 index 0000000..77ac264 Binary files /dev/null and b/src/qml/UIComponents/.VolumeButton.qml.kate-swp differ diff --git a/src/qml/UIComponents/VolumeButton.qml b/src/qml/UIComponents/VolumeButton.qml index 179c5b8..50833ab 100644 --- a/src/qml/UIComponents/VolumeButton.qml +++ b/src/qml/UIComponents/VolumeButton.qml @@ -22,10 +22,8 @@ Button { } background: Item { } - Connections { - target: player - enabled: true - onVolumeStatusChanged: function (status) { + + function updateStatus(status) { if (volumeButton == null) console.log("OwO") @@ -37,5 +35,10 @@ Button { volumeButton.icon.source = "qrc:/icons/" + appearance.themeName + "/volume-up.svg" } } + + Connections { + target: player + enabled: true + onVolumeStatusChanged: updateStatus } } diff --git a/src/qml/YouTubeButtonLayout.qml b/src/qml/YouTubeButtonLayout.qml index 4fd9f10..02fb877 100644 --- a/src/qml/YouTubeButtonLayout.qml +++ b/src/qml/YouTubeButtonLayout.qml @@ -39,6 +39,19 @@ Item { icon.width: parent.height / 2 } + MouseArea { + id: mouseAreaVolumeArea + anchors.bottom: parent.bottom + anchors.left: volumeButton.left + anchors.right: volumeSlider.right + anchors.top: parent.top + width: volumeButton.width + + (volumeSlider.visible ? volumeSlider.width : 0) + hoverEnabled: true + propagateComposedEvents: true + acceptedButtons: Qt.NoButton + } + VolumeButton { id: volumeButton anchors.left: playlistNextButton.right @@ -53,6 +66,8 @@ Item { anchors.top: parent.top anchors.bottom: parent.bottom height: parent.height + visible: mouseAreaVolumeArea.containsMouse || volumeButton.hovered + width: visible ? implicitWidth : 0 } TimeLabel { anchors.left: volumeSlider.right