Fix flickable with custom scrollbar

A bit of a hassle with the scrollbar overlapping the background here.

Contributes to issue CURA-8686.
This commit is contained in:
Ghostkeeper 2022-01-18 18:13:13 +01:00
parent 1cc3aecd8c
commit ae81b5e3e7
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -1,11 +1,11 @@
// Copyright (c) 2020 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -45,7 +45,7 @@ UM.TooltipArea
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
ScrollView Flickable
{ {
anchors.top: titleLabel.bottom anchors.top: titleLabel.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height anchors.topMargin: UM.Theme.getSize("default_margin").height
@ -53,26 +53,9 @@ UM.TooltipArea
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
background: Rectangle ScrollBar.vertical: UM.ScrollBar {}
{
color: UM.Theme.getColor("main_background")
anchors.fill: parent
border.color: TextArea.flickable: TextArea
{
if (!gcodeTextArea.enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if (gcodeTextArea.hovered || gcodeTextArea.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
}
TextArea
{ {
id: gcodeTextArea id: gcodeTextArea
@ -92,6 +75,27 @@ UM.TooltipArea
propertyProvider.setPropertyValue("value", text) propertyProvider.setPropertyValue("value", text)
} }
} }
background: Rectangle
{
color: UM.Theme.getColor("main_background")
anchors.fill: parent
anchors.margins: -border.width //Wrap the border around the parent.
border.color:
{
if (!gcodeTextArea.enabled)
{
return UM.Theme.getColor("setting_control_disabled_border")
}
if (gcodeTextArea.hovered || gcodeTextArea.activeFocus)
{
return UM.Theme.getColor("setting_control_border_highlight")
}
return UM.Theme.getColor("setting_control_border")
}
border.width: UM.Theme.getSize("default_lining").width
}
} }
} }
} }