Skip to content

Commit

Permalink
Add missing scrollbar in variables list, tweak padding
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Aug 27, 2024
1 parent 81b05a7 commit 493bde8
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/qml/VariableEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ ColumnLayout {
spacing: 1
anchors.fill: parent

ScrollBar.vertical: QfScrollBar {
}

model: ExpressionVariableModel {
currentProject: qgisProject
}
Expand Down Expand Up @@ -62,7 +65,7 @@ ColumnLayout {
delegate: Rectangle {
id: rectangle
width: parent ? parent.width : 0
height: line.height
height: line.height + 10
color: "transparent"

property var itemRow: index
Expand All @@ -76,15 +79,15 @@ ColumnLayout {
id: line
anchors {
left: parent.left
leftMargin: 5
leftMargin: 10
right: parent.right
rightMargin: 5
rightMargin: 10
}
spacing: 0

QfSwipeAnimator {
id: variableNameTextAnimator
width: table.width - 10
width: table.width - line.anchors.leftMargin * 2
height: 24
shouldAutoFlick: (width < variableNameText.implicitWidth) && !dragging && !variableNameText.activeFocus
contentImplicitWidth: variableNameText.implicitWidth
Expand All @@ -93,16 +96,18 @@ ColumnLayout {

TextField {
id: variableNameText
topPadding: 0
topPadding: 5
bottomPadding: 0
leftPadding: 1
rightPadding: 1
width: Math.max(table.width - 10, implicitWidth)
width: Math.max(table.width - line.anchors.leftMargin * 2, implicitWidth)
height: variableNameTextAnimator.height
text: VariableName
enabled: VariableScope == ExpressionVariableModel.GlobalScope && VariableEditable
font: Theme.tinyFont
color: enabled ? variableNameText.activeFocus ? Theme.mainColor : Theme.mainTextColor : Theme.mainTextDisabledColor
opacity: enabled ? 1 : 0.45
font.bold: true
font.pointSize: Theme.tinyFont.pointSize
color: variableNameText.activeFocus ? Theme.mainColor : Theme.mainTextColor
horizontalAlignment: TextInput.AlignLeft
verticalAlignment: TextInput.AlignVCenter

Expand All @@ -127,7 +132,7 @@ ColumnLayout {

QfSwipeAnimator {
id: variableValueTextAnimator
width: table.width - 10 - (canDelete ? deleteVariableButton.width : 0)
width: table.width - line.anchors.leftMargin * 2 - (canDelete ? deleteVariableButton.width : 0)
height: 40
shouldAutoFlick: (width < variableValueText.implicitWidth) && !dragging && !variableValueText.activeFocus
contentImplicitWidth: variableValueText.implicitWidth
Expand All @@ -140,7 +145,7 @@ ColumnLayout {
bottomPadding: 10
leftPadding: 1
rightPadding: 1
width: Math.max(table.width - 10 - (canDelete ? deleteVariableButton.width : 0), implicitWidth)
width: Math.max(table.width - line.anchors.leftMargin * 2 - (canDelete ? deleteVariableButton.width : 0), implicitWidth)
text: VariableValue
enabled: VariableEditable
font: Theme.defaultFont
Expand Down

0 comments on commit 493bde8

Please sign in to comment.