mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 17:59:00 +08:00
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:
parent
798e86646c
commit
76d9cf6f4d
@ -8,58 +8,16 @@ import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import ".."
|
||||
|
||||
Button {
|
||||
UM.CategoryButton {
|
||||
id: base;
|
||||
|
||||
background: Rectangle {
|
||||
color: UM.Theme.getColor("category_background")
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
categoryIcon: definition ? UM.Theme.getIcon(definition.icon) : ""
|
||||
labelText: definition ? definition.label : ""
|
||||
expanded: definition ? definition.expanded : false
|
||||
|
||||
signal showTooltip(string text)
|
||||
signal hideTooltip()
|
||||
signal contextMenuRequested()
|
||||
|
||||
text: definition.label
|
||||
|
||||
checkable: true
|
||||
checked: definition.expanded
|
||||
|
||||
onClicked: definition.expanded ? settingDefinitionsModel.collapseRecursive(definition.key) : settingDefinitionsModel.expandRecursive(definition.key)
|
||||
onClicked: expanded ? settingDefinitionsModel.collapseRecursive(definition.key) : settingDefinitionsModel.expandRecursive(definition.key)
|
||||
}
|
||||
|
@ -10,19 +10,12 @@ import Cura 1.0 as Cura
|
||||
|
||||
UM.TooltipArea
|
||||
{
|
||||
x: model.depth * UM.Theme.getSize("default_margin").width
|
||||
x: model.depth * UM.Theme.getSize("narrow_margin").width
|
||||
text: model.description
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
|
||||
Item
|
||||
{
|
||||
id: spacer
|
||||
// Align checkbox with PerObjectCategory icon
|
||||
width: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
UM.CheckBox
|
||||
{
|
||||
id: check
|
||||
|
@ -12,6 +12,8 @@ UM.Dialog
|
||||
{
|
||||
id: settingPickDialog
|
||||
|
||||
margin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
title: catalog.i18nc("@title:window", "Select Settings to Customize for this model")
|
||||
width: UM.Theme.getSize("small_popup_dialog").width
|
||||
backgroundColor: UM.Theme.getColor("background_1")
|
||||
|
@ -150,7 +150,7 @@ UM.PreferencesPage
|
||||
}
|
||||
|
||||
clip: true
|
||||
ScrollBar.vertical: UM.ScrollBar {}
|
||||
ScrollBar.vertical: UM.ScrollBar { id: scrollBar }
|
||||
|
||||
model: UM.SettingDefinitionsModel
|
||||
{
|
||||
@ -167,7 +167,7 @@ UM.PreferencesPage
|
||||
{
|
||||
id: loader
|
||||
|
||||
width: settingsListView.width
|
||||
width: settingsListView.width - scrollBar.width
|
||||
height: model.type != undefined ? UM.Theme.getSize("section").height : 0
|
||||
|
||||
property var definition: model
|
||||
|
@ -191,7 +191,7 @@ Item
|
||||
}
|
||||
clip: true
|
||||
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
|
||||
{
|
||||
@ -218,7 +218,7 @@ Item
|
||||
{
|
||||
id: delegate
|
||||
|
||||
width: contents.width
|
||||
width: contents.width - scrollBar.width
|
||||
Behavior on height { NumberAnimation { duration: 100 } }
|
||||
opacity: enabled ? 1 : 0
|
||||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||
|
Loading…
x
Reference in New Issue
Block a user