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

@ -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