Update ScrollView to Controls 2 and customise with scrollbar

Contributes to issue CURA-8686.
This commit is contained in:
Ghostkeeper 2022-01-19 14:14:03 +01:00
parent 509c9068eb
commit 7e1b92953c
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -2,12 +2,11 @@
// 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 1.1 import QtQuick.Controls 1.1 as OldControls
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls 2.3 as NewControls import UM 1.5 as UM
import UM 1.1 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
UM.PreferencesPage UM.PreferencesPage
@ -133,10 +132,22 @@ UM.PreferencesPage
width: parent.width width: parent.width
height: parent.height height: parent.height
ScrollBar.vertical: UM.ScrollBar
{
id: preferencesScrollBar
parent: preferencesScrollView
anchors
{
top: parent.top
bottom: parent.bottom
right: parent.right
}
}
Column Column
{ {
UM.I18nCatalog{id: catalog; name: "cura"} UM.I18nCatalog{id: catalog; name: "cura"}
width: preferencesScrollView.viewport.width width: preferencesScrollView.width - preferencesScrollBar.width
Label Label
{ {
@ -188,7 +199,7 @@ UM.PreferencesPage
} }
} }
NewControls.ComboBox ComboBox
{ {
id: languageComboBox id: languageComboBox
@ -242,7 +253,7 @@ UM.PreferencesPage
} }
} }
NewControls.ComboBox ComboBox
{ {
id: themeComboBox id: themeComboBox
@ -518,7 +529,7 @@ UM.PreferencesPage
} }
} }
NewControls.ComboBox ComboBox
{ {
id: cameraComboBox id: cameraComboBox
@ -675,7 +686,7 @@ UM.PreferencesPage
text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ") text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ")
} }
NewControls.ComboBox ComboBox
{ {
id: choiceOnOpenProjectDropDownButton id: choiceOnOpenProjectDropDownButton
width: Math.round(250 * screenScaleFactor) width: Math.round(250 * screenScaleFactor)
@ -742,7 +753,7 @@ UM.PreferencesPage
text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ") text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ")
} }
NewControls.ComboBox ComboBox
{ {
id: choiceOnProfileOverrideDropDownButton id: choiceOnProfileOverrideDropDownButton
width: Math.round(250 * screenScaleFactor) width: Math.round(250 * screenScaleFactor)
@ -845,7 +856,7 @@ UM.PreferencesPage
} }
} }
ExclusiveGroup { id: curaUpdatesGroup } OldControls.ExclusiveGroup { id: curaUpdatesGroup }
UM.TooltipArea UM.TooltipArea
{ {
width: childrenRect.width width: childrenRect.width
@ -853,7 +864,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.") text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.")
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
RadioButton OldControls.RadioButton
{ {
text: catalog.i18nc("@option:radio", "Stable releases only") text: catalog.i18nc("@option:radio", "Stable releases only")
exclusiveGroup: curaUpdatesGroup exclusiveGroup: curaUpdatesGroup
@ -869,7 +880,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.") text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.")
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.leftMargin: UM.Theme.getSize("default_margin").width
RadioButton OldControls.RadioButton
{ {
text: catalog.i18nc("@option:radio", "Stable and Beta releases") text: catalog.i18nc("@option:radio", "Stable and Beta releases")
exclusiveGroup: curaUpdatesGroup exclusiveGroup: curaUpdatesGroup