| 1 | import QtQuick |
| 2 | import QtQuick.Layouts |
| 3 | |
| 4 | // A settings row: label + a segmented pill where the primary cell slides to the choice. options: [{value, label}] |
| 5 | RowLayout { |
| 6 | id: c |
| 7 | property string label: "" |
| 8 | property var options: [] |
| 9 | property var value |
| 10 | signal picked(var v) |
| 11 | Layout.fillWidth: true |
| 12 | Layout.leftMargin: 18 |
| 13 | spacing: 16 |
| 14 | Text { |
| 15 | Layout.preferredWidth: 200 |
| 16 | text: c.label |
| 17 | color: Theme.fg |
| 18 | elide: Text.ElideRight |
| 19 | font.family: Theme.ui |
| 20 | font.pixelSize: 15 |
| 21 | } |
| 22 | Segmented { |
| 23 | Layout.fillWidth: true |
| 24 | implicitHeight: 46 |
| 25 | options: c.options |
| 26 | value: c.value |
| 27 | onPicked: v => c.picked(v) |
| 28 | } |
| 29 | } |