Remove margins that keep listview items from being under the scrollbar. Instead set width of listView smaller so it doesn't overlap.

Update per object setting visibility dialog to have same category design as SettingVisibilityCategory.qml and SettingCategory.qml

CURA-9005
This commit is contained in:
j.delarago 2022-03-07 13:20:05 +01:00
parent 798e86646c
commit 76d9cf6f4d
5 changed files with 12 additions and 59 deletions

View file

@ -8,58 +8,16 @@ import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
import ".." import ".."
Button { UM.CategoryButton {
id: base; id: base;
background: Rectangle { categoryIcon: definition ? UM.Theme.getIcon(definition.icon) : ""
color: UM.Theme.getColor("category_background") labelText: definition ? definition.label : ""
} expanded: definition ? definition.expanded : false
contentItem: Row
{
spacing: UM.Theme.getSize("default_lining").width
Item //Wrapper to give space before icon with fixed width. This allows aligning checkbox with category icon.
{
height: label.height
width: height
anchors.verticalCenter: parent.verticalCenter
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
height: (label.height / 2) | 0
width: height
source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight")
color: base.hovered ? UM.Theme.getColor("primary_button_hover"): UM.Theme.getColor("text")
}
}
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
height: label.height
width: height
source: UM.Theme.getIcon(definition.icon)
color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("text")
}
UM.Label
{
id: label
anchors.verticalCenter: parent.verticalCenter
text: base.text
color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("text")
font.bold: true
}
}
signal showTooltip(string text) signal showTooltip(string text)
signal hideTooltip() signal hideTooltip()
signal contextMenuRequested() signal contextMenuRequested()
text: definition.label onClicked: expanded ? settingDefinitionsModel.collapseRecursive(definition.key) : settingDefinitionsModel.expandRecursive(definition.key)
checkable: true
checked: definition.expanded
onClicked: definition.expanded ? settingDefinitionsModel.collapseRecursive(definition.key) : settingDefinitionsModel.expandRecursive(definition.key)
} }

View file

@ -10,19 +10,12 @@ import Cura 1.0 as Cura
UM.TooltipArea UM.TooltipArea
{ {
x: model.depth * UM.Theme.getSize("default_margin").width x: model.depth * UM.Theme.getSize("narrow_margin").width
text: model.description text: model.description
width: childrenRect.width width: childrenRect.width
height: childrenRect.height height: childrenRect.height
Item
{
id: spacer
// Align checkbox with PerObjectCategory icon
width: UM.Theme.getSize("default_margin").width
}
UM.CheckBox UM.CheckBox
{ {
id: check id: check

View file

@ -12,6 +12,8 @@ UM.Dialog
{ {
id: settingPickDialog id: settingPickDialog
margin: UM.Theme.getSize("default_margin").width
title: catalog.i18nc("@title:window", "Select Settings to Customize for this model") title: catalog.i18nc("@title:window", "Select Settings to Customize for this model")
width: UM.Theme.getSize("small_popup_dialog").width width: UM.Theme.getSize("small_popup_dialog").width
backgroundColor: UM.Theme.getColor("background_1") backgroundColor: UM.Theme.getColor("background_1")

View file

@ -150,7 +150,7 @@ UM.PreferencesPage
} }
clip: true clip: true
ScrollBar.vertical: UM.ScrollBar {} ScrollBar.vertical: UM.ScrollBar { id: scrollBar }
model: UM.SettingDefinitionsModel model: UM.SettingDefinitionsModel
{ {
@ -167,7 +167,7 @@ UM.PreferencesPage
{ {
id: loader id: loader
width: settingsListView.width width: settingsListView.width - scrollBar.width
height: model.type != undefined ? UM.Theme.getSize("section").height : 0 height: model.type != undefined ? UM.Theme.getSize("section").height : 0
property var definition: model property var definition: model

View file

@ -191,7 +191,7 @@ Item
} }
clip: true clip: true
cacheBuffer: 1000000 // Set a large cache to effectively just cache every list item. cacheBuffer: 1000000 // Set a large cache to effectively just cache every list item.
ScrollBar.vertical: UM.ScrollBar {} ScrollBar.vertical: UM.ScrollBar { id: scrollBar }
model: UM.SettingDefinitionsModel model: UM.SettingDefinitionsModel
{ {
@ -218,7 +218,7 @@ Item
{ {
id: delegate id: delegate
width: contents.width width: contents.width - scrollBar.width
Behavior on height { NumberAnimation { duration: 100 } } Behavior on height { NumberAnimation { duration: 100 } }
opacity: enabled ? 1 : 0 opacity: enabled ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 100 } } Behavior on opacity { NumberAnimation { duration: 100 } }