fix(widgets): add Layout.margins to bordered widgets to prevent border clipping

This commit is contained in:
Lemmy
2026-03-09 22:22:25 -04:00
parent 15decbe053
commit 8450adfda8
9 changed files with 9 additions and 1 deletions
+1
View File
@@ -36,6 +36,7 @@ RowLayout {
Rectangle {
id: box
Layout.margins: Style.borderS
implicitWidth: Math.round(root.baseSize)
implicitHeight: Math.round(root.baseSize)
radius: Style.iRadiusXS
+1
View File
@@ -12,6 +12,7 @@ Rectangle {
signal colorSelected(color color)
Layout.margins: Style.borderS
implicitWidth: 150
implicitHeight: Math.round(Style.baseWidgetSize * 1.1)
+1
View File
@@ -136,6 +136,7 @@ RowLayout {
ComboBox {
id: combo
Layout.margins: Style.borderS
Layout.minimumWidth: Math.round(root.minimumWidth * Style.uiScaleRatio)
Layout.preferredHeight: Math.round(root.preferredHeight * Style.uiScaleRatio)
implicitWidth: Layout.minimumWidth
+1
View File
@@ -10,6 +10,7 @@ Rectangle {
signal tokenClicked(string token)
Layout.margins: Style.borderS
color: Color.mSurface
border.color: Color.mOutline
border.width: Style.borderS
+1
View File
@@ -168,6 +168,7 @@ RowLayout {
ComboBox {
id: combo
Layout.margins: Style.borderS
Layout.minimumWidth: Math.round(root.minimumWidth * Style.uiScaleRatio)
Layout.preferredHeight: Math.round(root.preferredHeight * Style.uiScaleRatio)
implicitWidth: Layout.minimumWidth
+1
View File
@@ -91,6 +91,7 @@ RowLayout {
// Main spinbox container
Rectangle {
id: spinBoxContainer
Layout.margins: Style.borderS
implicitWidth: 120
implicitHeight: Math.round((root.baseSize - 4) / 2) * 2
radius: Style.iRadiusS
+1
View File
@@ -66,6 +66,7 @@ Rectangle {
}
// Styling
Layout.margins: Style.borderS
implicitWidth: tabRow.implicitWidth + (margins * 2)
implicitHeight: tabHeight + (margins * 2)
color: Color.mSurfaceVariant
+1 -1
View File
@@ -56,7 +56,7 @@ ColumnLayout {
Layout.fillWidth: true
Layout.minimumWidth: root.minimumInputWidth
Layout.margins: Math.ceil(Style.borderS)
Layout.margins: Style.borderS
implicitHeight: Style.baseWidgetSize * 1.1 * Style.uiScaleRatio
// This is important - makes the control accept focus
+1
View File
@@ -45,6 +45,7 @@ RowLayout {
id: switcher
Layout.alignment: Qt.AlignVCenter
Layout.margins: Style.borderS
implicitWidth: Math.round(root.baseSize * .85) * 2
implicitHeight: Math.round(root.baseSize * .5) * 2