Cura/plugins/PerObjectSettingsTool/PerObjectItem.qml
j.delarago c00eb5b432 Align checkbox with category icon in per object visibility settings dialog and preferences visibility settings.
Move "Information" icon to the right of checkboxes in settings visibilty preferences page. This allows clean aligning of checkboxes with category icon.

CURA-8688
2022-02-18 18:15:48 +01:00

55 lines
1.2 KiB
QML

// Copyright (c) 2015 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.1
import UM 1.5 as UM
import Cura 1.0 as Cura
UM.TooltipArea
{
x: model.depth * UM.Theme.getSize("default_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
anchors.left: spacer.right
text: definition.label
checked: addedSettingsModel.getVisible(model.key)
onClicked:
{
addedSettingsModel.setVisible(model.key, checked);
UM.ActiveTool.forceUpdate();
}
}
// When the user removes settings from the list addedSettingsModel, we need to recheck if the
// setting is visible or not to show a mark in the CheckBox.
Connections
{
target: addedSettingsModel
function onVisibleCountChanged()
{
check.checked = addedSettingsModel.getVisible(model.key)
}
}
}