Merge branch '3.2'

Lots of conflicts due to rounding vs. flooring of text element positions for weirdness with the font aliasing.
This commit is contained in:
Ghostkeeper 2018-02-14 10:53:51 +01:00
commit ee9de1f11b
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
48 changed files with 999 additions and 875 deletions

View file

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

View file

@ -1,9 +1,9 @@
// Copyright (c) 2015 Ultimaker B.V.
// Copyright (c) 2018 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import QtQuick 2.8
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.1
import UM 1.2 as UM
@ -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");

View file

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

View file

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

View file

@ -1,9 +1,9 @@
// Copyright (c) 2017 Ultimaker B.V.
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import QtQuick 2.8
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.1
import UM 1.1 as UM
import Cura 1.0 as Cura
@ -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
}

View file

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

View file

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

View file

@ -4,7 +4,7 @@
import QtQuick 2.7
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import QtQuick.Layouts 1.2
import UM 1.2 as UM
import Cura 1.0 as Cura
@ -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:
{