mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 23:04:57 +00:00
feat(styles): create global styles entry point and organize global styles feat(styles): implement base HTML element styles and utility classes for flexbox feat(styles): establish layout, position, spacing, and text utility classes feat(styles): introduce mixins for animations, cards, dialogs, flexbox, grid, and responsive design test(quick_guide): add component and metadata validation tests for quick_guide package test(ui_level6): implement metadata validation tests for ui_level6 package
72 lines
1.9 KiB
QML
72 lines
1.9 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
|
|
/**
|
|
* CErrorState.qml - Error state display (mirrors _error-state.scss)
|
|
* Shows error message with optional retry action
|
|
*/
|
|
Rectangle {
|
|
id: root
|
|
|
|
property string title: "Something went wrong"
|
|
property string message: ""
|
|
property string icon: "⚠️"
|
|
property bool showRetry: true
|
|
property string retryText: "Try Again"
|
|
|
|
signal retry()
|
|
|
|
color: Theme.errorContainer
|
|
radius: StyleVariables.radiusMd
|
|
|
|
implicitWidth: parent ? parent.width : 400
|
|
implicitHeight: contentCol.implicitHeight + StyleVariables.spacingLg * 2
|
|
|
|
ColumnLayout {
|
|
id: contentCol
|
|
anchors.centerIn: parent
|
|
width: parent.width - StyleVariables.spacingLg * 2
|
|
spacing: StyleVariables.spacingMd
|
|
|
|
// Icon
|
|
Text {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
text: root.icon
|
|
font.pixelSize: 48
|
|
}
|
|
|
|
// Title
|
|
Text {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
Layout.fillWidth: true
|
|
text: root.title
|
|
color: Theme.error
|
|
font.pixelSize: StyleVariables.fontSizeLg
|
|
font.weight: Font.DemiBold
|
|
horizontalAlignment: Text.AlignHCenter
|
|
wrapMode: Text.Wrap
|
|
}
|
|
|
|
// Message
|
|
Text {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
Layout.fillWidth: true
|
|
text: root.message
|
|
color: Theme.onErrorContainer
|
|
font.pixelSize: StyleVariables.fontSizeSm
|
|
horizontalAlignment: Text.AlignHCenter
|
|
wrapMode: Text.Wrap
|
|
visible: root.message !== ""
|
|
}
|
|
|
|
// Retry button
|
|
CButton {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
text: root.retryText
|
|
variant: "outlined"
|
|
visible: root.showRetry
|
|
onClicked: root.retry()
|
|
}
|
|
}
|
|
}
|