diff --git a/CMakeLists.txt b/CMakeLists.txt index f5dc494c..1eb0105a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,7 @@ set(QML_ELEMENTS widgets/BaseWidget widgets/ResizeAnchor widgets/DoubleSpinBox + widgets/BaseConfigDialog widgets/primitive/TextWidget widgets/primitive/IntWidget diff --git a/dialogs/WidgetConfig.qml b/dialogs/WidgetConfig.qml index aebce29f..a1a3e3cf 100644 --- a/dialogs/WidgetConfig.qml +++ b/dialogs/WidgetConfig.qml @@ -45,16 +45,12 @@ Dialog { choices = item[sub + "Choices"] typeName = "list" - } - - else if (typeName === "QVariantList") { + } else if (typeName === "QVariantList") { obj["valueType"] = item[sub + "ValueType"] obj["valueName"] = item[sub + "ValueName"] - } - - else if (typeName === "int" || typeName === "double") { - let min = item[sub + "Min"]; - let max = item[sub + "Max"]; + } else if (typeName === "int" || typeName === "double") { + let min = item[sub + "Min"] + let max = item[sub + "Max"] obj["min"] = (typeof min === "undefined") ? 0 : min obj["max"] = (typeof max === "undefined") ? 100000 : max @@ -87,13 +83,13 @@ Dialog { } function getValues() { - for (var i = 0; i < listView.count; ++i) { + for (var i = 0; i < rep.count; ++i) { let idx = lm.get(i) item[idx.name] = idx.itemValue } } - ListView { + Flow { anchors { top: parent.top bottom: parent.bottom @@ -105,412 +101,816 @@ Dialog { spacing: 8 - id: listView - - clip: true + id: flow - boundsBehavior: Flickable.StopAtBounds + Repeater { + id: rep - model: lm + clip: true - component FieldLabel: Label { - Layout.fillWidth: true + // boundsBehavior: Flickable.StopAtBounds + model: lm - text: displayText(model.name) - font.pixelSize: 15 - color: Constants.palette.text - } + component FieldLabel: Label { + Layout.fillWidth: true - delegate: DelegateChooser { - role: "type" + text: displayText(model.name) + font.pixelSize: 15 + color: Constants.palette.text + } - // TODO: may want to find a way to avoid all this repeat code - DelegateChoice { - roleValue: "QString" + delegate: DelegateChooser { + role: "type" - RowLayout { - clip: true - width: parent.width + // TODO: may want to find a way to avoid all this repeat code + DelegateChoice { + roleValue: "QString" - uniformCellSizes: true + RowLayout { + clip: true - FieldLabel {} + FieldLabel {} - TextField { - id: txt - Layout.fillWidth: true + TextField { + id: txt + Layout.fillWidth: true - font.pixelSize: 15 - text: model.itemValue + font.pixelSize: 15 + text: model.itemValue - onTextEdited: model.itemValue = text + onTextEdited: model.itemValue = text + } } } - } - DelegateChoice { - roleValue: "bool" + DelegateChoice { + roleValue: "bool" - RowLayout { - clip: true - width: parent.width - - uniformCellSizes: true + RowLayout { + clip: true - FieldLabel {} + FieldLabel {} - CheckBox { - checked: model.itemValue + CheckBox { + checked: model.itemValue - onClicked: model.itemValue = checked + onClicked: model.itemValue = checked - indicator.implicitHeight: 20 - indicator.implicitWidth: 20 + indicator.implicitHeight: 20 + indicator.implicitWidth: 20 + } } } - } - - DelegateChoice { - roleValue: "int" - RowLayout { - clip: true - width: parent.width + DelegateChoice { + roleValue: "int" - uniformCellSizes: true + RowLayout { + clip: true - FieldLabel {} + FieldLabel {} - SpinBox { - from: map.min - to: map.max + SpinBox { + from: map.min + to: map.max - id: sb + id: sb - Layout.fillWidth: true + Layout.fillWidth: true - font.pixelSize: 15 - value: model.itemValue + font.pixelSize: 15 + value: model.itemValue - onValueModified: model.itemValue = value + onValueModified: model.itemValue = value + } } } - } - - DelegateChoice { - roleValue: "double" - RowLayout { - clip: true - width: parent.width + DelegateChoice { + roleValue: "double" - uniformCellSizes: true + RowLayout { + clip: true - FieldLabel {} + FieldLabel {} - DoubleSpinBox { - from: map.min - to: map.max + DoubleSpinBox { + from: map.min + to: map.max - id: dsb - font.pixelSize: 15 - Layout.fillWidth: true + id: dsb + font.pixelSize: 15 + Layout.fillWidth: true - value: model.itemValue + value: model.itemValue - stepSize: 0.1 + stepSize: 0.1 - onValueModified: model.itemValue = value + onValueModified: model.itemValue = value + } } } - } - DelegateChoice { - roleValue: "QColor" + DelegateChoice { + roleValue: "QColor" - RowLayout { - clip: true - width: parent.width - - uniformCellSizes: true + RowLayout { + clip: true - FieldLabel {} + FieldLabel {} - TextField { - id: colorField - font.pixelSize: 15 - Layout.fillWidth: true + TextField { + id: colorField + font.pixelSize: 15 + Layout.fillWidth: true - text: model.itemValue + text: model.itemValue - onTextEdited: model.itemValue = text - } + onTextEdited: model.itemValue = text + } - Button { - Layout.fillWidth: true - text: "Pick" + Button { + Layout.fillWidth: true + text: "Pick" - function setColor() { - colorField.text = colorDialog.selectedColor - model.itemValue = colorDialog.selectedColor - colorDialog.accepted.disconnect(setColor) - } + function setColor() { + colorField.text = colorDialog.selectedColor + model.itemValue = colorDialog.selectedColor + colorDialog.accepted.disconnect(setColor) + } - onClicked: { - colorDialog.selectedColor = colorField.text - colorDialog.accepted.connect(setColor) - colorDialog.open() + onClicked: { + colorDialog.selectedColor = colorField.text + colorDialog.accepted.connect(setColor) + colorDialog.open() + } } } } - } - - DelegateChoice { - roleValue: "list" - RowLayout { - clip: true - width: parent.width + DelegateChoice { + roleValue: "list" - uniformCellSizes: true + RowLayout { + clip: true - FieldLabel {} + FieldLabel {} - function setValue(v) { - model.itemValue = v - } + function setValue(v) { + model.itemValue = v + } - ComboBox { - model: choices + ComboBox { + model: choices - delegate: ItemDelegate { - id: delegate + delegate: ItemDelegate { + id: delegate - width: choices.width - contentItem: Text { - text: modelData - color: "white" - font.pixelSize: 15 - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter + width: choices.width + contentItem: Text { + text: modelData + color: "white" + font.pixelSize: 15 + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + } + highlighted: choices.highlightedIndex === index } - highlighted: choices.highlightedIndex === index - } - id: cb - font.pixelSize: 15 - Layout.fillWidth: true + id: cb + font.pixelSize: 15 + Layout.fillWidth: true - Component.onCompleted: { - currentIndex = choices.indexOf(itemValue) - currentIndexChanged.connect(updateValue) - } + Component.onCompleted: { + currentIndex = choices.indexOf(itemValue) + currentIndexChanged.connect(updateValue) + } - function updateValue() { - setValue(valueAt(currentIndex)) + function updateValue() { + setValue(valueAt(currentIndex)) + } } } } - } - - DelegateChoice { - roleValue: "QVariantList" - - GridLayout { - clip: true - width: parent.width - rowSpacing: 0 + DelegateChoice { + roleValue: "QVariantList" - rows: 4 - columns: 2 + GridLayout { + clip: true + width: parent.width - FieldLabel {} + rowSpacing: 0 - function setValue(v) { - model.itemValue = v - } + rows: 4 + columns: 2 - function getValue() { - // stupid workaround because of cancer - // itemValue gets corrupted to a QQmlListModel for some reason - // kill me - return model.item[model.name] - } + FieldLabel {} - HorizontalHeaderView { - Layout.minimumWidth: parent.width - 90 - Layout.row: 0 - Layout.column: 1 + function setValue(v) { + model.itemValue = v + } - Layout.fillWidth: true + function getValue() { + // stupid workaround because of cancer + // itemValue gets corrupted to a QQmlListModel for some reason + // kill me + return model.item[model.name] + } - Layout.minimumHeight: 30 - Layout.columnSpan: 2 - id: horizontalHeader - syncView: tbl - clip: true - } + HorizontalHeaderView { + Layout.minimumWidth: parent.width - 90 + Layout.row: 0 + Layout.column: 1 - TableView { - Layout.minimumWidth: parent.width - 90 - Layout.minimumHeight: 40 - columnSpacing: 1 - rowSpacing: 1 - clip: true + Layout.fillWidth: true - id: tbl + Layout.minimumHeight: 30 + Layout.columnSpan: 2 + id: horizontalHeader + syncView: tbl + clip: true + } - Layout.fillWidth: true + TableView { + Layout.minimumWidth: parent.width - 90 + Layout.minimumHeight: 40 + columnSpacing: 1 + rowSpacing: 1 + clip: true - Layout.row: 1 - Layout.column: 1 + id: tbl - Layout.rowSpan: 3 + Layout.fillWidth: true - interactive: false + Layout.row: 1 + Layout.column: 1 - function resetHeight() { - Layout.minimumHeight = 42 * tblModel.rowCount() - } + Layout.rowSpan: 3 - Component.onCompleted: { - let vl = map.valueName - let iv = getValue() + interactive: false - for (let i = 0; i < iv.length; ++i) { - tblModel.add(iv[i]["Value"], iv[i][vl]) - tbl.resetHeight() + function resetHeight() { + Layout.minimumHeight = 42 * tblModel.rowCount() } - setValue(tblModel.asList()) - tblModel.dataChanged.connect(() => setValue(tblModel.asList())) - } + Component.onCompleted: { + let vl = map.valueName + let iv = getValue() - model: MapModel { - id: tblModel - valueName: map.valueName - } + for (var i = 0; i < iv.length; ++i) { + tblModel.add(iv[i]["Value"], iv[i][vl]) + tbl.resetHeight() + } - selectionModel: ItemSelectionModel {} - selectionBehavior: TableView.SelectRows - selectionMode: TableView.SingleSelection + setValue(tblModel.asList()) + tblModel.dataChanged.connect( + () => setValue(tblModel.asList())) + } - delegate: Rectangle { - border { - color: Constants.palette.text - width: 2 + model: MapModel { + id: tblModel + valueName: map.valueName } - required property bool selected - required property bool current + selectionModel: ItemSelectionModel {} + selectionBehavior: TableView.SelectRows + selectionMode: TableView.SingleSelection - implicitWidth: tbl.width / 2 - implicitHeight: 40 + delegate: Rectangle { + border { + color: Constants.palette.text + width: 2 + } - color: current ? "blue" : "black" + required property bool selected + required property bool current - Text { - font.pixelSize: 15 - anchors.centerIn: parent - text: display - color: Constants.palette.text - } + implicitWidth: tbl.width / 2 + implicitHeight: 40 - TableView.editDelegate: TextField { - font.pixelSize: 15 - anchors.fill: parent - text: display - horizontalAlignment: TextInput.AlignHCenter - verticalAlignment: TextInput.AlignVCenter - Component.onCompleted: selectAll() + color: current ? "blue" : "black" - TableView.onCommit: { - display = text + Text { + font.pixelSize: 15 + anchors.centerIn: parent + text: display + color: Constants.palette.text + } + + TableView.editDelegate: TextField { + font.pixelSize: 15 + anchors.fill: parent + text: display + horizontalAlignment: TextInput.AlignHCenter + verticalAlignment: TextInput.AlignVCenter + Component.onCompleted: selectAll() + + TableView.onCommit: { + display = text + } } } } - } - Button { - Layout.alignment: Qt.AlignTop | Qt.AlignLeft - Layout.row: 1 - Layout.column: 0 - text: "Add" + Button { + Layout.alignment: Qt.AlignTop | Qt.AlignLeft + Layout.row: 1 + Layout.column: 0 + text: "Add" - onClicked: { - tblModel.add("", "") - setValue(tblModel.asList()) - tbl.resetHeight() + onClicked: { + tblModel.add("", "") + setValue(tblModel.asList()) + tbl.resetHeight() + } } - } - Button { - Layout.alignment: Qt.AlignTop | Qt.AlignLeft - Layout.row: 2 - Layout.column: 0 - text: "Delete" + Button { + Layout.alignment: Qt.AlignTop | Qt.AlignLeft + Layout.row: 2 + Layout.column: 0 + text: "Delete" - onClicked: { - tblModel.remove(tbl.currentRow) - setValue(tblModel.asList()) - tbl.resetHeight() + onClicked: { + tblModel.remove(tbl.currentRow) + setValue(tblModel.asList()) + tbl.resetHeight() + } } } } - } - - DelegateChoice { - roleValue: "QSizeF" - RowLayout { - clip: true - width: parent.width + DelegateChoice { + roleValue: "QSizeF" + RowLayout { + clip: true - FieldLabel { - Layout.rowSpan: 4 - } + FieldLabel { + Layout.rowSpan: 4 + } - Label { - text: "Width:" - font.pixelSize: 15 - } + Label { + text: "Width:" + font.pixelSize: 15 + } - SpinBox { - from: 0 - to: 2000 + SpinBox { + from: 0 + to: 2000 - id: width + id: width - Layout.fillWidth: true + Layout.fillWidth: true - font.pixelSize: 15 - value: model.itemValue.width + font.pixelSize: 15 + value: model.itemValue.width - onValueModified: model.itemValue.width = value - } + onValueModified: model.itemValue.width = value + } - Label { - text: "Height:" - font.pixelSize: 15 - } + Label { + text: "Height:" + font.pixelSize: 15 + } - SpinBox { - from: 0 - to: 2000 + SpinBox { + from: 0 + to: 2000 - id: height + id: height - Layout.fillWidth: true + Layout.fillWidth: true - font.pixelSize: 15 - value: model.itemValue.height + font.pixelSize: 15 + value: model.itemValue.height - onValueModified: model.itemValue.height = value + onValueModified: model.itemValue.height = value + } } } } } } + + // ListView { + // anchors { + // top: parent.top + // bottom: parent.bottom + // left: parent.left + // right: parent.right + + // margins: 8 + // } + + // spacing: 8 + + // id: listView + + // clip: true + + // boundsBehavior: Flickable.StopAtBounds + + // model: lm + + // component FieldLabel: Label { + // Layout.fillWidth: true + + // text: displayText(model.name) + // font.pixelSize: 15 + // color: Constants.palette.text + // } + + // delegate: DelegateChooser { + // role: "type" + + // // TODO: may want to find a way to avoid all this repeat code + // DelegateChoice { + // roleValue: "QString" + + // RowLayout { + // clip: true + // width: parent.width + + // uniformCellSizes: true + + // FieldLabel {} + + // TextField { + // id: txt + // Layout.fillWidth: true + + // font.pixelSize: 15 + // text: model.itemValue + + // onTextEdited: model.itemValue = text + // } + // } + // } + + // DelegateChoice { + // roleValue: "bool" + + // RowLayout { + // clip: true + // width: parent.width + + // uniformCellSizes: true + + // FieldLabel {} + + // CheckBox { + // checked: model.itemValue + + // onClicked: model.itemValue = checked + + // indicator.implicitHeight: 20 + // indicator.implicitWidth: 20 + // } + // } + // } + + // DelegateChoice { + // roleValue: "int" + + // RowLayout { + // clip: true + // width: parent.width + + // uniformCellSizes: true + + // FieldLabel {} + + // SpinBox { + // from: map.min + // to: map.max + + // id: sb + + // Layout.fillWidth: true + + // font.pixelSize: 15 + // value: model.itemValue + + // onValueModified: model.itemValue = value + // } + // } + // } + + // DelegateChoice { + // roleValue: "double" + + // RowLayout { + // clip: true + // width: parent.width + + // uniformCellSizes: true + + // FieldLabel {} + + // DoubleSpinBox { + // from: map.min + // to: map.max + + // id: dsb + // font.pixelSize: 15 + // Layout.fillWidth: true + + // value: model.itemValue + + // stepSize: 0.1 + + // onValueModified: model.itemValue = value + // } + // } + // } + + // DelegateChoice { + // roleValue: "QColor" + + // RowLayout { + // clip: true + // width: parent.width + + // uniformCellSizes: true + + // FieldLabel {} + + // TextField { + // id: colorField + // font.pixelSize: 15 + // Layout.fillWidth: true + + // text: model.itemValue + + // onTextEdited: model.itemValue = text + // } + + // Button { + // Layout.fillWidth: true + // text: "Pick" + + // function setColor() { + // colorField.text = colorDialog.selectedColor + // model.itemValue = colorDialog.selectedColor + // colorDialog.accepted.disconnect(setColor) + // } + + // onClicked: { + // colorDialog.selectedColor = colorField.text + // colorDialog.accepted.connect(setColor) + // colorDialog.open() + // } + // } + // } + // } + + // DelegateChoice { + // roleValue: "list" + + // RowLayout { + // clip: true + // width: parent.width + + // uniformCellSizes: true + + // FieldLabel {} + + // function setValue(v) { + // model.itemValue = v + // } + + // ComboBox { + // model: choices + + // delegate: ItemDelegate { + // id: delegate + + // width: choices.width + // contentItem: Text { + // text: modelData + // color: "white" + // font.pixelSize: 15 + // elide: Text.ElideRight + // verticalAlignment: Text.AlignVCenter + // } + // highlighted: choices.highlightedIndex === index + // } + + // id: cb + // font.pixelSize: 15 + // Layout.fillWidth: true + + // Component.onCompleted: { + // currentIndex = choices.indexOf(itemValue) + // currentIndexChanged.connect(updateValue) + // } + + // function updateValue() { + // setValue(valueAt(currentIndex)) + // } + // } + // } + // } + + // DelegateChoice { + // roleValue: "QVariantList" + + // GridLayout { + // clip: true + // width: parent.width + + // rowSpacing: 0 + + // rows: 4 + // columns: 2 + + // FieldLabel {} + + // function setValue(v) { + // model.itemValue = v + // } + + // function getValue() { + // // stupid workaround because of cancer + // // itemValue gets corrupted to a QQmlListModel for some reason + // // kill me + // return model.item[model.name] + // } + + // HorizontalHeaderView { + // Layout.minimumWidth: parent.width - 90 + // Layout.row: 0 + // Layout.column: 1 + + // Layout.fillWidth: true + + // Layout.minimumHeight: 30 + // Layout.columnSpan: 2 + // id: horizontalHeader + // syncView: tbl + // clip: true + // } + + // TableView { + // Layout.minimumWidth: parent.width - 90 + // Layout.minimumHeight: 40 + // columnSpacing: 1 + // rowSpacing: 1 + // clip: true + + // id: tbl + + // Layout.fillWidth: true + + // Layout.row: 1 + // Layout.column: 1 + + // Layout.rowSpan: 3 + + // interactive: false + + // function resetHeight() { + // Layout.minimumHeight = 42 * tblModel.rowCount() + // } + + // Component.onCompleted: { + // let vl = map.valueName + // let iv = getValue() + + // for (let i = 0; i < iv.length; ++i) { + // tblModel.add(iv[i]["Value"], iv[i][vl]) + // tbl.resetHeight() + // } + + // setValue(tblModel.asList()) + // tblModel.dataChanged.connect(() => setValue(tblModel.asList())) + // } + + // model: MapModel { + // id: tblModel + // valueName: map.valueName + // } + + // selectionModel: ItemSelectionModel {} + // selectionBehavior: TableView.SelectRows + // selectionMode: TableView.SingleSelection + + // delegate: Rectangle { + // border { + // color: Constants.palette.text + // width: 2 + // } + + // required property bool selected + // required property bool current + + // implicitWidth: tbl.width / 2 + // implicitHeight: 40 + + // color: current ? "blue" : "black" + + // Text { + // font.pixelSize: 15 + // anchors.centerIn: parent + // text: display + // color: Constants.palette.text + // } + + // TableView.editDelegate: TextField { + // font.pixelSize: 15 + // anchors.fill: parent + // text: display + // horizontalAlignment: TextInput.AlignHCenter + // verticalAlignment: TextInput.AlignVCenter + // Component.onCompleted: selectAll() + + // TableView.onCommit: { + // display = text + // } + // } + // } + // } + + // Button { + // Layout.alignment: Qt.AlignTop | Qt.AlignLeft + // Layout.row: 1 + // Layout.column: 0 + // text: "Add" + + // onClicked: { + // tblModel.add("", "") + // setValue(tblModel.asList()) + // tbl.resetHeight() + // } + // } + + // Button { + // Layout.alignment: Qt.AlignTop | Qt.AlignLeft + // Layout.row: 2 + // Layout.column: 0 + // text: "Delete" + + // onClicked: { + // tblModel.remove(tbl.currentRow) + // setValue(tblModel.asList()) + // tbl.resetHeight() + // } + // } + // } + // } + + // DelegateChoice { + // roleValue: "QSizeF" + + // RowLayout { + // clip: true + // width: parent.width + + // FieldLabel { + // Layout.rowSpan: 4 + // } + + // Label { + // text: "Width:" + // font.pixelSize: 15 + // } + + // SpinBox { + // from: 0 + // to: 2000 + + // id: width + + // Layout.fillWidth: true + + // font.pixelSize: 15 + // value: model.itemValue.width + + // onValueModified: model.itemValue.width = value + // } + + // Label { + // text: "Height:" + // font.pixelSize: 15 + // } + + // SpinBox { + // from: 0 + // to: 2000 + + // id: height + + // Layout.fillWidth: true + + // font.pixelSize: 15 + // value: model.itemValue.height + + // onValueModified: model.itemValue.height = value + // } + // } + // } + // } + // } } diff --git a/widgets/BaseConfigDialog.qml b/widgets/BaseConfigDialog.qml new file mode 100644 index 00000000..3273c2a1 --- /dev/null +++ b/widgets/BaseConfigDialog.qml @@ -0,0 +1,50 @@ +import QtQuick +import QtQuick.Controls + +import QFRCDashboard + +Dialog { + id: config + + width: 300 + + header: Rectangle { + color: Constants.accent + topLeftRadius: 20 + topRightRadius: 20 + + height: 40 + width: parent.width + + Text { + id: txt + + text: "Configure Widget" + font.pixelSize: 24 + font.bold: true + + color: "white" + + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + + anchors { + fill: parent + margins: 8 + } + } + } + + background: Rectangle { + color: "transparent" + } + + contentItem: Rectangle { + color: Constants.palette.dialogBg + radius: 20 + anchors.fill: parent + } + + parent: Overlay.overlay + anchors.centerIn: parent +} diff --git a/widgets/BaseWidget.qml b/widgets/BaseWidget.qml index 10e35bb3..ed5f08c3 100644 --- a/widgets/BaseWidget.qml +++ b/widgets/BaseWidget.qml @@ -106,7 +106,7 @@ Rectangle { MenuItem { text: "Configure" - onTriggered: openConf(rcMenu.parent) + onTriggered: config.open() } MenuItem { diff --git a/widgets/misc/CameraView.qml b/widgets/misc/CameraView.qml index ffb39307..7782765e 100644 --- a/widgets/misc/CameraView.qml +++ b/widgets/misc/CameraView.qml @@ -1,5 +1,6 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.15 import QtMultimedia @@ -33,8 +34,9 @@ BaseWidget { } function fixUrls(value) { - for (let i = 0; i < value.length; ++i) { - if (value[i].startsWith("mjpg:")) value[i] = value[i].substring(5) + for (var i = 0; i < value.length; ++i) { + if (value[i].startsWith("mjpg:")) + value[i] = value[i].substring(5) } } @@ -43,7 +45,8 @@ BaseWidget { urlChoices = ntValue fixUrls(urlChoices) - if (urlChoices.length > 0 && item_url === "") item_url = urlChoices[0] + if (urlChoices.length > 0 && item_url === "") + item_url = urlChoices[0] } } @@ -87,7 +90,12 @@ BaseWidget { } function resetSource() { - source = Qt.url(item_url + (item_quality !== 0 ? "compression=" + item_quality + "&" : "") + (item_fps !== 0 ? "fps=" + item_fps + "&" : "") + (item_resolution !== Qt.size(0, 0) ? "resolution=" + item_resolution.width + "x" + item_resolution.height : "")) + source = Qt.url(item_url + (item_quality !== 0 ? "compression=" + + item_quality + "&" : "") + + (item_fps !== 0 ? "fps=" + item_fps + "&" : "") + + (item_resolution !== Qt.size( + 0, 0) ? "resolution=" + item_resolution.width + "x" + + item_resolution.height : "")) } function reconnect() { @@ -118,6 +126,19 @@ BaseWidget { topicStore.subscribe(item_topic + "/streams") model.topic = item_topic - updateTopic(item_topic + "/streams", topicStore.getValue(model.topic + "/streams")) + updateTopic(item_topic + "/streams", + topicStore.getValue(model.topic + "/streams")) + } + + BaseConfigDialog { + id: config + + height: header.height + footer.height + 10 + + footer: ColumnLayout { + TextField { + placeholderText: "hi" + } + } } } diff --git a/widgets/primitive/BoolWidget.qml b/widgets/primitive/BoolWidget.qml index fa351dbe..73b6bac9 100644 --- a/widgets/primitive/BoolWidget.qml +++ b/widgets/primitive/BoolWidget.qml @@ -8,11 +8,6 @@ BaseWidget { property int item_checkboxSize: 20 - property list item_test: [] - - property string testValueType: "color" - property string testValueName: "Color" - Menu { id: switchMenu title: "Switch Widget..." @@ -70,4 +65,10 @@ BaseWidget { control.checked = topicStore.getValue(item_topic) } + + Dialog { + id: config + + anchors.centerIn: parent + } }