From def26f8fdab4ec1aea46d60994f0e4049ff652bb Mon Sep 17 00:00:00 2001 From: Dark Steveneq Date: Tue, 14 Oct 2025 10:06:06 +0200 Subject: [PATCH] Fix theme on native light mode, implement volume slider --- .gitignore | 1 + .vscode/tasks.json | 17 +++++++++++++++++ CMakePresets.json | 22 ---------------------- Main.qml | 5 ++++- Player.qml | 11 +++++++---- QYRComponents/Label.qml | 1 + QYRComponents/Slider.qml | 28 ++++++++++++++-------------- ViewPlayer.qml | 2 ++ 8 files changed, 46 insertions(+), 41 deletions(-) create mode 100644 .vscode/tasks.json delete mode 100644 CMakePresets.json diff --git a/.gitignore b/.gitignore index 23c9c1e..8ab001e 100755 --- a/.gitignore +++ b/.gitignore @@ -87,4 +87,5 @@ out/ .direnv dist +CMakePresets.json CMakeUserPresets.json \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..95967a9 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "cmake", + "label": "CMake: build", + "command": "build", + "options": {"cwd": "${workspaceFolder}/build"}, + "targets": [ + "all" + ], + "group": "build", + "problemMatcher": [], + "detail": "CMake template build task" + } + ] +} \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json deleted file mode 100644 index 56c4ce3..0000000 --- a/CMakePresets.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "version": 3, - "configurePresets": [ - { - "hidden": true, - "name": "Qt", - "cacheVariables": { - "CMAKE_PREFIX_PATH": "$env{QTDIR}" - }, - "vendor": { - "qt-project.org/Qt": { - "checksum": "wVa86FgEkvdCTVp1/nxvrkaemJc=" - } - } - } - ], - "vendor": { - "qt-project.org/Presets": { - "checksum": "67SmY24ZeVbebyKD0fGfIzb/bGI=" - } - } -} \ No newline at end of file diff --git a/Main.qml b/Main.qml index b2acaab..646cc8e 100755 --- a/Main.qml +++ b/Main.qml @@ -42,6 +42,9 @@ ApplicationWindow { TabBar { id: tabbar spacing: 10 + + background: Item{} + TabButton { text: qsTr("Autoradio") } @@ -95,7 +98,7 @@ ApplicationWindow { visible: status == Loader.Ready sourceComponent: ViewPlayer { title: qsTr("Deep Bass") - streamURL: "https://youradio.nonamesoft.xyz/api/deepbass" + streamURL: "https://youradio.nonamesoft.xyz/api/bassboosted" } } } diff --git a/Player.qml b/Player.qml index 25ff1b6..535947f 100644 --- a/Player.qml +++ b/Player.qml @@ -5,6 +5,13 @@ pragma Singleton MediaPlayer { source: "" + audioOutput: AudioOutput { + id: output + volume: 0.4 + } + + property alias volume: output.volume + function startPlaying(url) { if (playing) { return; @@ -20,10 +27,6 @@ MediaPlayer { stop(); } - audioOutput: AudioOutput { - volume: 0.4 - } - onErrorOccurred: function(error, errorString) { stopPlaying(); } diff --git a/QYRComponents/Label.qml b/QYRComponents/Label.qml index c4ddcba..70eafdc 100644 --- a/QYRComponents/Label.qml +++ b/QYRComponents/Label.qml @@ -5,6 +5,7 @@ import QtQuick.Controls.Basic 6.8 Label { property string heading: "base" + color: Colors.text font.family: Colors.fontFamily font.pixelSize: Colors.fontSize[heading] } diff --git a/QYRComponents/Slider.qml b/QYRComponents/Slider.qml index a851135..1222d7f 100644 --- a/QYRComponents/Slider.qml +++ b/QYRComponents/Slider.qml @@ -8,20 +8,20 @@ Slider { implicitWidth: 130 implicitHeight: 20 - // OpacityAnimator on opacity{ - // from: 0.7 - // to: 1 - // duration: 200 - // target: parent - // running: parent.hovered - // } - // OpacityAnimator on opacity{ - // from: 1 - // to: 0.7 - // duration: 200 - // target: parent - // running: !parent.hovered - // } + OpacityAnimator on opacity{ + from: 0.7 + to: 1 + duration: 200 + target: this + running: parent.hovered + } + OpacityAnimator on opacity{ + from: 1 + to: 0.7 + duration: 200 + target: this + running: !parent.hovered + } background: Rectangle { color: "#555" diff --git a/ViewPlayer.qml b/ViewPlayer.qml index e94ba9a..c166c8a 100644 --- a/ViewPlayer.qml +++ b/ViewPlayer.qml @@ -80,6 +80,8 @@ ColumnLayout { from: 0.1 to: 1.1 stepSize: 0.1 + value: Player.volume + 0.1 + onMoved: Player.volume = value - 0.1 } }