From 9b6964c5db2ff46fb9f604dcb0ecd5ec86942c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Mon, 8 May 2023 16:23:55 +0800 Subject: Page & ToolBar --- Bootstrap.qrc | 2 ++ Page.qml | 22 ++++++++++++++++++++++ ToolBar.qml | 17 +++++++++++++++++ qootstrap.pro | 4 +++- 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Page.qml create mode 100644 ToolBar.qml diff --git a/Bootstrap.qrc b/Bootstrap.qrc index f6b076d..f32ddff 100644 --- a/Bootstrap.qrc +++ b/Bootstrap.qrc @@ -2,5 +2,7 @@ ApplicationWindow.qml Label.qml + Page.qml + ToolBar.qml diff --git a/Page.qml b/Page.qml new file mode 100644 index 0000000..5087484 --- /dev/null +++ b/Page.qml @@ -0,0 +1,22 @@ +import QtQuick 2.15 +import QtQuick.Templates 2.15 +import Bootstrap 5.3 + +Page { + id: control + implicitWidth: Math.max(implicitBackgroundWidth + + leftInset + rightInset, + contentWidth + leftPadding + rightPadding, + implicitHeaderWidth, + implicitFooterWidth) + implicitHeight: Math.max(implicitBackgroundHeight + + topInset + bottomInset, + contentHeight + topPadding + bottomPadding + + (implicitHeaderHeight > 0 + ? implicitHeaderHeight + spacing : 0) + + (implicitFooterHeight > 0 + ? implicitFooterHeight + spacing : 0)) + background: Rectangle { + color: control.Bootstrap.bodyBg + } +} diff --git a/ToolBar.qml b/ToolBar.qml new file mode 100644 index 0000000..4834c70 --- /dev/null +++ b/ToolBar.qml @@ -0,0 +1,17 @@ +import QtQuick 2.15 +import QtQuick.Templates 2.15 +import Bootstrap 5.3 + +ToolBar { + id: control + implicitWidth: Math.max(implicitBackgroundWidth + + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + background: Rectangle { + implicitHeight: 40 + color: control.Bootstrap.bodyBg + } +} diff --git a/qootstrap.pro b/qootstrap.pro index 3af6b2e..5864277 100644 --- a/qootstrap.pro +++ b/qootstrap.pro @@ -11,7 +11,9 @@ import.path = $$[QT_INSTALL_QML]/$$QML_IMPORT_NAME style.files = \ ApplicationWindow.qml \ - Label.qml + Label.qml \ + Page.qml \ + ToolBar.qml style.path = $$[QT_INSTALL_QML]/QtQuick/Controls.2/$$QML_IMPORT_NAME HEADERS += $${QML_IMPORT_NAME}.hxx -- cgit v1.2.3