diff --git a/AppCard.qml b/AppCard.qml new file mode 100644 index 0000000..e7f2c63 --- /dev/null +++ b/AppCard.qml @@ -0,0 +1,28 @@ +import QtQuick +import QtQuick.Controls.Basic + +Item { + id: root + + property real padding: 10 + + // Automatically size based on content plus padding + implicitWidth: contentItem.childrenRect.width + padding * 2 + implicitHeight: contentItem.childrenRect.height + padding * 2 + + // Background + Rectangle { + anchors.fill: parent + color: Theme.card + radius: Theme.radius + } + + // This allows direct assignment of children to AppCard + default property alias content: contentItem.children + // Content container + Item { + id: contentItem + anchors.fill: parent + anchors.margins: padding + } +} diff --git a/CMakeLists.txt b/CMakeLists.txt index fdca990..f89a276 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set(plain_qml_files AppText.qml AppIcon.qml AppPrimaryButton.qml + AppCard.qml ) set(qml_singletons Fonts.qml