mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Unify the CuraDrive plugin with the rest of the items in Cura
For instance, the buttons were converted to either primary buttons or secondary buttons. A new CheckBox component was created in Cura in order to reuse it in the future. Contributes to CURA-6005.
This commit is contained in:
parent
e62a570210
commit
b7904d6e05
12 changed files with 115 additions and 137 deletions
61
resources/qml/CheckBox.qml
Normal file
61
resources/qml/CheckBox.qml
Normal file
|
@ -0,0 +1,61 @@
|
|||
// 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.3 as UM
|
||||
|
||||
CheckBox
|
||||
{
|
||||
id: checkbox
|
||||
hoverEnabled: true
|
||||
|
||||
property alias tooltip: tooltip.text
|
||||
|
||||
indicator: Rectangle {
|
||||
implicitWidth: UM.Theme.getSize("checkbox").width
|
||||
implicitHeight: UM.Theme.getSize("checkbox").height
|
||||
x: 0
|
||||
y: Math.round(parent.height / 2 - height / 2)
|
||||
color: UM.Theme.getColor("main_background")
|
||||
radius: UM.Theme.getSize("checkbox_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: checkbox.hovered ? UM.Theme.getColor("checkbox_border_hover") : UM.Theme.getColor("checkbox_border")
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(parent.width / 2.5)
|
||||
height: Math.round(parent.height / 2.5)
|
||||
sourceSize.height: width
|
||||
color: UM.Theme.getColor("checkbox_mark")
|
||||
source: UM.Theme.getIcon("check")
|
||||
opacity: checkbox.checked
|
||||
Behavior on opacity { NumberAnimation { duration: 100; } }
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Label {
|
||||
anchors
|
||||
{
|
||||
left: checkbox.indicator.right
|
||||
leftMargin: UM.Theme.getSize("narrow_margin").width
|
||||
}
|
||||
text: checkbox.text
|
||||
color: UM.Theme.getColor("checkbox_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
ToolTip
|
||||
{
|
||||
id: tooltip
|
||||
text: ""
|
||||
delay: 500
|
||||
visible: text != "" && checkbox.hovered
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue