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:
+36
-8
@@ -36,13 +36,15 @@ Page {
|
||||
musicVolumeSlider.value = musicVolume;
|
||||
crackVolumeSlider.value = crackVolume;
|
||||
|
||||
// Spruchlisten ComboBox füllen
|
||||
var lists = py.call_sync("fortunecookie.get_fortune_lists", []);
|
||||
// Spruchlisten ComboBox füllen (mit Beschreibungen und Anzahl)
|
||||
var lists = py.call_sync("fortunecookie.get_fortune_lists_with_description", []);
|
||||
fortuneListCombo.model = lists;
|
||||
|
||||
// Aktuelle Liste auswählen
|
||||
// Aktuelle Liste auswählen (vergleiche nur den Listennamen, nicht die Beschreibung)
|
||||
for (var i = 0; i < fortuneListCombo.count; i++) {
|
||||
if (fortuneListCombo.textAt(i) === currentFortuneList) {
|
||||
var text = fortuneListCombo.textAt(i);
|
||||
var listName = text.split(" - ")[0];
|
||||
if (listName === currentFortuneList) {
|
||||
fortuneListCombo.currentIndex = i;
|
||||
break;
|
||||
}
|
||||
@@ -56,15 +58,38 @@ Page {
|
||||
}
|
||||
}
|
||||
|
||||
// SPRUCHLISTEN-AUSWAHL
|
||||
// ============================================================
|
||||
|
||||
Label {
|
||||
text: "Spruchliste:"
|
||||
Layout.fillWidth: true
|
||||
fontSize: "large"
|
||||
}
|
||||
=======
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: units.gu(2)
|
||||
spacing: units.gu(2)
|
||||
|
||||
// Spacer für Header
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: units.gu(2)
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// SPRUCHLISTEN-AUSWAHL
|
||||
// ============================================================
|
||||
|
||||
Label {
|
||||
text: "Spruchliste:"
|
||||
Layout.fillWidth: true
|
||||
fontSize: "large"
|
||||
}============================================================
|
||||
// SPRUCHLISTEN-AUSWAHL
|
||||
// ============================================================
|
||||
|
||||
Label {
|
||||
text: "Spruchliste:"
|
||||
Layout.fillWidth: true
|
||||
@@ -77,9 +102,12 @@ Page {
|
||||
Layout.preferredHeight: units.gu(8)
|
||||
|
||||
onActivated: {
|
||||
var newList = fortuneListCombo.currentText;
|
||||
var newListFull = fortuneListCombo.currentText;
|
||||
// Extrahiere den Listennamen (Teil vor " - ")
|
||||
var newList = newListFull.split(" - ")[0];
|
||||
py.call("fortunecookie.set_fortune_list", [newList], function() {
|
||||
console.log("Spruchliste gewaehlt: " + newList);
|
||||
console.log("Spruchliste gewählt: " + newList);
|
||||
root.reloadFortune();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -108,7 +136,7 @@ Page {
|
||||
|
||||
onValueChanged: {
|
||||
var volume = musicVolumeSlider.value;
|
||||
py.call("fortunecookie.set_music_volume", [volume]);
|
||||
root.setMusicVolume(volume);
|
||||
musicVolumeLabel.text = Math.round(volume * 100) + "%";
|
||||
}
|
||||
}
|
||||
@@ -146,7 +174,7 @@ Page {
|
||||
|
||||
onValueChanged: {
|
||||
var volume = crackVolumeSlider.value;
|
||||
py.call("fortunecookie.set_crack_volume", [volume]);
|
||||
root.setCrackVolume(volume);
|
||||
crackVolumeLabel.text = Math.round(volume * 100) + "%";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user