Fix margins

The margin around the icon didn't work if the icon source was none, because it was provided a QSize rather than a real.
The margin around the background didn't work at all because the background is automatically adjusted to fill the parent element, so it's best left out.

Contributes to issue CURA-8009.
This commit is contained in:
Ghostkeeper 2021-07-13 16:04:01 +02:00
parent 7fdf1dbdd4
commit 3d6601a37e
No known key found for this signature in database
GPG key ID: 68F39EA88EEED5FF

View file

@ -1,4 +1,4 @@
// Copyright (c) 2019 Ultimaker B.V.
// Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
@ -24,7 +24,7 @@ TextField
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
leftPadding: iconLeft.visible ? iconLeft.width + UM.Theme.getSize("default_margin").width * 2 : UM.Theme.getSize("thin_margin")
leftPadding: iconLeft.visible ? iconLeft.width + UM.Theme.getSize("default_margin").width * 2 : UM.Theme.getSize("thin_margin").width
states: [
State
@ -55,7 +55,6 @@ TextField
color: UM.Theme.getColor("main_background")
anchors.margins: Math.round(UM.Theme.getSize("default_lining").width)
radius: UM.Theme.getSize("setting_control_radius").width
border.color: