import QtQuick import Weave.Controls import Weave.Templates as T T.EmptyState { id: root T.TableLayout.horizontalFillMode: T.TableLayout.Preferred T.TableLayout.verticalFillMode: T.TableLayout.Preferred T.TableLayout.minimumWidth: contentItem.T.TableLayout.minimumWidth T.TableLayout.minimumHeight: contentItem.T.TableLayout.minimumHeight implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) hoverEnabled: root.enabled contentItem: Item { id: content readonly property real percentageWidth: { switch (root.containerSize) { case EmptyState.Small: return 0.65 case EmptyState.Medium: return 0.6 case EmptyState.Large: return 0.5 case EmptyState.ExtraSmall: default: return 0.7 } } implicitWidth: Math.min(column.implicitWidth, Theme.component.emptystate.maxWidth) / percentageWidth implicitHeight: column.implicitHeight T.TableLayout.minimumWidth: Math.max(column.minimumWidth, Theme.component.emptystate.minWidth) / percentageWidth T.TableLayout.minimumHeight: column.minimumHeight T.TableLayoutColumn { id: column anchors.horizontalCenter: content.horizontalCenter width: Math.max(Theme.component.emptystate.minWidth, Math.min(content.width * content.percentageWidth, Theme.component.emptystate.maxWidth)) height: content.height horizontalItemFillMode: T.TableLayout.Preferred verticalAlignment: TableLayout.AlignVCenter H1Regular { id: title T.TableLayout.leftMargin: Theme.component.emptystate.headline.marginLeft T.TableLayout.topMargin: Theme.component.emptystate.headline.marginTop T.TableLayout.rightMargin: Theme.component.emptystate.headline.marginRight T.TableLayout.bottomMargin: Theme.component.emptystate.headline.marginBottom text: root.title horizontalAlignment: Text.AlignHCenter wrapMode: Text.Wrap } Image { T.TableLayout.leftMargin: Theme.component.emptystate.illustrationContainer.marginLeft T.TableLayout.topMargin: Theme.component.emptystate.illustrationContainer.marginTop T.TableLayout.rightMargin: Theme.component.emptystate.illustrationContainer.marginRight T.TableLayout.bottomMargin: Theme.component.emptystate.illustrationContainer.marginBottom T.TableLayout.optional: true source: root.source sourceSize: Qt.size(root.illustrationWidth, root.illustrationHeight) fillMode: Image.PreserveAspectFit } H3Medium { text: root.description horizontalAlignment: Text.AlignHCenter wrapMode: Text.Wrap } BodyRegular { text: root.solution horizontalAlignment: Text.AlignHCenter wrapMode: Text.Wrap } Button { T.TableLayout.leftMargin: Theme.component.emptystate.actionsContainer.marginLeft T.TableLayout.topMargin: Theme.component.emptystate.actionsContainer.marginTop T.TableLayout.rightMargin: Theme.component.emptystate.actionsContainer.marginRight T.TableLayout.bottomMargin: Theme.component.emptystate.actionsContainer.marginBottom T.TableLayout.horizontalFillMode: T.TableLayout.Maximum T.TableLayout.horizontalAlignment: T.TableLayout.AlignHCenter text: root.actionButtonText style: Button.Solid onClicked: root.actionButtonClicked() } } } }