pragma ComponentBehavior: Bound import QtQuick import Weave.Controls import Weave.Templates as T import "internal" T.CheckDelegate { id: delegate T.TableLayout.minimumWidth: leftPadding + rightPadding + (contentItem ? contentItem.T.TableLayout.minimumWidth : implicitContentWidth) T.TableLayout.leftPadding: Math.max(T.TableLayout.leftLayoutPadding, Theme.component.table.cell.paddingLeft) T.TableLayout.rightPadding: Math.max(T.TableLayout.rightLayoutPadding, Theme.component.table.cell.paddingRight) T.TableLayout.topPadding: Math.max(T.TableLayout.topLayoutPadding, Theme.component.table.cell.paddingTop) T.TableLayout.bottomPadding: Math.max(T.TableLayout.bottomLayoutPadding, Theme.component.table.cell.paddingBottom) implicitWidth: leftPadding + rightPadding + implicitContentWidth implicitHeight: Math.max(Theme.component.table.cell.height, implicitContentHeight + topPadding + bottomPadding) leftPadding: T.TableLayout.leftPadding rightPadding: T.TableLayout.rightPadding topPadding: T.TableLayout.topPadding bottomPadding: T.TableLayout.bottomPadding checked: T.TableLayout.selected highlighted: activeFocus focus: delegate.T.TableLayout.focused font.family: Theme.component.table.fontFamily font.pixelSize: Theme.component.table.fontSize font.weight: Theme.component.table.fontWeight lineHeight: Theme.component.table.lineHeight icon.color: Theme.component.icon.fill icon.width: Theme.component.menu.icon.width icon.height: Theme.component.menu.icon.height indicator: T.IndicatorItemLoader { delegateItem: delegate leftMargin: Theme.component.menu.icon.marginLeft rightMargin: Theme.component.menu.icon.marginRight topMargin: Theme.component.menu.icon.marginTop bottomMargin: Theme.component.menu.icon.marginBottom horizontalItemAlignment: T.TableLayout.AlignHCenter verticalItemAlignment: T.TableLayout.AlignVCenter opacity: enabled && !delegate.T.TableLayout.moving ? 1.0 : Theme.component.menu.opacity.disabled sourceComponent: CheckBoxIndicator { checkState: delegate.checkState pressed: delegate.pressed hovered: delegate.hovered visualFocus: delegate.visualFocus } } decoration: T.DecorationItemLoader { delegateItem: delegate sourceComponent: T.IconImage { T.TableLayout.itemStatus: status icon: delegate.icon color: Theme.component.menu.icon.fill sourceSize { width: Theme.component.menu.icon.width height: Theme.component.menu.icon.height } } } contentItem: T.TableLayoutRow { id: content verticalItemAlignment: Text.AlignVCenter opacity: enabled ? 1.0 : Theme.component.menu.opacity.disabled T.TableLayoutProxyItem { target: delegate.indicator } T.TableLayoutLoader { sourceComponent: delegate.decoration leftMargin: Theme.component.menu.icon.marginLeft rightMargin: Theme.component.menu.icon.marginRight topMargin: Theme.component.menu.icon.marginTop bottomMargin: Theme.component.menu.icon.marginBottom } Text { id: label horizontalAlignment: delegate.display === T.ItemDelegate.TextUnderIcon ? Text.AlignHCenter : delegate.T.TableLayout.horizontalAlignment T.TableLayout.horizontalFillMode: T.TableLayout.Preferred T.TableLayout.wrapMode: delegate.display === T.ItemDelegate.TextUnderIcon ? T.TableLayout.AlwaysWrap : T.TableLayout.NoWrap T.TableLayout.minimumWidth: Math.min(Theme.component.table.cell.paddingRight + Theme.component.table.cell.paddingLeft, implicitWidth) T.TableLayout.preferredWidth: Math.max(implicitWidth, delegate.T.TableLayout.largestTextWidth) text: delegate.text font: delegate.font color: Theme.component.table.textColor lineHeight: delegate.lineHeight lineHeightMode: Text.FixedHeight elide: Text.ElideRight visible: !!text verticalAlignment: Text.AlignVCenter } } background: T.BackgroundItemLoader { delegateItem: delegate sourceComponent: T.CellBackground { id: backgroundItem opacity: enabled ? 1.0 : Theme.component.menu.opacity.disabled borderColor: { if (delegate.visualFocus) { return Theme.component.table.cell.borderColor.focus } else if (delegate.highlighted) { return Theme.component.table.cell.borderColor.selected } else { return "transparent" } } color: Theme.blendColor(Theme.component.table.backgroundColor, function() { if (delegate.pressed) { return delegate.highlighted ? Theme.component.table.cell.backgroundColor.selected.pressed : Theme.component.table.cell.backgroundColor.pressed } else if (delegate.hovered) { return delegate.highlighted ? Theme.component.table.cell.backgroundColor.selected.hover : Theme.component.table.cell.backgroundColor.hover } else if (delegate.highlighted) { return Theme.component.table.cell.backgroundColor.selected.default } else { return "transparent" } }()) } } }