create ThemeComboBox

This commit is contained in:
Benjamin Palko 2025-09-16 10:33:55 -04:00
parent 7a04cccf0c
commit c03d24de15
2 changed files with 22 additions and 8 deletions

View file

@ -0,0 +1,20 @@
import qs.components
import qs.config
import QtQuick
StyledComboBox {
id: control
currentIndex: Theme.themes.indexOf(Theme.currentTheme)
model: Theme.themes
onActivated: index => {
Theme.currentTheme = Theme.themes[index];
}
Component.onCompleted: {
control.currentIndex = Theme.themes.indexOf(Theme.currentTheme);
Theme.onCurrentThemeChanged = () => {
Theme.themes.indexOf(Theme.currentTheme);
};
}
}