Merge branch 'master' into WIP_feature_infill_slider

This commit is contained in:
ChrisTerBeke 2017-09-18 11:02:30 +02:00
commit e8df185261
13 changed files with 187 additions and 162 deletions

View file

@ -238,22 +238,22 @@ Item {
if(!control.enabled)
return UM.Theme.getColor("action_button_disabled_border");
else if(control.pressed)
return UM.Theme.getColor("action_button_active_border");
return UM.Theme.getColor("print_button_ready_pressed_border");
else if(control.hovered)
return UM.Theme.getColor("action_button_hovered_border");
return UM.Theme.getColor("print_button_ready_hovered_border");
else
return UM.Theme.getColor("action_button_border");
return UM.Theme.getColor("print_button_ready_border");
}
color:
{
if(!control.enabled)
return UM.Theme.getColor("action_button_disabled");
else if(control.pressed)
return UM.Theme.getColor("action_button_active");
return UM.Theme.getColor("print_button_ready_pressed");
else if(control.hovered)
return UM.Theme.getColor("action_button_hovered");
return UM.Theme.getColor("print_button_ready_hovered");
else
return UM.Theme.getColor("action_button");
return UM.Theme.getColor("print_button_ready");
}
Behavior on color { ColorAnimation { duration: 50; } }
@ -268,11 +268,11 @@ Item {
if(!control.enabled)
return UM.Theme.getColor("action_button_disabled_text");
else if(control.pressed)
return UM.Theme.getColor("action_button_active_text");
return UM.Theme.getColor("print_button_ready_text");
else if(control.hovered)
return UM.Theme.getColor("action_button_hovered_text");
return UM.Theme.getColor("print_button_ready_text");
else
return UM.Theme.getColor("action_button_text");
return UM.Theme.getColor("print_button_ready_text");
}
font: UM.Theme.getFont("action_button")
text: control.text;

View file

@ -26,7 +26,6 @@ Rectangle
property bool monitoringPrint: false
property variant printDuration: PrintInformation.currentPrintTime
property variant printDurationPerFeature: PrintInformation.printTimesPerFeature
property variant printMaterialLengths: PrintInformation.materialLengths
property variant printMaterialWeights: PrintInformation.materialWeights
property variant printMaterialCosts: PrintInformation.materialCosts
@ -314,54 +313,53 @@ Rectangle
anchors.bottom: parent.bottom
anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
anchors.bottomMargin: UM.Theme.getSize("sidebar_margin").height
height: childrenRect.height
height: timeDetails.height + timeSpecDescription.height + lengthSpec.height
visible: !monitoringPrint
UM.TooltipArea
Text
{
id: timeSpecPerFeatureTooltipArea
width: timeSpec.width
height: timeSpec.height
id: timeDetails
anchors.left: parent.left
anchors.bottom: timeSpecDescription.top
font: UM.Theme.getFont("large")
color: UM.Theme.getColor("text_subtext")
text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short)
text: {
var order = ["inset_0", "inset_x", "skin", "infill", "support_infill", "support_interface", "support", "travel", "retract", "none"];
var visible_names = {
"inset_0": catalog.i18nc("@tooltip", "Outer Wall"),
"inset_x": catalog.i18nc("@tooltip", "Inner Walls"),
"skin": catalog.i18nc("@tooltip", "Skin"),
"infill": catalog.i18nc("@tooltip", "Infill"),
"support_infill": catalog.i18nc("@tooltip", "Support Infill"),
"support_interface": catalog.i18nc("@tooltip", "Support Interface"),
"support": catalog.i18nc("@tooltip", "Support"),
"travel": catalog.i18nc("@tooltip", "Travel"),
"retract": catalog.i18nc("@tooltip", "Retractions"),
"none": catalog.i18nc("@tooltip", "Other")
};
var result = "";
for(var feature in order)
MouseArea
{
id: infillMouseArea
anchors.fill: parent
hoverEnabled: true
//enabled: base.settingsEnabled
onEntered:
{
feature = order[feature];
if(base.printDurationPerFeature[feature] && base.printDurationPerFeature[feature].totalSeconds > 0)
if(base.printDuration.valid && !base.printDuration.isTotalDurationZero)
{
result += "<br/>" + visible_names[feature] + ": " + base.printDurationPerFeature[feature].getDisplayString(UM.DurationFormat.Short);
// All the time information for the different features is achieved
var print_time = PrintInformation.getFeaturePrintTimes()
// A message is created and displayed when the user hover the time label
var content = catalog.i18nc("@tooltip", "<b>Time information</b>")
for(var feature in print_time)
{
if(!print_time[feature].isTotalDurationZero)
{
content += "<br /><i>" + feature + "</i>: " + print_time[feature].getDisplayString(UM.DurationFormat.Short)
}
}
base.showTooltip(parent, Qt.point(-UM.Theme.getSize("sidebar_margin").width, 0), content)
}
}
result = result.replace(/^\<br\/\>/, ""); // remove newline before first item
return result;
}
Text
{
id: timeSpec
anchors.left: parent.left
anchors.bottom: parent.bottom
font: UM.Theme.getFont("large")
color: UM.Theme.getColor("text_subtext")
text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short)
onExited:
{
base.hideTooltip();
}
}
}
Text
{
id: timeSpecDescription

View file

@ -44,10 +44,8 @@ Item
{
id: resolutionLabel
anchors.top: resolutionSlider.top
anchors.topMargin: UM.Theme.getSize("default_margin").height * 1.2
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
width: UM.Theme.getSize("sidebar").width * .45 - UM.Theme.getSize("sidebar_margin").width
text: catalog.i18nc("@label", "Layer Height")
font: UM.Theme.getFont("default")
@ -57,10 +55,9 @@ Item
Text
{
id: speedLabel
anchors.top: resolutionLabel.bottom
anchors.bottom: resolutionSlider.bottom
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
anchors.topMargin: UM.Theme.getSize("default_margin").height * 1.5
text: catalog.i18nc("@label", "Print Speed")
font: UM.Theme.getFont("default")
@ -70,7 +67,7 @@ Item
Text
{
id: speedLabelSlower
anchors.top: speedLabel.top
anchors.bottom: speedLabel.bottom
anchors.left: resolutionSlider.left
text: catalog.i18nc("@label", "Slower")
@ -82,7 +79,7 @@ Item
Text
{
id: speedLabelFaster
anchors.top: speedLabel.top
anchors.bottom: speedLabel.bottom
anchors.right: resolutionSlider.right
text: catalog.i18nc("@label", "Faster")
@ -95,11 +92,11 @@ Item
{
id: resolutionSlider
anchors.top: parent.top
anchors.left: infillCellRight.left
anchors.right: infillCellRight.right
width: UM.Theme.getSize("sidebar").width * .55
height: UM.Theme.getSize("quality_slider_bar").height * 30
height: UM.Theme.getSize("quality_slider_bar").height * 25
property var model: Cura.ProfilesModel
@ -349,23 +346,12 @@ Item
}
else if (i == total_tick_count - 1)
{
start_x = current_start_x - offset * 2;
start_x = current_start_x - offset * 2.5;
}
ctx.fillText(resolutionSlider.model.getItem(i).layer_height_without_unit, start_x, text_top);
current_start_x += step_size;
}
// print currently selected quality text
if (resolutionSlider.showQualityText && resolutionSlider.currentQualityIndex != undefine)
{
const text_top = parent.height / 2 + tick_height + tick_text_height * 2;
total_tick_count = resolutionSlider.totalTickCount;
const step_size = resolutionSlider.tickStepSize;
current_start_x = (tick_left_right_margin) + step_size * (resolutionSlider.currentQualityIndex - resolutionSlider.fullRangeMin);
ctx.fillStyle = UM.Theme.getColor("quality_slider_text");
ctx.fillText(resolutionSlider.model.getItem(resolutionSlider.currentQualityIndex).name, current_start_x - 6, text_top);
}
}
MouseArea