mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 21:44:01 -06:00
Updated header of the settingbar
CURA-5785
This commit is contained in:
parent
987ff1737f
commit
ca63733827
2 changed files with 141 additions and 13 deletions
60
resources/qml/IconWithText.qml
Normal file
60
resources/qml/IconWithText.qml
Normal file
|
@ -0,0 +1,60 @@
|
|||
// 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.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
// Reusable component that holds an (re-colorable) icon on the left with some text on the right
|
||||
Item
|
||||
{
|
||||
property alias iconColor: icon.color
|
||||
property alias source: icon.source
|
||||
property alias text: label.text
|
||||
|
||||
implicitWidth: icon.width + 100
|
||||
implicitHeight: icon.height
|
||||
|
||||
Component.onCompleted: print(label.contentWidth)
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: icon
|
||||
width: UM.Theme.getSize("section_icon").width
|
||||
height: UM.Theme.getSize("section_icon").height
|
||||
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: "black"
|
||||
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: label
|
||||
height: contentHeight
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
renderType: Text.NativeRendering
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors
|
||||
{
|
||||
left: icon.right
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
rightMargin: 0
|
||||
margins: UM.Theme.getSize("narrow_margin").width
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,12 +18,19 @@ Cura.ExpandableComponent
|
|||
property int currentModeIndex: -1
|
||||
property bool hideSettings: PrintInformation.preSliced
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "cura"}
|
||||
property string enabledText: catalog.i18nc("@label", "On")
|
||||
property string disabledText: catalog.i18nc("@label", "Off")
|
||||
|
||||
// This widget doesn't show tooltips by itself. Instead it emits signals so others can do something with it.
|
||||
signal showTooltip(Item item, point location, string text)
|
||||
signal hideTooltip()
|
||||
|
||||
UM.I18nCatalog
|
||||
{
|
||||
id: catalog
|
||||
name: "cura"
|
||||
}
|
||||
|
||||
Timer
|
||||
{
|
||||
id: tooltipDelayTimer
|
||||
|
@ -32,18 +39,82 @@ Cura.ExpandableComponent
|
|||
property var item
|
||||
property string text
|
||||
|
||||
onTriggered:
|
||||
onTriggered: base.showTooltip(base, {x: 0, y: item.y}, text)
|
||||
}
|
||||
|
||||
onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex)
|
||||
|
||||
headerItem: Row
|
||||
{
|
||||
anchors.fill: parent
|
||||
|
||||
IconWithText
|
||||
{
|
||||
base.showTooltip(base, {x: 0, y: item.y}, text);
|
||||
source: UM.Theme.getIcon("category_layer_height")
|
||||
text: Cura.MachineManager.activeQualityOrQualityChangesName + " " + layerHeight.properties.value + "mm"
|
||||
width: parent.width / 4
|
||||
height: parent.height
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: layerHeight
|
||||
containerStackId: Cura.MachineManager.activeStackId
|
||||
key: "layer_height"
|
||||
watchedProperties: ["value"]
|
||||
}
|
||||
}
|
||||
|
||||
IconWithText
|
||||
{
|
||||
source: UM.Theme.getIcon("category_infill")
|
||||
text: parseInt(infillDensity.properties.value) + "%"
|
||||
width: parent.width / 4
|
||||
height: parent.height
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: infillDensity
|
||||
containerStackId: Cura.MachineManager.activeStackId
|
||||
key: "infill_sparse_density"
|
||||
watchedProperties: ["value"]
|
||||
}
|
||||
}
|
||||
|
||||
IconWithText
|
||||
{
|
||||
source: UM.Theme.getIcon("category_support")
|
||||
text: supportEnabled.properties.value == "True" ? enabledText : disabledText
|
||||
width: parent.width / 4
|
||||
height: parent.height
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: supportEnabled
|
||||
containerStack: Cura.MachineManager.activeMachine
|
||||
key: "support_enable"
|
||||
watchedProperties: ["value"]
|
||||
}
|
||||
}
|
||||
|
||||
IconWithText
|
||||
{
|
||||
source: UM.Theme.getIcon("category_adhesion")
|
||||
text: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none" ? enabledText : disabledText
|
||||
width: parent.width / 4
|
||||
height: parent.height
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: platformAdhesionType
|
||||
containerStack: Cura.MachineManager.activeMachine
|
||||
key: "adhesion_type"
|
||||
watchedProperties: [ "value"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onCurrentModeIndexChanged:
|
||||
{
|
||||
UM.Preferences.setValue("cura/active_mode", currentModeIndex);
|
||||
}
|
||||
|
||||
headerItem: Label
|
||||
/*Label
|
||||
{
|
||||
id: settingsModeLabel
|
||||
text: !hideSettings ? catalog.i18nc("@label:listbox", "Print Setup") : catalog.i18nc("@label:listbox", "Print Setup disabled\nG-code files cannot be modified")
|
||||
|
@ -51,16 +122,13 @@ Cura.ExpandableComponent
|
|||
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
top: parent.top
|
||||
margins: UM.Theme.getSize("thick_margin").width
|
||||
fill: parent
|
||||
}
|
||||
|
||||
width: Math.round(parent.width * 0.45)
|
||||
height: contentHeight
|
||||
font: UM.Theme.getFont("large")
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
}*/
|
||||
|
||||
popupItem: Item
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue