Unverified Commit e6e27651 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Fix filter dialog clipping (#9152)

parent bd757cb3
...@@ -27,75 +27,59 @@ Item { ...@@ -27,75 +27,59 @@ Item {
property bool loaded: false property bool loaded: false
Component { Component {
id: filtersDialogComponent id: filtersPopupDialog
QGCViewDialog {
QGCFlickable {
anchors.fill: parent
contentHeight: categoryColumn.height
clip: true
ColumnLayout {
anchors.fill: parent
RowLayout {
spacing: ScreenTools.defaultFontPixelHeight / 2
Layout.alignment: Qt.AlignVCenter
Layout.fillHeight: true
Layout.fillWidth: true
QGCLabel { QGCPopupDialog {
text: qsTr("Search:") title: qsTr("Turn on logging categories")
} buttons: StandardButton.Close
QGCTextField { ColumnLayout {
id: searchText RowLayout {
text: "" spacing: ScreenTools.defaultFontPixelHeight / 2
Layout.fillWidth: true Layout.fillWidth: true
enabled: true
}
QGCButton { QGCLabel { text: qsTr("Search:") }
text: qsTr("Clear")
onClicked: searchText.text = "" QGCTextField {
} id: searchText
text: ""
Layout.fillWidth: true
enabled: true
} }
Row { QGCButton {
spacing: ScreenTools.defaultFontPixelHeight / 2 text: qsTr("Clear")
QGCButton { onClicked: searchText.text = ""
text: qsTr("Clear All") }
onClicked: categoryRepeater.setAllLogs(false) }
QGCButton {
text: qsTr("Clear All")
onClicked: categoryRepeater.setAllLogs(false)
}
Repeater {
id: categoryRepeater
model: QGroundControl.loggingCategories()
function setAllLogs(value) {
var logCategories = QGroundControl.loggingCategories()
for (var category of logCategories) {
QGroundControl.setCategoryLoggingOn(category, value)
} }
QGroundControl.updateLoggingFilterRules()
// Update model for repeater
categoryRepeater.model = undefined
categoryRepeater.model = QGroundControl.loggingCategories()
} }
Column { QGCCheckBox {
id: categoryColumn text: modelData
spacing: ScreenTools.defaultFontPixelHeight / 2 visible: searchText.text ? text.match(`(${searchText.text})`, "i") : true
checked: QGroundControl.categoryLoggingOn(modelData)
Repeater { onClicked: {
id: categoryRepeater QGroundControl.setCategoryLoggingOn(modelData, checked)
model: QGroundControl.loggingCategories() QGroundControl.updateLoggingFilterRules()
function setAllLogs(value) {
var logCategories = QGroundControl.loggingCategories()
for (var category of logCategories) {
QGroundControl.setCategoryLoggingOn(category, value)
}
QGroundControl.updateLoggingFilterRules()
// Update model for repeater
categoryRepeater.model = undefined
categoryRepeater.model = QGroundControl.loggingCategories()
}
QGCCheckBox {
text: modelData
visible: searchText.text ? text.match(`(${searchText.text})`, "i") : true
checked: QGroundControl.categoryLoggingOn(modelData)
onClicked: {
QGroundControl.setCategoryLoggingOn(modelData, checked)
QGroundControl.updateLoggingFilterRules()
}
}
} }
} }
} }
...@@ -225,7 +209,7 @@ Item { ...@@ -225,7 +209,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
text: qsTr("Set Logging") text: qsTr("Set Logging")
onClicked: mainWindow.showComponentDialog(filtersDialogComponent, qsTr("Turn on logging categories"), mainWindow.showDialogDefaultWidth, StandardButton.Close) onClicked: mainWindow.showPopupDialogFromComponent(filtersPopupDialog)
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment