fix(@desktop/settings): Fix precision of volume

Also move soundtrack in assets and reuse audio component
This commit is contained in:
¨Anthony 2021-10-11 14:41:42 +02:00 committed by Iuri Matias
parent e68d06462d
commit 4c55ad26bb
9 changed files with 12 additions and 22 deletions

View File

@ -24,7 +24,7 @@ Item {
anchors.left: parent.left
anchors.leftMargin: 24
//% "Sound volume"
text: qsTrId("sound-volume") + " " + volume.value
text: qsTrId("sound-volume") + " " + volume.value.toPrecision(1)
font.pixelSize: 15
}

View File

@ -4,7 +4,6 @@ import QtQuick.Layouts 1.13
import QtMultimedia 5.13
import utils 1.0
import "../sounds"
import "../shared"
import "../shared/status"
import "../shared/popups"
@ -151,24 +150,19 @@ Item {
}
}
ErrorSound {
Audio {
id: errorSound
track: "error.mp3"
}
Audio {
id: sendMessageSound
audioRole: Audio.NotificationRole
source: "../../../../sounds/send_message.wav"
volume: appSettings.volume
muted: !appSettings.notificationSoundsEnabled
track: "send_message.wav"
}
Audio {
id: notificationSound
audioRole: Audio.NotificationRole
source: "../../../../sounds/notification.wav"
volume: appSettings.volume
muted: !appSettings.notificationSoundsEnabled
track: "notification.wav"
}
ModuleWarning {

View File

@ -2,15 +2,12 @@ import QtQuick 2.13
import QtMultimedia 5.13
Audio {
id: errorSound
source: "./error.mp3"
id: audio
property string track: "error.mp3"
source: Qt.resolvedUrl("./../assets/audio" + track)
audioRole: Audio.NotificationRole
volume: appSettings.volume
muted: !appSettings.notificationSoundsEnabled
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/
}

View File

@ -5,3 +5,4 @@ singleton Config 1.0 Config.qml
singleton Constants 1.0 Constants.qml
singleton SelectedMessage 1.0 SelectedMessage.qml
singleton Backpressure 1.0 Backpressure/Backpressure.qml
Audio 1.0 Audio.qml

View File

@ -13,7 +13,6 @@ import DotherSide 0.1
import "./app/AppLayouts/Onboarding/views"
import "./app"
import "./sounds"
import "./shared"
import utils 1.0

View File

@ -1 +0,0 @@
ErrorSound 1.0 ErrorSound.qml