Merge branch 'master' of github.com:Ultimaker/Cura

This commit is contained in:
Mark 2018-02-15 15:49:19 +01:00
commit 17943ceb70
5 changed files with 14 additions and 13 deletions

View File

@ -19,13 +19,14 @@ if MYPY:
# Make color brighter by normalizing it (maximum factor 2.5 brighter) # Make color brighter by normalizing it (maximum factor 2.5 brighter)
def prettier_color(l): # color_list is a list of 4 elements: [r, g, b, a], each element is a float 0..1
maximum = max(l[:3]) def prettier_color(color_list):
maximum = max(color_list[:3])
if maximum > 0: if maximum > 0:
factor = min(1 / maximum, 2.5) factor = min(1 / maximum, 2.5)
else: else:
factor = 1.0 factor = 1.0
return [min(i * factor, 1.0) for i in l] return [min(i * factor, 1.0) for i in color_list]
## A render pass subclass that renders slicable objects with default parameters. ## A render pass subclass that renders slicable objects with default parameters.

View File

@ -11,8 +11,8 @@ import UM 1.1 as UM
UM.Dialog UM.Dialog
{ {
id: base id: base
minimumWidth: Math.round(UM.Theme.getSize("modal_window_minimum").width * 0.75) | 0 minimumWidth: (UM.Theme.getSize("modal_window_minimum").width * 0.75) | 0
minimumHeight: Math.round(UM.Theme.getSize("modal_window_minimum").height * 0.75) | 0 minimumHeight: (UM.Theme.getSize("modal_window_minimum").height * 0.75) | 0
width: minimumWidth width: minimumWidth
height: minimumHeight height: minimumHeight
title: catalog.i18nc("@label", "Changelog") title: catalog.i18nc("@label", "Changelog")

View File

@ -22,8 +22,8 @@ UM.Dialog
Image Image
{ {
id: logo id: logo
width: Math.round(base.minimumWidth * 0.85) | 0 width: (base.minimumWidth * 0.85) | 0
height: Math.round(width * (1/4.25)) | 0 height: (width * (1/4.25)) | 0
source: UM.Theme.getImage("logo") source: UM.Theme.getImage("logo")

View File

@ -160,7 +160,7 @@ UM.ManagementPage
} }
Label Label
{ {
width: Math.round(parent.width * 0.7) | 0 width: (parent.width * 0.7) | 0
text: machineInfo.printerConnected ? machineInfo.connectedPrinter.connectionText : catalog.i18nc("@info:status", "The printer is not connected.") text: machineInfo.printerConnected ? machineInfo.connectedPrinter.connectionText : catalog.i18nc("@info:status", "The printer is not connected.")
visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
@ -171,7 +171,7 @@ UM.ManagementPage
visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId && machineInfo.printerAcceptsCommands visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId && machineInfo.printerAcceptsCommands
} }
Label { Label {
width: Math.round(parent.width * 0.7) | 0 width: (parent.width * 0.7) | 0
text: text:
{ {
if(!machineInfo.printerConnected || !machineInfo.printerAcceptsCommands) { if(!machineInfo.printerConnected || !machineInfo.printerAcceptsCommands) {

View File

@ -51,14 +51,14 @@ Tab
{ {
role: "label" role: "label"
title: catalog.i18nc("@title:column", "Setting") title: catalog.i18nc("@title:column", "Setting")
width: Math.round(parent.width * 0.4) | 0 width: (parent.width * 0.4) | 0
delegate: itemDelegate delegate: itemDelegate
} }
TableViewColumn TableViewColumn
{ {
role: "profile_value" role: "profile_value"
title: catalog.i18nc("@title:column", "Profile") title: catalog.i18nc("@title:column", "Profile")
width: Math.round(parent.width * 0.18) | 0 width: (parent.width * 0.18) | 0
delegate: itemDelegate delegate: itemDelegate
} }
TableViewColumn TableViewColumn
@ -66,14 +66,14 @@ Tab
role: "user_value" role: "user_value"
title: catalog.i18nc("@title:column", "Current"); title: catalog.i18nc("@title:column", "Current");
visible: quality == Cura.MachineManager.globalQualityId visible: quality == Cura.MachineManager.globalQualityId
width: Math.round(parent.width * 0.18) | 0 width: (parent.width * 0.18) | 0
delegate: itemDelegate delegate: itemDelegate
} }
TableViewColumn TableViewColumn
{ {
role: "unit" role: "unit"
title: catalog.i18nc("@title:column", "Unit") title: catalog.i18nc("@title:column", "Unit")
width: Math.round(parent.width * 0.14) | 0 width: (parent.width * 0.14) | 0
delegate: itemDelegate delegate: itemDelegate
} }