import QtQuick import QtQuick.Layouts import "../../components" import "../../services" // Few short choices render as a segmented control, longer lists as a menu. SettingRow { id: root property string label property var choices: [] readonly property bool segmented: choices.length > 1 && choices.length <= 4 && choices.join("").length <= 34 title: label GlassSegmented { visible: root.segmented model: root.choices currentIndex: root.choices.indexOf(ConfigService.value(root.setting)) onActivated: (index, value) => ConfigService.setValue(root.setting, value) } GlassComboBox { visible: !root.segmented Layout.preferredWidth: 240 model: root.choices currentIndex: Math.max(0, root.choices.indexOf(ConfigService.value(root.setting))) onActivated: ConfigService.setValue(root.setting, currentText) } }