fix: Multiple UI improvements und Bugfixes

- Musik-Button: Größe von 10GU auf 14GU erhöht
- Lautstärke: Sofortige Änderung durch root.setMusicVolume/root.setCrackVolume
- Listenauswahl: Beschreibungen mit Sprüchezahl hinzugefügt (fortune - Glückskeks-Sprüche (139))
- Listenwechsel: Sofortige Aktualisierung des Fortune-Textes via root.reloadFortune()
- Überschrift: Spacer unter Header für bessere Sichtbarkeit
- Listenauswahl: Korrekte Auswahl trotz formatierter Anzeige

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
darklithium
2026-06-03 01:33:31 +02:00
parent 61aaad7e42
commit f27baeb683
3 changed files with 83 additions and 15 deletions
+31 -7
View File
@@ -31,17 +31,41 @@ MainView {
}
}
property real musicVolume: 0.5
property real crackVolume: 1.0
// Funktionen zum Setzen der Lautstärke
function setMusicVolume(volume) {
root.musicVolume = volume;
py.call("fortunecookie.set_music_volume", [volume]);
}
function setCrackVolume(volume) {
root.crackVolume = volume;
py.call("fortunecookie.set_crack_volume", [volume]);
}
function reloadFortune() {
currentFortune = py.call_sync("fortunecookie.get_current_fortune", []);
currentFortuneLabel.text = currentFortune;
if (fortuneOpened) {
currentFortuneLabel.visible = true;
}
}
MediaPlayer {
id: mediaPlayer
objectName: "mediaPlayer"
source: Qt.resolvedUrl("../assets/chinese_music.mp3")
loops: MediaPlayer.Infinite
volume: 0.5
volume: root.musicVolume
}
MediaPlayer {
id: crackMediaPlayer
objectName: "crackMediaPlayer"
source: Qt.resolvedUrl("../assets/cookie_crack.mp3")
volume: 1.0
volume: root.crackVolume
}
// ====================================================================
@@ -95,11 +119,11 @@ MainView {
mediaPlayer.play();
}
// Volumes laden und setzen
// Volumes laden und Properties setzen
var musicVol = py.call_sync("fortunecookie.get_music_volume", []);
var crackVol = py.call_sync("fortunecookie.get_crack_volume", []);
mediaPlayer.volume = musicVol;
crackMediaPlayer.volume = crackVol;
root.musicVolume = musicVol;
root.crackVolume = crackVol;
appInitialized = true;
@@ -201,8 +225,8 @@ MainView {
bottom: parent.bottom
margins: units.gu(2)
}
width: units.gu(10)
height: units.gu(10)
width: units.gu(14)
height: units.gu(14)
text: musicPlaying ? "\uD83D\uDD0A" : "\uD83D\uDD07"
fontSize: "xx-large"
horizontalAlignment: Text.AlignHCenter