fix(StatusImageCropPanel) adjust Image Crop component (#839)

- update StatusSlider handle and background positioning

Needed for https://github.com/status-im/status-desktop/issues/6835
This commit is contained in:
PavelS 2022-08-09 09:54:19 +03:00 committed by GitHub
parent e5ddf28f02
commit 4282cc10c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View File

@ -3,6 +3,7 @@ import QtQuick.Layouts 1.14
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
import StatusQ.Core.Theme 0.1
/*!
\qmltype StatusImageCropPanel
@ -127,6 +128,7 @@ Item {
id: mainLayout
anchors.fill: parent
spacing: 1
Item {
id: cropSpaceItem
@ -243,18 +245,20 @@ Item {
RowLayout {
visible: root.interactive
spacing: 10
StatusIcon {
icon: "remove-circle"
color: Theme.palette.baseColor1
Layout.alignment: Qt.AlignVCenter
Layout.preferredWidth: 20
Layout.preferredHeight: 20
Layout.preferredWidth: 24
Layout.preferredHeight: 24
}
StatusSlider {
Layout.fillWidth: true
Layout.topMargin: 20
Layout.bottomMargin: 20
Layout.topMargin: 10
Layout.bottomMargin: 10
Layout.alignment: Qt.AlignVCenter
enabled: root.interactive
@ -267,10 +271,11 @@ Item {
}
StatusIcon {
icon: "add-circle"
color: Theme.palette.baseColor1
Layout.alignment: Qt.AlignVCenter
Layout.preferredWidth: 20
Layout.preferredHeight: 20
Layout.preferredWidth: 24
Layout.preferredHeight: 24
}
}
}

View File

@ -25,7 +25,7 @@ Slider {
implicitHeight: Math.max(handle.implicitHeight,
background.implicitHeight + decorationContainer.height)
leftPadding: 0
horizontalPadding: 0
background: Rectangle {
id: bgRect
@ -55,7 +55,7 @@ Slider {
} // background
handle: Rectangle {
x: root.leftPadding + root.visualPosition * (root.availableWidth - width / 2)
x: root.leftPadding + root.visualPosition * (root.availableWidth - width)
anchors.verticalCenter: bgRect.verticalCenter
color: root.handleColor
implicitWidth: root.handleSize