diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.qml b/plugins/MachineSettingsAction/MachineSettingsAction.qml index a905008932..016748b1bb 100644 --- a/plugins/MachineSettingsAction/MachineSettingsAction.qml +++ b/plugins/MachineSettingsAction/MachineSettingsAction.qml @@ -70,8 +70,8 @@ Cura.MachineAction anchors.top: pageTitle.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height - property real columnWidth: Math.floor((width - 3 * UM.Theme.getSize("default_margin").width) / 2) - property real labelColumnWidth: Math.floor(columnWidth / 2) + property real columnWidth: Math.round((width - 3 * UM.Theme.getSize("default_margin").width) / 2) + property real labelColumnWidth: Math.round(columnWidth / 2) Tab { diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index eb492d8de2..03a2ce1bf4 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -237,7 +237,7 @@ Item { Button { - width: Math.floor(UM.Theme.getSize("setting").height / 2) + width: Math.round(UM.Theme.getSize("setting").height / 2) height: UM.Theme.getSize("setting").height onClicked: addedSettingsModel.setVisible(model.key, false) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml index d64d60a04a..489ea6dcfb 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.qml +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.qml @@ -25,8 +25,8 @@ UM.Dialog { UM.I18nCatalog{id: catalog; name:"cura"} id: base - property int columnWidth: Math.floor((base.width / 2) - UM.Theme.getSize("default_margin").width) - property int textMargin: Math.floor(UM.Theme.getSize("default_margin").width / 2) + property int columnWidth: Math.round((base.width / 2) - UM.Theme.getSize("default_margin").width) + property int textMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) property string activeScriptName SystemPalette{ id: palette } SystemPalette{ id: disabledPalette; colorGroup: SystemPalette.Disabled } @@ -129,8 +129,8 @@ UM.Dialog { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.floor(control.width / 2.7) - height: Math.floor(control.height / 2.7) + width: Math.round(control.width / 2.7) + height: Math.round(control.height / 2.7) sourceSize.width: width sourceSize.height: width color: palette.text @@ -164,8 +164,8 @@ UM.Dialog { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.floor(control.width / 2.5) - height: Math.floor(control.height / 2.5) + width: Math.round(control.width / 2.5) + height: Math.round(control.height / 2.5) sourceSize.width: width sourceSize.height: width color: control.enabled ? palette.text : disabledPalette.text @@ -199,8 +199,8 @@ UM.Dialog { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.floor(control.width / 2.5) - height: Math.floor(control.height / 2.5) + width: Math.round(control.width / 2.5) + height: Math.round(control.height / 2.5) sourceSize.width: width sourceSize.height: width color: control.enabled ? palette.text : disabledPalette.text @@ -478,15 +478,15 @@ UM.Dialog control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") Behavior on color { ColorAnimation { duration: 50; } } anchors.left: parent.left - anchors.leftMargin: Math.floor(UM.Theme.getSize("save_button_text_margin").width / 2); + anchors.leftMargin: Math.round(UM.Theme.getSize("save_button_text_margin").width / 2); width: parent.height height: parent.height UM.RecolorImage { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.floor(parent.width / 2) - height: Math.floor(parent.height / 2) + width: Math.round(parent.width / 2) + height: Math.round(parent.height / 2) sourceSize.width: width sourceSize.height: height color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") : diff --git a/plugins/SimulationView/SimulationSliderLabel.qml b/plugins/SimulationView/SimulationSliderLabel.qml index 1c8daf867f..6f7749df63 100644 --- a/plugins/SimulationView/SimulationSliderLabel.qml +++ b/plugins/SimulationView/SimulationSliderLabel.qml @@ -49,7 +49,7 @@ UM.PointingRectangle { anchors { left: parent.left - leftMargin: Math.floor(UM.Theme.getSize("default_margin").width / 2) + leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) verticalCenter: parent.verticalCenter } @@ -91,7 +91,7 @@ UM.PointingRectangle { anchors { left: parent.right - leftMargin: Math.floor(UM.Theme.getSize("default_margin").width / 2) + leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) verticalCenter: parent.verticalCenter } diff --git a/plugins/SimulationView/SimulationView.qml b/plugins/SimulationView/SimulationView.qml index 6d1a11d8c8..6aad413f9b 100644 --- a/plugins/SimulationView/SimulationView.qml +++ b/plugins/SimulationView/SimulationView.qml @@ -61,7 +61,7 @@ Item Button { id: collapseButton anchors.top: parent.top - anchors.topMargin: Math.floor(UM.Theme.getSize("default_margin").height + (UM.Theme.getSize("layerview_row").height - UM.Theme.getSize("default_margin").height) / 2) + anchors.topMargin: Math.round(UM.Theme.getSize("default_margin").height + (UM.Theme.getSize("layerview_row").height - UM.Theme.getSize("default_margin").height) / 2) anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("default_margin").width @@ -193,7 +193,7 @@ Item Item { - height: Math.floor(UM.Theme.getSize("default_margin").width / 2) + height: Math.round(UM.Theme.getSize("default_margin").width / 2) width: width } @@ -231,7 +231,7 @@ Item width: UM.Theme.getSize("layerview_legend_size").width height: UM.Theme.getSize("layerview_legend_size").height color: model.color - radius: Math.floor(width / 2) + radius: Math.round(width / 2) border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") visible: !viewSettings.show_legend & !viewSettings.show_gradient @@ -249,7 +249,7 @@ Item anchors.verticalCenter: parent.verticalCenter anchors.left: extrudersModelCheckBox.left; anchors.right: extrudersModelCheckBox.right; - anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.floor(UM.Theme.getSize("default_margin").width/2) + anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width/2) anchors.rightMargin: UM.Theme.getSize("default_margin").width * 2 } } @@ -316,7 +316,7 @@ Item anchors.verticalCenter: parent.verticalCenter anchors.left: legendModelCheckBox.left; anchors.right: legendModelCheckBox.right; - anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.floor(UM.Theme.getSize("default_margin").width/2) + anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width/2) anchors.rightMargin: UM.Theme.getSize("default_margin").width * 2 } } @@ -461,7 +461,7 @@ Item visible: viewSettings.show_feedrate_gradient anchors.left: parent.right height: parent.width - width: Math.floor(UM.Theme.getSize("layerview_row").height * 1.5) + width: Math.round(UM.Theme.getSize("layerview_row").height * 1.5) border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") transform: Rotation {origin.x: 0; origin.y: 0; angle: 90} @@ -492,7 +492,7 @@ Item visible: viewSettings.show_thickness_gradient anchors.left: parent.right height: parent.width - width: Math.floor(UM.Theme.getSize("layerview_row").height * 1.5) + width: Math.round(UM.Theme.getSize("layerview_row").height * 1.5) border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") transform: Rotation {origin.x: 0; origin.y: 0; angle: 90} diff --git a/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml index cb574384f9..2b872cbe9c 100644 --- a/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml @@ -114,7 +114,7 @@ Cura.MachineAction Column { - width: Math.floor(parent.width * 0.5) + width: Math.round(parent.width * 0.5) spacing: UM.Theme.getSize("default_margin").height ScrollView @@ -198,7 +198,7 @@ Cura.MachineAction } Column { - width: Math.floor(parent.width * 0.5) + width: Math.round(parent.width * 0.5) visible: base.selectedPrinter ? true : false spacing: UM.Theme.getSize("default_margin").height Label @@ -216,13 +216,13 @@ Cura.MachineAction columns: 2 Label { - width: Math.floor(parent.width * 0.5) + width: Math.round(parent.width * 0.5) wrapMode: Text.WordWrap text: catalog.i18nc("@label", "Type") } Label { - width: Math.floor(parent.width * 0.5) + width: Math.round(parent.width * 0.5) wrapMode: Text.WordWrap text: { @@ -247,25 +247,25 @@ Cura.MachineAction } Label { - width: Math.floor(parent.width * 0.5) + width: Math.round(parent.width * 0.5) wrapMode: Text.WordWrap text: catalog.i18nc("@label", "Firmware version") } Label { - width: Math.floor(parent.width * 0.5) + width: Math.round(parent.width * 0.5) wrapMode: Text.WordWrap text: base.selectedPrinter ? base.selectedPrinter.firmwareVersion : "" } Label { - width: Math.floor(parent.width * 0.5) + width: Math.round(parent.width * 0.5) wrapMode: Text.WordWrap text: catalog.i18nc("@label", "Address") } Label { - width: Math.floor(parent.width * 0.5) + width: Math.round(parent.width * 0.5) wrapMode: Text.WordWrap text: base.selectedPrinter ? base.selectedPrinter.ipAddress : "" } diff --git a/plugins/UM3NetworkPrinting/MonitorItem.qml b/plugins/UM3NetworkPrinting/MonitorItem.qml index f69df41dd4..505036f60d 100644 --- a/plugins/UM3NetworkPrinting/MonitorItem.qml +++ b/plugins/UM3NetworkPrinting/MonitorItem.qml @@ -17,10 +17,10 @@ Component } return (sourceSize.width / sourceSize.height) > (maximumWidth / maximumHeight); } - property real _width: Math.floor(Math.min(maximumWidth, sourceSize.width)) - property real _height: Math.floor(Math.min(maximumHeight, sourceSize.height)) - width: proportionalHeight ? _width : Math.floor(sourceSize.width * _height / sourceSize.height) - height: !proportionalHeight ? _height : Math.floor(sourceSize.height * _width / sourceSize.width) + property real _width: Math.round(Math.min(maximumWidth, sourceSize.width)) + property real _height: Math.round(Math.min(maximumHeight, sourceSize.height)) + width: proportionalHeight ? _width : Math.round(sourceSize.width * _height / sourceSize.height) + height: !proportionalHeight ? _height : Math.round(sourceSize.height * _width / sourceSize.width) anchors.horizontalCenter: parent.horizontalCenter onVisibleChanged: diff --git a/plugins/UM3NetworkPrinting/PrintCoreConfiguration.qml b/plugins/UM3NetworkPrinting/PrintCoreConfiguration.qml index 03ff4542e1..7746c6f83e 100644 --- a/plugins/UM3NetworkPrinting/PrintCoreConfiguration.qml +++ b/plugins/UM3NetworkPrinting/PrintCoreConfiguration.qml @@ -10,7 +10,7 @@ Item id: extruderInfo property var printCoreConfiguration - width: Math.floor(parent.width / 2) + width: Math.round(parent.width / 2) height: childrenRect.height Label { diff --git a/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml b/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml index c253ebae89..e97247abe5 100644 --- a/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml +++ b/plugins/UM3NetworkPrinting/PrinterInfoBlock.qml @@ -86,7 +86,7 @@ Rectangle Rectangle { - width: Math.floor(parent.width / 3) + width: Math.round(parent.width / 3) height: parent.height Label // Print job name @@ -131,7 +131,7 @@ Rectangle Rectangle { - width: Math.floor(parent.width / 3 * 2) + width: Math.round(parent.width / 3 * 2) height: parent.height Label // Friendly machine name @@ -139,7 +139,7 @@ Rectangle id: printerNameLabel anchors.top: parent.top anchors.left: parent.left - width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width - showCameraIcon.width) + width: Math.round(parent.width / 2 - UM.Theme.getSize("default_margin").width - showCameraIcon.width) text: printer.friendly_name font: UM.Theme.getFont("default_bold") elide: Text.ElideRight @@ -149,7 +149,7 @@ Rectangle { id: printerTypeLabel anchors.top: printerNameLabel.bottom - width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width) + width: Math.round(parent.width / 2 - UM.Theme.getSize("default_margin").width) text: printer.machine_variant anchors.left: parent.left elide: Text.ElideRight @@ -183,7 +183,7 @@ Rectangle id: extruderInfo anchors.bottom: parent.bottom - width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width) + width: Math.round(parent.width / 2 - UM.Theme.getSize("default_margin").width) height: childrenRect.height spacing: UM.Theme.getSize("default_margin").width @@ -191,7 +191,7 @@ Rectangle PrintCoreConfiguration { id: leftExtruderInfo - width: Math.floor((parent.width - extruderSeperator.width) / 2) + width: Math.round((parent.width - extruderSeperator.width) / 2) printCoreConfiguration: printer.configuration[0] } @@ -206,7 +206,7 @@ Rectangle PrintCoreConfiguration { id: rightExtruderInfo - width: Math.floor((parent.width - extruderSeperator.width) / 2) + width: Math.round((parent.width - extruderSeperator.width) / 2) printCoreConfiguration: printer.configuration[1] } } @@ -217,7 +217,7 @@ Rectangle anchors.right: parent.right anchors.top: parent.top height: showExtended ? parent.height: printProgressTitleBar.height - width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width) + width: Math.round(parent.width / 2 - UM.Theme.getSize("default_margin").width) border.width: UM.Theme.getSize("default_lining").width border.color: lineColor radius: cornerRadius diff --git a/plugins/UM3NetworkPrinting/PrinterVideoStream.qml b/plugins/UM3NetworkPrinting/PrinterVideoStream.qml index 6793d74ac5..fc27563ae1 100644 --- a/plugins/UM3NetworkPrinting/PrinterVideoStream.qml +++ b/plugins/UM3NetworkPrinting/PrinterVideoStream.qml @@ -57,7 +57,7 @@ Item { id: cameraImage width: Math.min(sourceSize.width === 0 ? 800 * screenScaleFactor : sourceSize.width, maximumWidth) - height: Math.floor((sourceSize.height === 0 ? 600 * screenScaleFactor : sourceSize.height) * width / sourceSize.width) + height: Math.round((sourceSize.height === 0 ? 600 * screenScaleFactor : sourceSize.height) * width / sourceSize.width) anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter z: 1 diff --git a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml index aee75d1db5..b92638aa12 100644 --- a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml +++ b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml @@ -180,7 +180,7 @@ Cura.MachineAction height: childrenRect.height anchors.top: nozzleTempLabel.top anchors.left: bedTempStatus.right - anchors.leftMargin: Math.floor(UM.Theme.getSize("default_margin").width/2) + anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").width/2) visible: checkupMachineAction.usbConnected Button { @@ -241,7 +241,7 @@ Cura.MachineAction height: childrenRect.height anchors.top: bedTempLabel.top anchors.left: bedTempStatus.right - anchors.leftMargin: Math.floor(UM.Theme.getSize("default_margin").width/2) + anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").width/2) visible: checkupMachineAction.usbConnected && manager.hasHeatedBed Button { diff --git a/plugins/UserAgreementPlugin/UserAgreement.qml b/plugins/UserAgreementPlugin/UserAgreement.qml index c7f3f165e3..4ee03f4ad5 100644 --- a/plugins/UserAgreementPlugin/UserAgreement.qml +++ b/plugins/UserAgreementPlugin/UserAgreement.qml @@ -9,8 +9,8 @@ import UM 1.3 as UM UM.Dialog { id: baseDialog - minimumWidth: Math.floor(UM.Theme.getSize("modal_window_minimum").width * 0.75) - minimumHeight: Math.floor(UM.Theme.getSize("modal_window_minimum").height * 0.5) + minimumWidth: Math.round(UM.Theme.getSize("modal_window_minimum").width * 0.75) + minimumHeight: Math.round(UM.Theme.getSize("modal_window_minimum").height * 0.5) width: minimumWidth height: minimumHeight title: catalog.i18nc("@title:window", "User Agreement") diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 39b59e58cb..107dc20fd9 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -483,7 +483,7 @@ UM.MainWindow anchors { horizontalCenter: parent.horizontalCenter - horizontalCenterOffset: -(Math.floor(UM.Theme.getSize("sidebar").width / 2)) + horizontalCenterOffset: -(Math.round(UM.Theme.getSize("sidebar").width / 2)) top: parent.verticalCenter; bottom: parent.bottom; } diff --git a/resources/qml/ExtruderButton.qml b/resources/qml/ExtruderButton.qml index e5bc0dd9b5..e4350e0a2c 100644 --- a/resources/qml/ExtruderButton.qml +++ b/resources/qml/ExtruderButton.qml @@ -65,7 +65,7 @@ Button width: UM.Theme.getSize("extruder_button_material").width height: UM.Theme.getSize("extruder_button_material").height - radius: Math.floor(width / 2) + radius: Math.round(width / 2) border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("extruder_button_material_border") diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index 5c5254b129..04e8ec397f 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -94,7 +94,7 @@ Item { { id: printJobTextfield anchors.right: printJobPencilIcon.left - anchors.rightMargin: Math.floor(UM.Theme.getSize("default_margin").width / 2) + 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 diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index e33470b625..393164ad66 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -179,7 +179,7 @@ Item width: parent.width - 2 * UM.Theme.getSize("sidebar_margin").width; height: UM.Theme.getSize("progressbar").height; anchors.top: statusLabel.bottom; - anchors.topMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height / 4); + anchors.topMargin: Math.round(UM.Theme.getSize("sidebar_margin").height / 4); anchors.left: parent.left; anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width; } diff --git a/resources/qml/ObjectsList.qml b/resources/qml/ObjectsList.qml index 9fd2ab1ca7..b64f08d003 100644 --- a/resources/qml/ObjectsList.qml +++ b/resources/qml/ObjectsList.qml @@ -38,7 +38,7 @@ Rectangle Button { id: collapseButton anchors.top: parent.top - anchors.topMargin: Math.floor(UM.Theme.getSize("default_margin").height + (UM.Theme.getSize("layerview_row").height - UM.Theme.getSize("default_margin").height) / 2) + anchors.topMargin: Math.round(UM.Theme.getSize("default_margin").height + (UM.Theme.getSize("layerview_row").height - UM.Theme.getSize("default_margin").height) / 2) anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("default_margin").width diff --git a/resources/qml/Preferences/MaterialView.qml b/resources/qml/Preferences/MaterialView.qml index e5319e280a..9182c32de6 100644 --- a/resources/qml/Preferences/MaterialView.qml +++ b/resources/qml/Preferences/MaterialView.qml @@ -98,15 +98,15 @@ TabView Row { width: scrollView.columnWidth height: parent.rowHeight - spacing: Math.floor(UM.Theme.getSize("default_margin").width / 2) + spacing: Math.round(UM.Theme.getSize("default_margin").width / 2) // color indicator square Rectangle { id: colorSelector color: properties.color_code - width: Math.floor(colorLabel.height * 0.75) - height: Math.floor(colorLabel.height * 0.75) + width: Math.round(colorLabel.height * 0.75) + height: Math.round(colorLabel.height * 0.75) border.width: UM.Theme.getSize("default_lining").height anchors.verticalCenter: parent.verticalCenter diff --git a/resources/qml/Preferences/MaterialsPage.qml b/resources/qml/Preferences/MaterialsPage.qml index b67430aaa4..62bb7f97ed 100644 --- a/resources/qml/Preferences/MaterialsPage.qml +++ b/resources/qml/Preferences/MaterialsPage.qml @@ -59,15 +59,15 @@ UM.ManagementPage anchors.right: parent.right Rectangle { - width: Math.floor(parent.height * 0.8) - height: Math.floor(parent.height * 0.8) + width: Math.round(parent.height * 0.8) + height: Math.round(parent.height * 0.8) color: model.metadata.color_code border.color: isCurrentItem ? palette.highlightedText : palette.text; anchors.verticalCenter: parent.verticalCenter } Label { - width: Math.floor((parent.width * 0.3)) + width: Math.round((parent.width * 0.3)) text: model.metadata.material elide: Text.ElideRight font.italic: model.id == activeId diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index 786b41b499..120d7450ed 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -24,7 +24,7 @@ Column { id: connectedPrinterHeader width: parent.width - height: Math.floor(childrenRect.height + UM.Theme.getSize("default_margin").height * 2) + height: Math.round(childrenRect.height + UM.Theme.getSize("default_margin").height * 2) color: UM.Theme.getColor("setting_category") Label @@ -82,7 +82,7 @@ Column { id: extruderRectangle color: UM.Theme.getColor("sidebar") - width: index == machineExtruderCount.properties.value - 1 && index % 2 == 0 ? extrudersGrid.width : Math.floor(extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2) + width: index == machineExtruderCount.properties.value - 1 && index % 2 == 0 ? extrudersGrid.width : Math.round(extrudersGrid.width / 2 - UM.Theme.getSize("sidebar_lining_thin").width / 2) height: UM.Theme.getSize("sidebar_extruder_box").height Label //Extruder name. @@ -162,8 +162,8 @@ Column Rectangle //Material colour indication. { id: materialColor - width: Math.floor(materialName.height * 0.75) - height: Math.floor(materialName.height * 0.75) + width: Math.round(materialName.height * 0.75) + height: Math.round(materialName.height * 0.75) radius: width / 2 color: (connectedPrinter != null && connectedPrinter.materialColors[index] != null && connectedPrinter.materialIds[index] != "") ? connectedPrinter.materialColors[index] : "#00000000" border.width: UM.Theme.getSize("default_lining").width @@ -357,7 +357,7 @@ Column color: !enabled ? UM.Theme.getColor("setting_control_disabled") : showError ? UM.Theme.getColor("setting_validation_error_background") : UM.Theme.getColor("setting_validation_ok") property var showError: { - if(bedTemperature.properties.maximum_value != "None" && bedTemperature.properties.maximum_value < Math.floor(preheatTemperatureInput.text)) + if(bedTemperature.properties.maximum_value != "None" && bedTemperature.properties.maximum_value < Math.round(preheatTemperatureInput.text)) { return true; } else @@ -476,7 +476,7 @@ Column visible: preheatCountdown.visible source: UM.Theme.getIcon("print_time") anchors.right: preheatCountdown.left - anchors.rightMargin: Math.floor(UM.Theme.getSize("default_margin").width / 2) + anchors.rightMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) anchors.verticalCenter: preheatCountdown.verticalCenter } @@ -528,15 +528,15 @@ Column { return true; //Can always cancel if the timer is running. } - if (bedTemperature.properties.minimum_value != "None" && Math.floor(preheatTemperatureInput.text) < Math.floor(bedTemperature.properties.minimum_value)) + if (bedTemperature.properties.minimum_value != "None" && Math.round(preheatTemperatureInput.text) < Math.round(bedTemperature.properties.minimum_value)) { return false; //Target temperature too low. } - if (bedTemperature.properties.maximum_value != "None" && Math.floor(preheatTemperatureInput.text) > Math.floor(bedTemperature.properties.maximum_value)) + if (bedTemperature.properties.maximum_value != "None" && Math.round(preheatTemperatureInput.text) > Math.round(bedTemperature.properties.maximum_value)) { return false; //Target temperature too high. } - if (Math.floor(preheatTemperatureInput.text) == 0) + if (Math.round(preheatTemperatureInput.text) == 0) { return false; //Setting the temperature to 0 is not allowed (since that cancels the pre-heating). } @@ -718,7 +718,7 @@ Column color: UM.Theme.getColor("setting_control_text") font: UM.Theme.getFont("default") - width: Math.floor(parent.width * 0.4) - UM.Theme.getSize("default_margin").width + width: Math.round(parent.width * 0.4) - UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("setting_control").height verticalAlignment: Text.AlignVCenter } @@ -908,7 +908,7 @@ Column color: UM.Theme.getColor("setting_control_text") font: UM.Theme.getFont("default") - width: Math.floor(parent.width * 0.4) - UM.Theme.getSize("default_margin").width + width: Math.round(parent.width * 0.4) - UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("setting_control").height verticalAlignment: Text.AlignVCenter } @@ -1044,13 +1044,13 @@ Column Row { height: UM.Theme.getSize("setting_control").height - width: Math.floor(base.width - 2 * UM.Theme.getSize("default_margin").width) + width: Math.round(base.width - 2 * UM.Theme.getSize("default_margin").width) anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width Label { - width: Math.floor(parent.width * 0.4) + width: Math.round(parent.width * 0.4) anchors.verticalCenter: parent.verticalCenter text: label color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") @@ -1059,7 +1059,7 @@ Column } Label { - width: Math.floor(parent.width * 0.6) + width: Math.round(parent.width * 0.6) anchors.verticalCenter: parent.verticalCenter text: value color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") @@ -1146,8 +1146,8 @@ Column { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.floor(control.width / 2) - height: Math.floor(control.height / 2) + width: Math.round(control.width / 2) + height: Math.round(control.height / 2) sourceSize.width: width sourceSize.height: width color: diff --git a/resources/qml/SaveButton.qml b/resources/qml/SaveButton.qml index cceecb8762..6b5935bb9e 100644 --- a/resources/qml/SaveButton.qml +++ b/resources/qml/SaveButton.qml @@ -76,7 +76,7 @@ Item { width: parent.width - 2 * UM.Theme.getSize("sidebar_margin").width height: UM.Theme.getSize("progressbar").height anchors.top: statusLabel.bottom - anchors.topMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height / 4) + anchors.topMargin: Math.round(UM.Theme.getSize("sidebar_margin").height / 4) anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width radius: UM.Theme.getSize("progressbar_radius").width @@ -354,7 +354,7 @@ Item { } Behavior on color { ColorAnimation { duration: 50; } } anchors.left: parent.left - anchors.leftMargin: Math.floor(UM.Theme.getSize("save_button_text_margin").width / 2); + anchors.leftMargin: Math.round(UM.Theme.getSize("save_button_text_margin").width / 2); width: parent.height height: parent.height diff --git a/resources/qml/Settings/SettingCategory.qml b/resources/qml/Settings/SettingCategory.qml index 4249b4fffa..5f22910b00 100644 --- a/resources/qml/Settings/SettingCategory.qml +++ b/resources/qml/Settings/SettingCategory.qml @@ -187,13 +187,13 @@ Button id: settingsButton visible: base.hovered || settingsButton.hovered - height: Math.floor(base.height * 0.6) - width: Math.floor(base.height * 0.6) + height: Math.round(base.height * 0.6) + width: Math.round(base.height * 0.6) anchors { right: inheritButton.visible ? inheritButton.left : parent.right // use 1.9 as the factor because there is a 0.1 difference between the settings and inheritance warning icons - rightMargin: inheritButton.visible ? Math.floor(UM.Theme.getSize("default_margin").width / 2) : category_arrow.width + Math.floor(UM.Theme.getSize("default_margin").width * 1.9) + rightMargin: inheritButton.visible ? Math.round(UM.Theme.getSize("default_margin").width / 2) : category_arrow.width + Math.round(UM.Theme.getSize("default_margin").width * 1.9) verticalCenter: parent.verticalCenter } @@ -231,7 +231,7 @@ Button return false } - height: Math.floor(parent.height / 2) + height: Math.round(parent.height / 2) width: height onClicked: diff --git a/resources/qml/Settings/SettingCheckBox.qml b/resources/qml/Settings/SettingCheckBox.qml index 0e3d3971f9..5672e98dd2 100644 --- a/resources/qml/Settings/SettingCheckBox.qml +++ b/resources/qml/Settings/SettingCheckBox.qml @@ -118,8 +118,8 @@ SettingItem UM.RecolorImage { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.floor(parent.width / 2.5) - height: Math.floor(parent.height / 2.5) + width: Math.round(parent.width / 2.5) + height: Math.round(parent.height / 2.5) sourceSize.width: width sourceSize.height: width color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index bac44d4831..4debf147ae 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -61,7 +61,7 @@ SettingItem { id: downArrow x: control.width - width - control.rightPadding - y: control.topPadding + Math.floor((control.availableHeight - height) / 2) + y: control.topPadding + Math.round((control.availableHeight - height) / 2) source: UM.Theme.getIcon("arrow_bottom") width: UM.Theme.getSize("standard_arrow").width diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 9d4f9de48d..462512f476 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -68,7 +68,7 @@ SettingItem { id: downArrow x: control.width - width - control.rightPadding - y: control.topPadding + Math.floor((control.availableHeight - height) / 2) + y: control.topPadding + Math.round((control.availableHeight - height) / 2) source: UM.Theme.getIcon("arrow_bottom") width: UM.Theme.getSize("standard_arrow").width @@ -126,16 +126,16 @@ SettingItem background: Rectangle { id: swatch - height: Math.floor(UM.Theme.getSize("setting_control").height / 2) + height: Math.round(UM.Theme.getSize("setting_control").height / 2) width: height anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - anchors.margins: Math.floor(UM.Theme.getSize("default_margin").width / 4) + anchors.margins: Math.round(UM.Theme.getSize("default_margin").width / 4) border.width: UM.Theme.getSize("default_lining").width border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") - radius: Math.floor(width / 2) + radius: Math.round(width / 2) color: control.color } @@ -180,16 +180,16 @@ SettingItem background: Rectangle { id: swatch - height: Math.floor(UM.Theme.getSize("setting_control").height / 2) + height: Math.round(UM.Theme.getSize("setting_control").height / 2) width: height anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - anchors.margins: Math.floor(UM.Theme.getSize("default_margin").width / 4) + anchors.margins: Math.round(UM.Theme.getSize("default_margin").width / 4) border.width: UM.Theme.getSize("default_lining").width border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") - radius: Math.floor(width / 2) + radius: Math.round(width / 2) color: control.model.getItem(index).color } diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index 771362edd7..41fc21b026 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -108,7 +108,7 @@ Item { id: label; anchors.left: parent.left; - anchors.leftMargin: doDepthIndentation ? Math.floor((UM.Theme.getSize("section_icon_column").width + 5) + ((definition.depth - 1) * UM.Theme.getSize("setting_control_depth_margin").width)) : 0 + anchors.leftMargin: doDepthIndentation ? Math.round((UM.Theme.getSize("section_icon_column").width + 5) + ((definition.depth - 1) * UM.Theme.getSize("setting_control_depth_margin").width)) : 0 anchors.right: settingControls.left; anchors.verticalCenter: parent.verticalCenter @@ -128,12 +128,12 @@ Item { { id: settingControls - height: Math.floor(parent.height / 2) - spacing: Math.floor(UM.Theme.getSize("sidebar_margin").height / 2) + height: Math.round(parent.height / 2) + spacing: Math.round(UM.Theme.getSize("sidebar_margin").height / 2) anchors { right: controlContainer.left - rightMargin: Math.floor(UM.Theme.getSize("sidebar_margin").width / 2) + rightMargin: Math.round(UM.Theme.getSize("sidebar_margin").width / 2) verticalCenter: parent.verticalCenter } diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 651c76cdb0..2a5220ad5e 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -87,7 +87,7 @@ SettingItem { id: downArrow x: control.width - width - control.rightPadding - y: control.topPadding + Math.floor((control.availableHeight - height) / 2) + y: control.topPadding + Math.round((control.availableHeight - height) / 2) source: UM.Theme.getIcon("arrow_bottom") width: UM.Theme.getSize("standard_arrow").width @@ -145,16 +145,16 @@ SettingItem background: Rectangle { id: swatch - height: Math.floor(UM.Theme.getSize("setting_control").height / 2) + height: Math.round(UM.Theme.getSize("setting_control").height / 2) width: height anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - anchors.margins: Math.floor(UM.Theme.getSize("default_margin").width / 4) + anchors.margins: Math.round(UM.Theme.getSize("default_margin").width / 4) border.width: UM.Theme.getSize("default_lining").width border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") - radius: Math.floor(width / 2) + radius: Math.round(width / 2) color: control.color } @@ -199,16 +199,16 @@ SettingItem background: Rectangle { id: swatch - height: Math.floor(UM.Theme.getSize("setting_control").height / 2) + height: Math.round(UM.Theme.getSize("setting_control").height / 2) width: height anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - anchors.margins: Math.floor(UM.Theme.getSize("default_margin").width / 4) + anchors.margins: Math.round(UM.Theme.getSize("default_margin").width / 4) border.width: UM.Theme.getSize("default_lining").width border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border") - radius: Math.floor(width / 2) + radius: Math.round(width / 2) color: control.model.getItem(index).color } diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index a291c97733..6684ce86cf 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -26,7 +26,7 @@ SettingItem anchors.fill: parent - border.width: Math.floor(UM.Theme.getSize("default_lining").width) + border.width: Math.round(UM.Theme.getSize("default_lining").width) border.color: { if(!enabled) @@ -76,7 +76,7 @@ SettingItem Rectangle { anchors.fill: parent; - anchors.margins: Math.floor(UM.Theme.getSize("default_lining").width); + anchors.margins: Math.round(UM.Theme.getSize("default_lining").width); color: UM.Theme.getColor("setting_control_highlight") opacity: !control.hovered ? 0 : propertyProvider.properties.validationState == "ValidatorState.Valid" ? 1.0 : 0.35; } @@ -84,7 +84,7 @@ SettingItem Label { anchors.right: parent.right; - anchors.rightMargin: Math.floor(UM.Theme.getSize("setting_unit_margin").width) + anchors.rightMargin: Math.round(UM.Theme.getSize("setting_unit_margin").width) anchors.verticalCenter: parent.verticalCenter; text: definition.unit; @@ -107,9 +107,9 @@ SettingItem anchors { left: parent.left - leftMargin: Math.floor(UM.Theme.getSize("setting_unit_margin").width) + leftMargin: Math.round(UM.Theme.getSize("setting_unit_margin").width) right: parent.right - rightMargin: Math.floor(UM.Theme.getSize("setting_unit_margin").width) + rightMargin: Math.round(UM.Theme.getSize("setting_unit_margin").width) verticalCenter: parent.verticalCenter } renderType: Text.NativeRendering diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 50ee79bd11..399db91878 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -30,16 +30,16 @@ Item { top: parent.top left: parent.left - leftMargin: Math.floor(UM.Theme.getSize("sidebar_margin").width) + leftMargin: Math.round(UM.Theme.getSize("sidebar_margin").width) right: parent.right - rightMargin: Math.floor(UM.Theme.getSize("sidebar_margin").width) + rightMargin: Math.round(UM.Theme.getSize("sidebar_margin").width) } Label { id: globalProfileLabel text: catalog.i18nc("@label","Profile:"); - width: Math.floor(parent.width * 0.45 - UM.Theme.getSize("sidebar_margin").width - 2) + width: Math.round(parent.width * 0.45 - UM.Theme.getSize("sidebar_margin").width - 2) font: UM.Theme.getFont("default"); color: UM.Theme.getColor("text"); verticalAlignment: Text.AlignVCenter @@ -53,7 +53,7 @@ Item text: generateActiveQualityText() enabled: !header.currentExtruderVisible || header.currentExtruderIndex > -1 - width: Math.floor(parent.width * 0.55) + width: Math.round(parent.width * 0.55) height: UM.Theme.getSize("setting_control").height anchors.left: globalProfileLabel.right anchors.right: parent.right @@ -82,12 +82,12 @@ Item id: customisedSettings visible: Cura.MachineManager.hasUserSettings - height: Math.floor(parent.height * 0.6) - width: Math.floor(parent.height * 0.6) + height: Math.round(parent.height * 0.6) + width: Math.round(parent.height * 0.6) anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: Math.floor(UM.Theme.getSize("setting_preferences_button_margin").width - UM.Theme.getSize("sidebar_margin").width) + anchors.rightMargin: Math.round(UM.Theme.getSize("setting_preferences_button_margin").width - UM.Theme.getSize("sidebar_margin").width) color: hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button"); iconSource: UM.Theme.getIcon("star"); @@ -112,7 +112,7 @@ Item id: filterContainer visible: true - border.width: Math.floor(UM.Theme.getSize("default_lining").width) + border.width: Math.round(UM.Theme.getSize("default_lining").width) border.color: { if(hoverMouseArea.containsMouse || clearFilterButton.containsMouse) @@ -132,9 +132,9 @@ Item top: globalProfileRow.bottom topMargin: UM.Theme.getSize("sidebar_margin").height left: parent.left - leftMargin: Math.floor(UM.Theme.getSize("sidebar_margin").width) + leftMargin: Math.round(UM.Theme.getSize("sidebar_margin").width) right: parent.right - rightMargin: Math.floor(UM.Theme.getSize("sidebar_margin").width) + rightMargin: Math.round(UM.Theme.getSize("sidebar_margin").width) } height: visible ? UM.Theme.getSize("setting_control").height : 0 Behavior on height { NumberAnimation { duration: 100 } } @@ -145,7 +145,7 @@ Item anchors.left: parent.left anchors.right: clearFilterButton.left - anchors.rightMargin: Math.floor(UM.Theme.getSize("sidebar_margin").width) + anchors.rightMargin: Math.round(UM.Theme.getSize("sidebar_margin").width) placeholderText: catalog.i18nc("@label:textbox", "Search...") @@ -204,12 +204,12 @@ Item iconSource: UM.Theme.getIcon("cross1") visible: findingSettings - height: Math.floor(parent.height * 0.4) + height: Math.round(parent.height * 0.4) width: visible ? height : 0 anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: Math.floor(UM.Theme.getSize("sidebar_margin").width) + anchors.rightMargin: Math.round(UM.Theme.getSize("sidebar_margin").width) color: UM.Theme.getColor("setting_control_button") hoverColor: UM.Theme.getColor("setting_control_button_hover") @@ -238,7 +238,7 @@ Item ListView { id: contents - spacing: Math.floor(UM.Theme.getSize("default_lining").height); + spacing: Math.round(UM.Theme.getSize("default_lining").height); cacheBuffer: 1000000; // Set a large cache to effectively just cache every list item. model: UM.SettingDefinitionsModel @@ -266,7 +266,7 @@ Item { id: delegate - width: Math.floor(UM.Theme.getSize("sidebar").width); + width: Math.round(UM.Theme.getSize("sidebar").width); height: provider.properties.enabled == "True" ? UM.Theme.getSize("section").height : - contents.spacing Behavior on height { NumberAnimation { duration: 100 } } opacity: provider.properties.enabled == "True" ? 1 : 0 @@ -388,7 +388,7 @@ Item contextMenu.provider = provider contextMenu.popup(); } - onShowTooltip: base.showTooltip(delegate, { x: -UM.Theme.getSize("default_arrow").width, y: Math.floor(delegate.height / 2) }, text) + onShowTooltip: base.showTooltip(delegate, { x: -UM.Theme.getSize("default_arrow").width, y: Math.round(delegate.height / 2) }, text) onHideTooltip: base.hideTooltip() onShowAllHiddenInheritedSettings: { diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 7d944a62d6..2da16f3ccb 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -64,11 +64,11 @@ Rectangle function getPrettyTime(time) { - var hours = Math.floor(time / 3600) + var hours = Math.round(time / 3600) time -= hours * 3600 - var minutes = Math.floor(time / 60); + var minutes = Math.round(time / 60); time -= minutes * 60 - var seconds = Math.floor(time); + var seconds = Math.round(time); var finalTime = strPadLeft(hours, "0", 2) + ':' + strPadLeft(minutes,'0',2)+ ':' + strPadLeft(seconds,'0',2); return finalTime; @@ -130,7 +130,7 @@ Rectangle anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width anchors.top: hideSettings ? machineSelection.bottom : headerSeparator.bottom anchors.topMargin: UM.Theme.getSize("sidebar_margin").height - width: Math.floor(parent.width * 0.45) + width: Math.round(parent.width * 0.45) font: UM.Theme.getFont("large") color: UM.Theme.getColor("text") visible: !monitoringPrint && !hideView @@ -142,7 +142,7 @@ Rectangle id: settingsModeSelection color: "transparent" - width: Math.floor(parent.width * 0.55) + width: Math.round(parent.width * 0.55) height: UM.Theme.getSize("sidebar_header_mode_toggle").height anchors.right: parent.right @@ -171,10 +171,10 @@ Rectangle id: control height: settingsModeSelection.height - width: Math.floor(parent.width / 2) + width: Math.round(parent.width / 2) anchors.left: parent.left - anchors.leftMargin: model.index * Math.floor(settingsModeSelection.width / 2) + anchors.leftMargin: model.index * Math.round(settingsModeSelection.width / 2) anchors.verticalCenter: parent.verticalCenter ButtonGroup.group: modeMenuGroup @@ -329,7 +329,7 @@ Rectangle height: UM.Theme.getSize("sidebar_lining").height color: UM.Theme.getColor("sidebar_lining") anchors.bottom: printSpecs.top - anchors.bottomMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height * 2 + UM.Theme.getSize("progressbar").height + UM.Theme.getFont("default_bold").pixelSize) + anchors.bottomMargin: Math.round(UM.Theme.getSize("sidebar_margin").height * 2 + UM.Theme.getSize("progressbar").height + UM.Theme.getFont("default_bold").pixelSize) } Item @@ -429,7 +429,7 @@ Rectangle { names.push(base.printMaterialNames[index]); lengths.push(base.printMaterialLengths[index].toFixed(2)); - weights.push(String(Math.floor(base.printMaterialWeights[index]))); + weights.push(String(Math.round(base.printMaterialWeights[index]))); var cost = base.printMaterialCosts[index] == undefined ? 0 : base.printMaterialCosts[index].toFixed(2); costs.push(cost); if(cost > 0) @@ -495,7 +495,7 @@ Rectangle if(base.printMaterialLengths[index] > 0) { lengths.push(base.printMaterialLengths[index].toFixed(2)); - weights.push(String(Math.floor(base.printMaterialWeights[index]))); + weights.push(String(Math.round(base.printMaterialWeights[index]))); var cost = base.printMaterialCosts[index] == undefined ? 0 : base.printMaterialCosts[index].toFixed(2); costs.push(cost); if(cost > 0) @@ -610,7 +610,7 @@ Rectangle }) sidebarContents.replace(modesListModel.get(base.currentModeIndex).item, { "immediate": true }) - var index = Math.floor(UM.Preferences.getValue("cura/active_mode")) + var index = Math.round(UM.Preferences.getValue("cura/active_mode")) if(index) { currentModeIndex = index; diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 017f28bea0..f7f6e101bd 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -17,7 +17,7 @@ Column property int currentExtruderIndex: Cura.ExtruderManager.activeExtruderIndex; property bool currentExtruderVisible: extrudersList.visible; - spacing: Math.floor(UM.Theme.getSize("sidebar_margin").width * 0.9) + spacing: Math.round(UM.Theme.getSize("sidebar_margin").width * 0.9) signal showTooltip(Item item, point location, string text) signal hideTooltip() @@ -39,15 +39,15 @@ Column { id: extruderSelectionRow width: parent.width - height: Math.floor(UM.Theme.getSize("sidebar_tabs").height * 2 / 3) + height: Math.round(UM.Theme.getSize("sidebar_tabs").height * 2 / 3) visible: machineExtruderCount.properties.value > 1 && !sidebar.monitoringPrint anchors { left: parent.left - leftMargin: Math.floor(UM.Theme.getSize("sidebar_margin").width * 0.7) + leftMargin: Math.round(UM.Theme.getSize("sidebar_margin").width * 0.7) right: parent.right - rightMargin: Math.floor(UM.Theme.getSize("sidebar_margin").width * 0.7) + rightMargin: Math.round(UM.Theme.getSize("sidebar_margin").width * 0.7) topMargin: UM.Theme.getSize("sidebar_margin").height } @@ -57,15 +57,15 @@ Column property var index: 0 height: UM.Theme.getSize("sidebar_header_mode_tabs").height - width: Math.floor(parent.width) + width: Math.round(parent.width) boundsBehavior: Flickable.StopAtBounds anchors { left: parent.left - leftMargin: Math.floor(UM.Theme.getSize("default_margin").width / 2) + leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) right: parent.right - rightMargin: Math.floor(UM.Theme.getSize("default_margin").width / 2) + rightMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) verticalCenter: parent.verticalCenter } @@ -84,7 +84,7 @@ Column delegate: Button { height: ListView.view.height - width: Math.floor(ListView.view.width / extrudersModel.rowCount()) + width: Math.round(ListView.view.width / extrudersModel.rowCount()) text: model.name tooltip: model.name @@ -121,7 +121,7 @@ Column width: { var extruderTextWidth = extruderStaticText.visible ? extruderStaticText.width : 0; var iconWidth = extruderIconItem.width; - return Math.floor(extruderTextWidth + iconWidth + UM.Theme.getSize("default_margin").width / 2); + return Math.round(extruderTextWidth + iconWidth + UM.Theme.getSize("default_margin").width / 2); } // Static text "Extruder" @@ -153,7 +153,7 @@ Column var minimumWidth = control.width < UM.Theme.getSize("button").width ? control.width : UM.Theme.getSize("button").width; var minimumHeight = control.height < UM.Theme.getSize("button").height ? control.height : UM.Theme.getSize("button").height; var minimumSize = minimumWidth < minimumHeight ? minimumWidth : minimumHeight; - minimumSize -= Math.floor(UM.Theme.getSize("default_margin").width / 2); + minimumSize -= Math.round(UM.Theme.getSize("default_margin").width / 2); return minimumSize; } @@ -192,15 +192,15 @@ Column { right: parent.right top: parent.top - rightMargin: Math.floor(parent.sizeToUse * 0.01) - topMargin: Math.floor(parent.sizeToUse * 0.05) + rightMargin: Math.round(parent.sizeToUse * 0.01) + topMargin: Math.round(parent.sizeToUse * 0.05) } color: model.color - width: Math.floor(parent.width * 0.35) - height: Math.floor(parent.height * 0.35) - radius: Math.floor(width / 2) + width: Math.round(parent.width * 0.35) + height: Math.round(parent.height * 0.35) + radius: Math.round(width / 2) border.width: 1 border.color: UM.Theme.getColor("extruder_button_material_border") @@ -219,7 +219,7 @@ Column Item { id: variantRowSpacer - height: Math.floor(UM.Theme.getSize("sidebar_margin").height / 4) + height: Math.round(UM.Theme.getSize("sidebar_margin").height / 4) width: height visible: !extruderSelectionRow.visible } @@ -243,7 +243,7 @@ Column { id: materialLabel text: catalog.i18nc("@label","Material"); - width: Math.floor(parent.width * 0.45 - UM.Theme.getSize("default_margin").width) + width: Math.round(parent.width * 0.45 - UM.Theme.getSize("default_margin").width) font: UM.Theme.getFont("default"); color: UM.Theme.getColor("text"); } @@ -257,7 +257,7 @@ Column visible: Cura.MachineManager.hasMaterials enabled: !extrudersList.visible || base.currentExtruderIndex > -1 height: UM.Theme.getSize("setting_control").height - width: Math.floor(parent.width * 0.7) + UM.Theme.getSize("sidebar_margin").width + width: Math.round(parent.width * 0.7) + UM.Theme.getSize("sidebar_margin").width anchors.right: parent.right style: UM.Theme.styles.sidebar_header_button activeFocusOnPress: true; @@ -293,7 +293,7 @@ Column { id: variantLabel text: Cura.MachineManager.activeDefinitionVariantsName; - width: Math.floor(parent.width * 0.45 - UM.Theme.getSize("default_margin").width) + width: Math.round(parent.width * 0.45 - UM.Theme.getSize("default_margin").width) font: UM.Theme.getFont("default"); color: UM.Theme.getColor("text"); } @@ -305,7 +305,7 @@ Column visible: Cura.MachineManager.hasVariants height: UM.Theme.getSize("setting_control").height - width: Math.floor(parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width) + width: Math.round(parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width) anchors.right: parent.right style: UM.Theme.styles.sidebar_header_button activeFocusOnPress: true; @@ -318,7 +318,7 @@ Column Item { id: materialInfoRow - height: Math.floor(UM.Theme.getSize("sidebar_setup").height / 2) + height: Math.round(UM.Theme.getSize("sidebar_setup").height / 2) visible: (Cura.MachineManager.hasVariants || Cura.MachineManager.hasMaterials) && !sidebar.monitoringPrint && !sidebar.hideSettings anchors @@ -332,7 +332,7 @@ Column Item { height: UM.Theme.getSize("sidebar_setup").height anchors.right: parent.right - width: Math.floor(parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width) + width: Math.round(parent.width * 0.7 + UM.Theme.getSize("sidebar_margin").width) UM.RecolorImage { id: warningImage diff --git a/resources/qml/SidebarSimple.qml b/resources/qml/SidebarSimple.qml index b4c494c5e9..8d287f64e3 100644 --- a/resources/qml/SidebarSimple.qml +++ b/resources/qml/SidebarSimple.qml @@ -146,16 +146,16 @@ Item } function calculateSliderStepWidth (totalTicks) { - qualityModel.qualitySliderStepWidth = totalTicks != 0 ? Math.floor((base.width * 0.55) / (totalTicks)) : 0 + qualityModel.qualitySliderStepWidth = totalTicks != 0 ? Math.round((base.width * 0.55) / (totalTicks)) : 0 } function calculateSliderMargins (availableMin, availableMax, totalTicks) { if (availableMin == -1 || (availableMin == 0 && availableMax == 0)) { - qualityModel.qualitySliderMarginRight = Math.floor(base.width * 0.55) + qualityModel.qualitySliderMarginRight = Math.round(base.width * 0.55) } else if (availableMin == availableMax) { - qualityModel.qualitySliderMarginRight = Math.floor((totalTicks - availableMin) * qualitySliderStepWidth) + qualityModel.qualitySliderMarginRight = Math.round((totalTicks - availableMin) * qualitySliderStepWidth) } else { - qualityModel.qualitySliderMarginRight = Math.floor((totalTicks - availableMax) * qualitySliderStepWidth) + qualityModel.qualitySliderMarginRight = Math.round((totalTicks - availableMax) * qualitySliderStepWidth) } } @@ -190,7 +190,7 @@ Item { anchors.verticalCenter: parent.verticalCenter anchors.top: parent.top - anchors.topMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height / 2) + anchors.topMargin: Math.round(UM.Theme.getSize("sidebar_margin").height / 2) color: (Cura.MachineManager.activeMachine != null && Cura.ProfilesModel.getItem(index).available) ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") text: { @@ -219,13 +219,13 @@ Item // Make sure the text aligns correctly with each tick if (qualityModel.totalTicks == 0) { // If there is only one tick, align it centrally - return Math.floor(((base.width * 0.55) - width) / 2) + return Math.round(((base.width * 0.55) - width) / 2) } else if (index == 0) { - return Math.floor(base.width * 0.55 / qualityModel.totalTicks) * index + return Math.round(base.width * 0.55 / qualityModel.totalTicks) * index } else if (index == qualityModel.totalTicks) { - return Math.floor(base.width * 0.55 / qualityModel.totalTicks) * index - width + return Math.round(base.width * 0.55 / qualityModel.totalTicks) * index - width } else { - return Math.floor((base.width * 0.55 / qualityModel.totalTicks) * index - (width / 2)) + return Math.round((base.width * 0.55 / qualityModel.totalTicks) * index - (width / 2)) } } } @@ -236,7 +236,7 @@ Item Item { id: speedSlider - width: Math.floor(base.width * 0.55) + width: Math.round(base.width * 0.55) height: UM.Theme.getSize("sidebar_margin").height anchors.right: parent.right anchors.top: parent.top @@ -246,7 +246,7 @@ Item Rectangle { id: groovechildrect - width: Math.floor(base.width * 0.55) + width: Math.round(base.width * 0.55) height: 2 * screenScaleFactor color: UM.Theme.getColor("quality_slider_unavailable") anchors.verticalCenter: qualitySlider.verticalCenter @@ -266,7 +266,7 @@ Item width: 1 * screenScaleFactor height: 6 * screenScaleFactor y: 0 - x: Math.floor(qualityModel.qualitySliderStepWidth * index) + x: Math.round(qualityModel.qualitySliderStepWidth * index) } } @@ -277,7 +277,7 @@ Item color: UM.Theme.getColor("quality_slider_unavailable") implicitWidth: 10 * screenScaleFactor implicitHeight: implicitWidth - radius: Math.floor(width / 2) + radius: Math.round(width / 2) } Slider @@ -306,7 +306,7 @@ Item groove: Rectangle { implicitHeight: 2 * screenScaleFactor color: UM.Theme.getColor("quality_slider_available") - radius: Math.floor(height / 2) + radius: Math.round(height / 2) } handle: Item { Rectangle { @@ -315,7 +315,7 @@ Item color: UM.Theme.getColor("quality_slider_available") implicitWidth: 10 * screenScaleFactor implicitHeight: implicitWidth - radius: Math.floor(implicitWidth / 2) + radius: Math.round(implicitWidth / 2) visible: !Cura.SimpleModeSettingsManager.isProfileCustomized && !Cura.SimpleModeSettingsManager.isProfileUserCreated && qualityModel.existingQualityProfile } } @@ -362,7 +362,7 @@ Item text: catalog.i18nc("@label", "Print Speed") font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") - width: Math.floor(UM.Theme.getSize("sidebar").width * 0.35) + width: Math.round(UM.Theme.getSize("sidebar").width * 0.35) elide: Text.ElideRight } @@ -393,12 +393,12 @@ Item id: customisedSettings visible: Cura.SimpleModeSettingsManager.isProfileCustomized || Cura.SimpleModeSettingsManager.isProfileUserCreated - height: Math.floor(speedSlider.height * 0.8) - width: Math.floor(speedSlider.height * 0.8) + height: Math.round(speedSlider.height * 0.8) + width: Math.round(speedSlider.height * 0.8) anchors.verticalCenter: speedSlider.verticalCenter anchors.right: speedSlider.left - anchors.rightMargin: Math.floor(UM.Theme.getSize("sidebar_margin").width / 2) + anchors.rightMargin: Math.round(UM.Theme.getSize("sidebar_margin").width / 2) color: hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button"); iconSource: UM.Theme.getIcon("reset"); @@ -438,7 +438,7 @@ Item anchors.topMargin: UM.Theme.getSize("sidebar_margin").height * 2 anchors.left: parent.left - width: Math.floor(UM.Theme.getSize("sidebar").width * .45) - UM.Theme.getSize("sidebar_margin").width + width: Math.round(UM.Theme.getSize("sidebar").width * .45) - UM.Theme.getSize("sidebar_margin").width Label { @@ -448,7 +448,7 @@ Item color: UM.Theme.getColor("text") anchors.top: parent.top - anchors.topMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height * 1.7) + anchors.topMargin: Math.round(UM.Theme.getSize("sidebar_margin").height * 1.7) anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width } @@ -459,7 +459,7 @@ Item id: infillCellRight height: infillSlider.height + UM.Theme.getSize("sidebar_margin").height + enableGradualInfillCheckBox.visible * (enableGradualInfillCheckBox.height + UM.Theme.getSize("sidebar_margin").height) - width: Math.floor(UM.Theme.getSize("sidebar").width * .55) + width: Math.round(UM.Theme.getSize("sidebar").width * .55) anchors.left: infillCellLeft.right anchors.top: infillCellLeft.top @@ -470,7 +470,7 @@ Item //anchors.top: parent.top anchors.left: infillSlider.left - anchors.leftMargin: Math.floor((infillSlider.value / infillSlider.stepSize) * (infillSlider.width / (infillSlider.maximumValue / infillSlider.stepSize)) - 10 * screenScaleFactor) + anchors.leftMargin: Math.round((infillSlider.value / infillSlider.stepSize) * (infillSlider.width / (infillSlider.maximumValue / infillSlider.stepSize)) - 10 * screenScaleFactor) anchors.right: parent.right text: parseInt(infillDensity.properties.value) + "%" @@ -576,12 +576,12 @@ Item { id: infillIcon - width: Math.floor((parent.width / 5) - (UM.Theme.getSize("sidebar_margin").width)) + width: Math.round((parent.width / 5) - (UM.Theme.getSize("sidebar_margin").width)) height: width anchors.right: parent.right anchors.top: parent.top - anchors.topMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height / 2) + anchors.topMargin: Math.round(UM.Theme.getSize("sidebar_margin").height / 2) // we loop over all density icons and only show the one that has the current density and steps Repeater @@ -592,8 +592,8 @@ Item function activeIndex () { for (var i = 0; i < infillModel.count; i++) { - var density = Math.floor(infillDensity.properties.value) - var steps = Math.floor(infillSteps.properties.value) + var density = Math.round(infillDensity.properties.value) + var steps = Math.round(infillSteps.properties.value) var infillModelItem = infillModel.get(i) if (infillModelItem != "undefined" @@ -634,7 +634,7 @@ Item property alias _hovered: enableGradualInfillMouseArea.containsMouse anchors.top: infillSlider.bottom - anchors.topMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height / 2) // closer to slider since it belongs to the same category + anchors.topMargin: Math.round(UM.Theme.getSize("sidebar_margin").height / 2) // closer to slider since it belongs to the same category anchors.left: infillCellRight.left style: UM.Theme.styles.checkbox @@ -676,7 +676,7 @@ Item Label { id: gradualInfillLabel anchors.left: enableGradualInfillCheckBox.right - anchors.leftMargin: Math.floor(UM.Theme.getSize("sidebar_margin").width / 2) + anchors.leftMargin: Math.round(UM.Theme.getSize("sidebar_margin").width / 2) text: catalog.i18nc("@label", "Enable gradual") font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") @@ -737,7 +737,7 @@ Item visible: enableSupportCheckBox.visible anchors.top: infillCellRight.bottom - anchors.topMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height * 1.5) + anchors.topMargin: Math.round(UM.Theme.getSize("sidebar_margin").height * 1.5) anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width anchors.right: infillCellLeft.right @@ -823,7 +823,7 @@ Item anchors.topMargin: ((supportEnabled.properties.value === "True") && (machineExtruderCount.properties.value > 1)) ? UM.Theme.getSize("sidebar_margin").height : 0 anchors.left: infillCellRight.left - width: Math.floor(UM.Theme.getSize("sidebar").width * .55) + width: Math.round(UM.Theme.getSize("sidebar").width * .55) height: ((supportEnabled.properties.value == "True") && (machineExtruderCount.properties.value > 1)) ? UM.Theme.getSize("setting_control").height : 0 Behavior on height { NumberAnimation { duration: 100 } } @@ -952,7 +952,7 @@ Item { id: tipsCell anchors.top: adhesionCheckBox.visible ? adhesionCheckBox.bottom : (enableSupportCheckBox.visible ? supportExtruderCombobox.bottom : infillCellRight.bottom) - anchors.topMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height * 2) + anchors.topMargin: Math.round(UM.Theme.getSize("sidebar_margin").height * 2) anchors.left: parent.left width: parent.width height: tipsText.contentHeight * tipsText.lineCount diff --git a/resources/qml/SidebarTooltip.qml b/resources/qml/SidebarTooltip.qml index 5809bf19db..6756763c8a 100644 --- a/resources/qml/SidebarTooltip.qml +++ b/resources/qml/SidebarTooltip.qml @@ -36,7 +36,7 @@ UM.PointingRectangle { } } base.opacity = 1; - target = Qt.point(40 , position.y + Math.floor(UM.Theme.getSize("tooltip_arrow_margins").height / 2)) + target = Qt.point(40 , position.y + Math.round(UM.Theme.getSize("tooltip_arrow_margins").height / 2)) } function hide() { diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 55b56ea2d8..613a462db9 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -91,7 +91,7 @@ Item anchors.topMargin: base.activeY z: buttons.z -1 - target: Qt.point(parent.right, base.activeY + Math.floor(UM.Theme.getSize("button").height/2)) + target: Qt.point(parent.right, base.activeY + Math.round(UM.Theme.getSize("button").height/2)) arrowSize: UM.Theme.getSize("default_arrow").width width: diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index 0a6bb0835c..2fbbe2180c 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -219,7 +219,7 @@ Rectangle anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.right: viewModeButton.right - property var buttonTarget: Qt.point(viewModeButton.x + Math.floor(viewModeButton.width / 2), viewModeButton.y + Math.floor(viewModeButton.height / 2)) + property var buttonTarget: Qt.point(viewModeButton.x + Math.round(viewModeButton.width / 2), viewModeButton.y + Math.round(viewModeButton.height / 2)) height: childrenRect.height width: childrenRect.width diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 2c4417ba86..6b454b7cf1 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -121,13 +121,13 @@ QtObject { Item { anchors.centerIn: parent - width: Math.floor(textLabel.width + icon.width + Theme.getSize("default_margin").width / 2) + width: Math.round(textLabel.width + icon.width + Theme.getSize("default_margin").width / 2) Label { id: textLabel text: control.text anchors.right: icon.visible ? icon.left : parent.right - anchors.rightMargin: icon.visible ? Math.floor(Theme.getSize("default_margin").width / 2) : 0 + anchors.rightMargin: icon.visible ? Math.round(Theme.getSize("default_margin").width / 2) : 0 anchors.verticalCenter: parent.verticalCenter; font: control.checked ? UM.Theme.getFont("large") : UM.Theme.getFont("large_nonbold") color: @@ -268,7 +268,7 @@ QtObject { anchors.leftMargin: Theme.getSize("button_tooltip_arrow").width * 2 anchors.verticalCenter: parent.verticalCenter - target: Qt.point(parent.x, y + Math.floor(height/2)) + target: Qt.point(parent.x, y + Math.round(height/2)) arrowSize: Theme.getSize("button_tooltip_arrow").width color: Theme.getColor("button_tooltip") opacity: control.hovered ? 1.0 : 0.0; @@ -329,9 +329,9 @@ QtObject { UM.RecolorImage { id: tool_button_arrow anchors.right: parent.right; - anchors.rightMargin: Theme.getSize("button").width - Math.floor(Theme.getSize("button_icon").width / 4) + anchors.rightMargin: Theme.getSize("button").width - Math.round(Theme.getSize("button_icon").width / 4) anchors.bottom: parent.bottom; - anchors.bottomMargin: Theme.getSize("button").height - Math.floor(Theme.getSize("button_icon").height / 4) + anchors.bottomMargin: Theme.getSize("button").height - Math.round(Theme.getSize("button_icon").height / 4) width: Theme.getSize("standard_arrow").width height: Theme.getSize("standard_arrow").height sourceSize.width: width @@ -669,7 +669,7 @@ QtObject { id: category_arrow anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: Theme.getSize("default_margin").width * 3 - Math.floor(width / 2) + anchors.rightMargin: Theme.getSize("default_margin").width * 3 - Math.round(width / 2) width: Theme.getSize("standard_arrow").width height: Theme.getSize("standard_arrow").height sourceSize.width: width @@ -712,14 +712,14 @@ QtObject { scrollBarBackground: Rectangle { implicitWidth: Theme.getSize("scrollbar").width - radius: Math.floor(implicitWidth / 2) + radius: Math.round(implicitWidth / 2) color: Theme.getColor("scrollbar_background"); } handle: Rectangle { id: scrollViewHandle implicitWidth: Theme.getSize("scrollbar").width; - radius: Math.floor(implicitWidth / 2) + radius: Math.round(implicitWidth / 2) color: styleData.pressed ? Theme.getColor("scrollbar_handle_down") : styleData.hovered ? Theme.getColor("scrollbar_handle_hover") : Theme.getColor("scrollbar_handle"); Behavior on color { ColorAnimation { duration: 50; } } @@ -806,12 +806,12 @@ QtObject { Rectangle { id: swatch - height: Math.floor(UM.Theme.getSize("setting_control").height / 2) + height: Math.round(UM.Theme.getSize("setting_control").height / 2) width: height anchors.right: downArrow.left anchors.verticalCenter: parent.verticalCenter - anchors.margins: Math.floor(UM.Theme.getSize("default_margin").width / 4) - radius: Math.floor(width / 2) + anchors.margins: Math.round(UM.Theme.getSize("default_margin").width / 4) + radius: Math.round(width / 2) border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") color: (control.color_override !== "") ? control.color_override : control.color @@ -845,7 +845,7 @@ QtObject { color: (control.hovered || control._hovered) ? Theme.getColor("checkbox_hover") : Theme.getColor("checkbox"); Behavior on color { ColorAnimation { duration: 50; } } - radius: control.exclusiveGroup ? Math.floor(Theme.getSize("checkbox").width / 2) : 0 + radius: control.exclusiveGroup ? Math.round(Theme.getSize("checkbox").width / 2) : 0 border.width: Theme.getSize("default_lining").width; border.color: (control.hovered || control._hovered) ? Theme.getColor("checkbox_border_hover") : Theme.getColor("checkbox_border"); @@ -853,8 +853,8 @@ QtObject { UM.RecolorImage { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.floor(parent.width / 2.5) - height: Math.floor(parent.height / 2.5) + width: Math.round(parent.width / 2.5) + height: Math.round(parent.height / 2.5) sourceSize.width: width sourceSize.height: width color: Theme.getColor("checkbox_mark") @@ -882,7 +882,7 @@ QtObject { color: (control.hovered || control._hovered) ? Theme.getColor("checkbox_hover") : Theme.getColor("checkbox"); Behavior on color { ColorAnimation { duration: 50; } } - radius: control.exclusiveGroup ? Math.floor(Theme.getSize("checkbox").width / 2) : 0 + radius: control.exclusiveGroup ? Math.round(Theme.getSize("checkbox").width / 2) : 0 border.width: Theme.getSize("default_lining").width; border.color: (control.hovered || control._hovered) ? Theme.getColor("checkbox_border_hover") : Theme.getColor("checkbox_border"); @@ -890,8 +890,8 @@ QtObject { UM.RecolorImage { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.floor(parent.width / 2.5) - height: Math.floor(parent.height / 2.5) + width: Math.round(parent.width / 2.5) + height: Math.round(parent.height / 2.5) sourceSize.width: width sourceSize.height: width color: Theme.getColor("checkbox_mark") @@ -925,7 +925,7 @@ QtObject { border.width: Theme.getSize("default_lining").width; border.color: Theme.getColor("slider_groove_border"); - radius: Math.floor(width / 2); + radius: Math.round(width / 2); Rectangle { anchors { @@ -934,8 +934,8 @@ QtObject { bottom: parent.bottom; } color: Theme.getColor("slider_groove_fill"); - width: Math.floor((control.value / (control.maximumValue - control.minimumValue)) * parent.width); - radius: Math.floor(width / 2); + width: Math.round((control.value / (control.maximumValue - control.minimumValue)) * parent.width); + radius: Math.round(width / 2); } } handle: Rectangle { @@ -944,7 +944,7 @@ QtObject { color: control.hovered ? Theme.getColor("slider_handle_hover") : Theme.getColor("slider_handle"); border.width: Theme.getSize("default_lining").width border.color: control.hovered ? Theme.getColor("slider_handle_hover_border") : Theme.getColor("slider_handle_border") - radius: Math.floor(Theme.getSize("slider_handle").width / 2); //Round. + radius: Math.round(Theme.getSize("slider_handle").width / 2); //Round. Behavior on color { ColorAnimation { duration: 50; } } } }