Merge pull request #4942 from Ultimaker/place_print_info_back

Place print info back
This commit is contained in:
alekseisasin 2018-12-07 13:39:12 +01:00 committed by GitHub
commit c232107e95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 118 additions and 109 deletions

View file

@ -4,19 +4,19 @@
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1
import QtQuick.Window 2.2
import UM 1.2 as UM
import Cura 1.0 as Cura
Button
{
id: modelCheckerButton
UM.I18nCatalog{id: catalog; name: "cura"}
UM.I18nCatalog
{
id: catalog
name: "cura"
}
visible: manager.hasWarnings
tooltip: catalog.i18nc("@info:tooltip", "Some things could be problematic in this print. Click to see tips for adjustment.")
@ -25,6 +25,8 @@ Button
width: UM.Theme.getSize("save_button_specs_icons").width
height: UM.Theme.getSize("save_button_specs_icons").height
anchors.verticalCenter: parent ? parent.verticalCenter : undefined
style: ButtonStyle
{
background: Item

View file

@ -192,16 +192,6 @@ UM.MainWindow
}
}
JobSpecs
{
id: jobSpecs
anchors
{
bottom: parent.bottom
bottomMargin: UM.Theme.getSize("default_margin").height
}
}
Toolbar
{
// The toolbar is the left bar that is populated by all the tools (which are dynamicly populated by
@ -231,6 +221,19 @@ UM.MainWindow
}
}
JobSpecs
{
id: jobSpecs
visible: CuraApplication.platformActivity
anchors
{
left: parent.left
bottom: viewOrientationControls.top
margins: UM.Theme.getSize("default_margin").width
bottomMargin: UM.Theme.getSize("thin_margin").width
}
}
ViewOrientationControls
{
id: viewOrientationControls
@ -238,9 +241,8 @@ UM.MainWindow
anchors
{
left: parent.left
margins: UM.Theme.getSize("default_margin").width
bottom: parent.bottom
margins: UM.Theme.getSize("default_margin").width
}
}

View file

@ -111,7 +111,7 @@ Item
visible: source != "" && base.enabled
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
color: UM.Theme.getColor("text")
color: UM.Theme.getColor("small_button_text")
}
MouseArea

View file

@ -131,7 +131,7 @@ Item
visible: source != "" && base.enabled
width: UM.Theme.getSize("standard_arrow").width
height: UM.Theme.getSize("standard_arrow").height
color: UM.Theme.getColor("text")
color: UM.Theme.getColor("small_button_text")
}
MouseArea

View file

@ -9,118 +9,110 @@ import QtQuick.Layouts 1.1
import UM 1.1 as UM
import Cura 1.0 as Cura
Item {
Item
{
id: base
property bool activity: CuraApplication.platformActivity
property string fileBaseName: PrintInformation.baseName
UM.I18nCatalog { id: catalog; name: "cura"}
UM.I18nCatalog
{
id: catalog
name: "cura"
}
width: childrenRect.width
height: childrenRect.height
onActivityChanged: {
if (activity == false) {
onActivityChanged:
{
if (!activity)
{
//When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't set an empty string as a jobName (which is later used for saving the file)
PrintInformation.baseName = ''
PrintInformation.baseName = ""
}
}
Rectangle
Item
{
id: jobNameRow
anchors.top: parent.top
anchors.right: parent.right
anchors.left: parent.left
height: UM.Theme.getSize("jobspecs_line").height
visible: base.activity
Item
Button
{
width: parent.width
height: parent.height
id: printJobPencilIcon
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.getSize("save_button_specs_icons").width
height: UM.Theme.getSize("save_button_specs_icons").height
Button
onClicked:
{
id: printJobPencilIcon
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
width: UM.Theme.getSize("save_button_specs_icons").width
height: UM.Theme.getSize("save_button_specs_icons").height
onClicked:
{
printJobTextfield.selectAll();
printJobTextfield.focus = true;
}
style: ButtonStyle
{
background: Item
{
UM.RecolorImage
{
width: UM.Theme.getSize("save_button_specs_icons").width;
height: UM.Theme.getSize("save_button_specs_icons").height;
sourceSize.height: width;
color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene");
source: UM.Theme.getIcon("pencil");
}
}
}
printJobTextfield.selectAll()
printJobTextfield.focus = true
}
TextField
style: ButtonStyle
{
id: printJobTextfield
anchors.right: printJobPencilIcon.left
anchors.rightMargin: Math.round(UM.Theme.getSize("default_margin").width / 2)
height: UM.Theme.getSize("jobspecs_line").height
width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50)
maximumLength: 120
property int unremovableSpacing: 5
text: PrintInformation.jobName
horizontalAlignment: TextInput.AlignRight
onEditingFinished: {
var new_name = text == "" ? catalog.i18nc("@text Print job name", "Untitled") : text;
PrintInformation.setJobName(new_name, true);
printJobTextfield.focus = false;
}
validator: RegExpValidator {
regExp: /^[^\\\/\*\?\|\[\]]*$/
}
style: TextFieldStyle{
textColor: UM.Theme.getColor("text_scene");
font: UM.Theme.getFont("default_bold");
background: Rectangle {
opacity: 0
border.width: 0
background: Item
{
UM.RecolorImage
{
width: UM.Theme.getSize("save_button_specs_icons").width
height: UM.Theme.getSize("save_button_specs_icons").height
sourceSize.width: width
sourceSize.height: width
color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene")
source: UM.Theme.getIcon("pencil")
}
}
}
}
}
Row {
id: additionalComponentsRow
anchors.top: jobNameRow.bottom
anchors.right: parent.right
TextField
{
id: printJobTextfield
anchors.left: printJobPencilIcon.right
anchors.leftMargin: UM.Theme.getSize("narrow_margin").width
height: UM.Theme.getSize("jobspecs_line").height
width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50)
maximumLength: 120
text: PrintInformation.jobName
horizontalAlignment: TextInput.AlignLeft
onEditingFinished:
{
var new_name = text == "" ? catalog.i18nc("@text Print job name", "Untitled") : text
PrintInformation.setJobName(new_name, true)
printJobTextfield.focus = false
}
validator: RegExpValidator {
regExp: /^[^\\\/\*\?\|\[\]]*$/
}
style: TextFieldStyle
{
textColor: UM.Theme.getColor("text_scene")
font: UM.Theme.getFont("default_bold")
background: Rectangle
{
opacity: 0
border.width: 0
}
}
}
}
Label
{
id: boundingSpec
anchors.top: jobNameRow.bottom
anchors.right: additionalComponentsRow.left
anchors.rightMargin:
{
if (additionalComponentsRow.width > 0)
{
return UM.Theme.getSize("default_margin").width
}
else
{
return 0;
}
}
anchors.left: parent.left
height: UM.Theme.getSize("jobspecs_line").height
verticalAlignment: Text.AlignVCenter
font: UM.Theme.getFont("default_bold")
@ -128,21 +120,34 @@ Item {
text: CuraApplication.getSceneBoundingBoxString
}
Component.onCompleted: {
Row
{
id: additionalComponentsRow
anchors.top: boundingSpec.top
anchors.bottom: boundingSpec.bottom
anchors.left: boundingSpec.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width
}
Component.onCompleted:
{
base.addAdditionalComponents("jobSpecsButton")
}
Connections {
Connections
{
target: CuraApplication
onAdditionalComponentsChanged: base.addAdditionalComponents("jobSpecsButton")
}
function addAdditionalComponents (areaId) {
if(areaId == "jobSpecsButton") {
for (var component in CuraApplication.additionalComponents["jobSpecsButton"]) {
function addAdditionalComponents(areaId)
{
if (areaId == "jobSpecsButton")
{
for (var component in CuraApplication.additionalComponents["jobSpecsButton"])
{
CuraApplication.additionalComponents["jobSpecsButton"][component].parent = additionalComponentsRow
}
}
}
}

View file

@ -124,8 +124,8 @@
"text_subtext": [0, 0, 0, 255],
"text_medium": [128, 128, 128, 255],
"text_emphasis": [255, 255, 255, 255],
"text_scene": [31, 36, 39, 255],
"text_scene_hover": [70, 84, 113, 255],
"text_scene": [102, 102, 102, 255],
"text_scene_hover": [123, 123, 113, 255],
"error": [255, 140, 0, 255],
"warning": [245, 166, 35, 255],
@ -145,10 +145,10 @@
"button_text_active_hover": [255, 255, 255, 255],
"small_button": [0, 0, 0, 0],
"small_button_hover": [8, 7, 63, 255],
"small_button_active": [8, 7, 63, 255],
"small_button_active_hover": [8, 7, 63, 255],
"small_button_text": [171, 171, 191, 255],
"small_button_hover": [102, 102, 102, 255],
"small_button_active": [10, 8, 80, 255],
"small_button_active_hover": [10, 8, 80, 255],
"small_button_text": [102, 102, 102, 255],
"small_button_text_hover": [255, 255, 255, 255],
"small_button_text_active": [255, 255, 255, 255],
"small_button_text_active_hover": [255, 255, 255, 255],