simple fixes of view

This commit is contained in:
Andrei Yankovich 2020-10-05 17:50:42 +03:00
parent 4612b8f0a6
commit b4b9368f41
2 changed files with 20 additions and 6 deletions

View File

@ -6,7 +6,9 @@ import QtQuick.Controls.Universal 2.15
Item { Item {
id: root id: root
property string soucre: "" property string source: ""
property alias imagesource: sourceImg
property string text: "" property string text: ""
property bool hover: false property bool hover: false
property bool presed: false property bool presed: false
@ -17,11 +19,21 @@ Item {
property color textColor: Material.color(Material.Grey) property color textColor: Material.color(Material.Grey)
property color background: colorPicker.pick(soucre) property color background: colorPicker.pick(source)
property color borderColor: "#00000000" property color borderColor: "#00000000"
signal clicked(var mouse); signal clicked(var mouse);
Connections {
target: sourceImg
function onStatusChanged(status) {
if (status === Image.Ready) {
root.background = colorPicker.pick(source);
}
}
}
Item { Item {
id: privateData id: privateData
property int rootMinSize: Math.min(root.height, root.width) property int rootMinSize: Math.min(root.height, root.width)
@ -62,15 +74,17 @@ Item {
ColumnLayout { ColumnLayout {
Image { Image {
id: source id: sourceImg
source: root.soucre source: root.source
clip: true clip: true
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectCrop
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Layout.margins: 5 Layout.margins: 5
} }
Label { Label {

View File

@ -53,7 +53,7 @@ ViewPortPage {
} }
GradientStop { GradientStop {
position: 1.00; position: 0.70;
color: "#00" + baseColor; color: "#00" + baseColor;
} }
} }