mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 13:47:51 -06:00
Make some minor improvements to the qml
This implements some of the best practices that weren't used yet for the QML CURA-6005
This commit is contained in:
parent
49076a7103
commit
0edc3f2680
6 changed files with 16 additions and 69 deletions
|
@ -11,7 +11,7 @@ ColumnLayout
|
||||||
{
|
{
|
||||||
id: backupDetails
|
id: backupDetails
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: 10 * screenScaleFactor
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
property var backupDetailsData
|
property var backupDetailsData
|
||||||
|
|
||||||
// Cura version
|
// Cura version
|
||||||
|
|
|
@ -13,9 +13,9 @@ RowLayout
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 40 * screenScaleFactor
|
height: 40 * screenScaleFactor
|
||||||
|
|
||||||
property var iconSource
|
property alias iconSource: icon.source
|
||||||
property var label
|
property alias label: detailName.text
|
||||||
property var value
|
property alias value: detailValue.text
|
||||||
|
|
||||||
// Spacing.
|
// Spacing.
|
||||||
Item
|
Item
|
||||||
|
@ -23,16 +23,18 @@ RowLayout
|
||||||
width: 40 * screenScaleFactor
|
width: 40 * screenScaleFactor
|
||||||
}
|
}
|
||||||
|
|
||||||
Icon
|
UM.RecolorImage
|
||||||
{
|
{
|
||||||
|
id: icon
|
||||||
width: 18 * screenScaleFactor
|
width: 18 * screenScaleFactor
|
||||||
iconSource: detailsRow.iconSource
|
height: width
|
||||||
|
source: ""
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: detailsRow.label
|
id: detailName
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
Layout.minimumWidth: 50 * screenScaleFactor
|
Layout.minimumWidth: 50 * screenScaleFactor
|
||||||
|
@ -43,7 +45,7 @@ RowLayout
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: detailsRow.value
|
id: detailValue
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
Layout.minimumWidth: 50 * screenScaleFactor
|
Layout.minimumWidth: 50 * screenScaleFactor
|
||||||
|
|
|
@ -1,58 +0,0 @@
|
||||||
// Copyright (c) 2018 Ultimaker B.V.
|
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
|
||||||
|
|
||||||
import QtQuick 2.7
|
|
||||||
import QtQuick.Controls 2.1
|
|
||||||
import QtGraphicalEffects 1.0
|
|
||||||
|
|
||||||
Item
|
|
||||||
{
|
|
||||||
id: icon
|
|
||||||
width: parent.height
|
|
||||||
height: width
|
|
||||||
property var color: "transparent"
|
|
||||||
property var iconSource
|
|
||||||
property bool animated: false
|
|
||||||
|
|
||||||
Image
|
|
||||||
{
|
|
||||||
id: iconImage
|
|
||||||
width: parent.height
|
|
||||||
height: width
|
|
||||||
smooth: true
|
|
||||||
source: icon.iconSource
|
|
||||||
sourceSize.width: width
|
|
||||||
sourceSize.height: height
|
|
||||||
antialiasing: true
|
|
||||||
visible: !icon.animated
|
|
||||||
}
|
|
||||||
|
|
||||||
AnimatedImage
|
|
||||||
{
|
|
||||||
id: animatedIconImage
|
|
||||||
width: parent.height
|
|
||||||
height: width
|
|
||||||
smooth: true
|
|
||||||
antialiasing: true
|
|
||||||
source: "../images/loading.gif"
|
|
||||||
visible: icon.animated
|
|
||||||
}
|
|
||||||
|
|
||||||
ColorOverlay
|
|
||||||
{
|
|
||||||
anchors.fill: iconImage
|
|
||||||
source: iconImage
|
|
||||||
color: icon.color
|
|
||||||
antialiasing: true
|
|
||||||
visible: !icon.animated
|
|
||||||
}
|
|
||||||
|
|
||||||
ColorOverlay
|
|
||||||
{
|
|
||||||
anchors.fill: animatedIconImage
|
|
||||||
source: animatedIconImage
|
|
||||||
color: icon.color
|
|
||||||
antialiasing: true
|
|
||||||
visible: icon.animated
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -27,7 +27,7 @@ Window
|
||||||
UM.I18nCatalog
|
UM.I18nCatalog
|
||||||
{
|
{
|
||||||
id: catalog
|
id: catalog
|
||||||
name: "cura_drive"
|
name: "cura"
|
||||||
}
|
}
|
||||||
|
|
||||||
WelcomePage
|
WelcomePage
|
||||||
|
|
|
@ -18,7 +18,7 @@ Item
|
||||||
|
|
||||||
ColumnLayout
|
ColumnLayout
|
||||||
{
|
{
|
||||||
spacing: UM.Theme.getSize("default_margin").height * 2
|
spacing: UM.Theme.getSize("wide_margin").height
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,14 @@ import Cura 1.1 as Cura
|
||||||
|
|
||||||
import "../components"
|
import "../components"
|
||||||
|
|
||||||
|
|
||||||
Column
|
Column
|
||||||
{
|
{
|
||||||
id: welcomePage
|
id: welcomePage
|
||||||
spacing: UM.Theme.getSize("wide_margin").height
|
spacing: UM.Theme.getSize("wide_margin").height
|
||||||
width: parent.width
|
width: parent.width
|
||||||
topPadding: 150 * screenScaleFactor
|
height: childrenRect.height
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
Image
|
Image
|
||||||
{
|
{
|
||||||
|
@ -51,3 +53,4 @@ Column
|
||||||
fixedWidthMode: true
|
fixedWidthMode: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue