mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Add a object list panel instead of the open file button
This commit is contained in:
parent
75b185d462
commit
86c7d3e5ab
7 changed files with 240 additions and 59 deletions
58
resources/qml/ObjectItemButton.qml
Normal file
58
resources/qml/ObjectItemButton.qml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
// 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 UM 1.1 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Button
|
||||
{
|
||||
id: objectItemButton
|
||||
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("action_button").height
|
||||
leftPadding: UM.Theme.getSize("thick_margin").width
|
||||
rightPadding: UM.Theme.getSize("thick_margin").width
|
||||
checkable: true
|
||||
hoverEnabled: true
|
||||
|
||||
contentItem: Item
|
||||
{
|
||||
width: objectItemButton.width - objectItemButton.leftPadding
|
||||
height: UM.Theme.getSize("action_button").height
|
||||
|
||||
Label
|
||||
{
|
||||
id: buttonText
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
right: printerTypes.left
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
text: {
|
||||
print("HOLAAAAAAAA", objectItemButton.text)
|
||||
return objectItemButton.text
|
||||
}
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("medium")
|
||||
visible: text != ""
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
id: backgroundRect
|
||||
color: objectItemButton.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent"
|
||||
radius: UM.Theme.getSize("action_button_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: objectItemButton.checked ? UM.Theme.getColor("primary") : "transparent"
|
||||
}
|
||||
|
||||
onClicked: Cura.SceneController.changeSelection(index)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue