mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-17 17:56:02 +08:00
Move what is already there of 'package card' to it's own file.
part of CURA-8561
This commit is contained in:
parent
51434eda1b
commit
e93ecd3699
28
plugins/Marketplace/resources/qml/PackageCard.qml
Normal file
28
plugins/Marketplace/resources/qml/PackageCard.qml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// Copyright (c) 2021 Ultimaker B.V.
|
||||||
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Controls 2.15
|
||||||
|
import UM 1.4 as UM
|
||||||
|
|
||||||
|
Rectangle
|
||||||
|
{
|
||||||
|
property var packageData
|
||||||
|
|
||||||
|
width: parent.width
|
||||||
|
height: UM.Theme.getSize("card").height
|
||||||
|
|
||||||
|
color: UM.Theme.getColor("main_background")
|
||||||
|
radius: UM.Theme.getSize("default_radius").width
|
||||||
|
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: Math.round((parent.height - height) / 2)
|
||||||
|
|
||||||
|
text: packageData.displayName
|
||||||
|
font: UM.Theme.getFont("medium_bold")
|
||||||
|
color: UM.Theme.getColor("text")
|
||||||
|
}
|
||||||
|
}
|
@ -46,24 +46,9 @@ ScrollView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delegate: Rectangle
|
delegate: PackageCard
|
||||||
{
|
{
|
||||||
width: packagesListview.width
|
packageData: model.package
|
||||||
height: UM.Theme.getSize("card").height
|
|
||||||
|
|
||||||
color: UM.Theme.getColor("main_background")
|
|
||||||
radius: UM.Theme.getSize("default_radius").width
|
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Math.round((parent.height - height) / 2)
|
|
||||||
|
|
||||||
text: model.package.displayName
|
|
||||||
font: UM.Theme.getFont("medium_bold")
|
|
||||||
color: UM.Theme.getColor("text")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Wrapper item to add spacing between content and footer.
|
//Wrapper item to add spacing between content and footer.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user