Cura/plugins/PerObjectSettingsTool/PerObjectCategory.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

66 lines
1.9 KiB
QML

// Copyright (c) 2022 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 2.1
import UM 1.5 as UM
import Cura 1.0 as Cura
import ".."
Button {
id: base;
background: Item {}
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 ? palette.highlight : palette.buttonText
}
}
UM.RecolorImage
{
anchors.verticalCenter: parent.verticalCenter
height: label.height
width: height
source: UM.Theme.getIcon(definition.icon)
color: base.hovered ? palette.highlight : palette.buttonText
}
UM.Label
{
id: label
anchors.verticalCenter: parent.verticalCenter
text: base.text
color: base.hovered ? palette.highlight : palette.buttonText
font.bold: true
}
SystemPalette { id: palette }
}
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)
}