| 1 |
// SPDX-License-Identifier: GPL-3.0-or-later |
| 2 |
// Copyright 2025 Juan Palacios <[email protected]> |
| 3 |
|
| 4 |
import QtQuick 2.15 |
| 5 |
import QtQuick.Controls 2.15 |
| 6 |
import QtQuick.Layouts 1.15 |
| 7 |
import "Style.js" as Style |
| 8 |
|
| 9 |
Pane { |
| 10 |
id: control |
| 11 |
|
| 12 |
property alias title: title.text |
| 13 |
property alias min: offsetSld.from |
| 14 |
property alias max: offsetSld.to |
| 15 |
property alias value: offsetSld.value |
| 16 |
|
| 17 |
signal offsetChanged(int value) |
| 18 |
|
| 19 |
padding: Style.g_padding |
| 20 |
background: Rectangle { |
| 21 |
border.color: Style.FVControl.border_color |
| 22 |
border.width: 2 |
| 23 |
color: "#00000000" |
| 24 |
} |
| 25 |
|
| 26 |
TextMetrics { |
| 27 |
id: tFMetrics |
| 28 |
text: "-000" |
| 29 |
} |
| 30 |
|
| 31 |
ColumnLayout { |
| 32 |
anchors.fill: parent |
| 33 |
|
| 34 |
Label { |
| 35 |
id: title |
| 36 |
font.pointSize: 11 |
| 37 |
font.bold: true |
| 38 |
} |
| 39 |
|
| 40 |
CPane { |
| 41 |
padding: Style.FVControl.inner_padding |
| 42 |
bottomPadding: 0 |
| 43 |
|
| 44 |
ColumnLayout { |
| 45 |
Layout.fillWidth: true |
| 46 |
|
| 47 |
Label { |
| 48 |
text: qsTr("OFFSET") |
| 49 |
Layout.alignment: Qt.AlignHCenter |
| 50 |
} |
| 51 |
|
| 52 |
Label { |
| 53 |
text: "MHz" |
| 54 |
font.pointSize: 8 |
| 55 |
Layout.alignment: Qt.AlignHCenter |
| 56 |
} |
| 57 |
|
| 58 |
Slider { |
| 59 |
id: offsetSld |
| 60 |
|
| 61 |
Layout.alignment: Qt.AlignHCenter |
| 62 |
orientation: Qt.Vertical |
| 63 |
|
| 64 |
stepSize: 1 |
| 65 |
|
| 66 |
onPressedChanged: pressed => { |
| 67 |
if (!pressed) |
| 68 |
control.offsetChanged(value) |
| 69 |
} |
| 70 |
} |
| 71 |
|
| 72 |
CIntInput { |
| 73 |
value: offsetSld.value |
| 74 |
minValue: offsetSld.from |
| 75 |
maxValue: offsetSld.to |
| 76 |
Layout.preferredWidth: tFMetrics.width + padding * 2 |
| 77 |
Layout.alignment: Qt.AlignHCenter |
| 78 |
|
| 79 |
onValueChanged: control.offsetChanged(value) |
| 80 |
} |
| 81 |
} |
| 82 |
} |
| 83 |
} |
| 84 |
} |