QmlDesigner: Fix edit property dialog clipping issue

Task-number: QDS-11539
Change-Id: I32079b3778dc16bace63eeb29770e93f5def79e8
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Shrief Gabr
2024-01-15 09:24:47 +02:00
parent b47e074f62
commit 1085c6fd6b
2 changed files with 16 additions and 10 deletions

View File

@@ -18,7 +18,6 @@ Rectangle {
implicitWidth: 300
implicitHeight: 400
color: StudioTheme.Values.themeControlBackground
ColumnLayout {
@@ -124,7 +123,7 @@ Rectangle {
tableView.model.selectColumn(index)
if (mouse.button === Qt.RightButton) {
let posX = index === root.model.columnCount() - 1 ? parent.width - editProperyDialog.width : 0
let posX = index === root.model.columnCount() - 1 ? parent.width - editPropertyDialog.width : 0
headerMenu.clickedHeaderIndex = index
headerMenu.dialogPos = parent.mapToGlobal(posX, parent.height)
@@ -159,8 +158,8 @@ Rectangle {
StudioControls.MenuItem {
text: qsTr("Edit")
onTriggered: editProperyDialog.openDialog(headerMenu.clickedHeaderIndex,
headerMenu.dialogPos)
onTriggered: editPropertyDialog.openDialog(headerMenu.clickedHeaderIndex,
headerMenu.dialogPos)
}
StudioControls.MenuItem {
@@ -476,10 +475,15 @@ Rectangle {
}
EditPropertyDialog {
id: editProperyDialog
id: editPropertyDialog
model: root.model
}
Connections {
target: root.parent
onIsHorizontalChanged: editPropertyDialog.close()
}
StudioControls.Dialog {
id: deleteColumnDialog

View File

@@ -36,6 +36,11 @@ StudioControls.Dialog {
root.open()
}
onWidthChanged: {
if (visible && x > parent.width)
root.close()
}
onAccepted: {
if (nameTextField.text !== "" && nameTextField.text !== root.__currentName)
root.model.renameColumn(root.__propertyIndex, nameTextField.text)
@@ -50,13 +55,13 @@ StudioControls.Dialog {
Grid {
columns: 2
rows: 2
spacing: 2
rowSpacing: 2
columnSpacing: 25
verticalItemAlignment: Grid.AlignVCenter
Text {
text: qsTr("Name")
color: StudioTheme.Values.themeTextColor
width: 50
verticalAlignment: Text.AlignVCenter
}
@@ -129,14 +134,12 @@ StudioControls.Dialog {
Row {
height: 40
spacing: 5
anchors.right: parent.right
HelperWidgets.Button {
id: editButton
text: qsTr("Apply")
enabled: nameTextField.text !== ""
width: 70
anchors.bottom: parent.bottom
onClicked: root.accept()
@@ -145,7 +148,6 @@ StudioControls.Dialog {
HelperWidgets.Button {
text: qsTr("Cancel")
anchors.bottom: parent.bottom
width: 70
onClicked: root.reject()
}