1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- // Copyright (C) 2021 Ultimaker B.V.
- import QtQuick 2.10
- import QtQuick.Controls 2.3
- import UM 1.5 as UM
- import Cura 1.6 as Cura
- Cura.RoundedRectangle
- {
- id: base
- width: parent.width
- height: projectImage.height + 2 * UM.Theme.getSize("default_margin").width
- cornerSide: Cura.RoundedRectangle.Direction.All
- border.color: UM.Theme.getColor("lining")
- border.width: UM.Theme.getSize("default_lining").width
- radius: UM.Theme.getSize("default_radius").width
- color: UM.Theme.getColor("main_background")
- signal clicked()
- property alias imageSource: projectImage.source
- property alias projectNameText: displayNameLabel.text
- property alias projectUsernameText: usernameLabel.text
- property alias projectLastUpdatedText: lastUpdatedLabel.text
- property alias cardMouseAreaEnabled: cardMouseArea.enabled
- onVisibleChanged: color = UM.Theme.getColor("main_background")
- MouseArea
- {
- id: cardMouseArea
- anchors.fill: parent
- hoverEnabled: true
- onEntered: base.color = UM.Theme.getColor("action_button_hovered")
- onExited: base.color = UM.Theme.getColor("main_background")
- onClicked: base.clicked()
- }
- Row
- {
- id: projectInformationRow
- width: parent.width
- padding: UM.Theme.getSize("default_margin").width
- spacing: UM.Theme.getSize("default_margin").width
- Image
- {
- id: projectImage
- anchors.verticalCenter: parent.verticalCenter
- width: UM.Theme.getSize("card_icon").width
- height: Math.round(width * 3/4)
- sourceSize.width: width
- sourceSize.height: height
- fillMode: Image.PreserveAspectFit
- mipmap: true
- }
- Column
- {
- id: projectLabelsColumn
- height: projectImage.height
- width: parent.width - x - UM.Theme.getSize("default_margin").width
- anchors.verticalCenter: parent.verticalCenter
- UM.Label
- {
- id: displayNameLabel
- width: parent.width
- height: Math.round(parent.height / 3)
- elide: Text.ElideRight
- font: UM.Theme.getFont("default_bold")
- }
- UM.Label
- {
- id: usernameLabel
- width: parent.width
- height: Math.round(parent.height / 3)
- elide: Text.ElideRight
- color: UM.Theme.getColor("small_button_text")
- }
- UM.Label
- {
- id: lastUpdatedLabel
- width: parent.width
- height: Math.round(parent.height / 3)
- elide: Text.ElideRight
- color: UM.Theme.getColor("small_button_text")
- }
- }
- }
- }
|