diff --git a/frontends/qt6/qmllib/Material/MaterialLink.qml b/frontends/qt6/qmllib/Material/MaterialLink.qml new file mode 100644 index 000000000..e268832ee --- /dev/null +++ b/frontends/qt6/qmllib/Material/MaterialLink.qml @@ -0,0 +1,25 @@ +import QtQuick 2.15 + +import "MaterialPalette.qml" as MaterialPalette + +Text { + id: link + property alias url: mouseArea.url + property string href: "" + property color hoverColor: MaterialPalette.primary + color: MaterialPalette.primary + font.pixelSize: 14 + font.bold: false + textDecoration: "underline" + MouseArea { + id: mouseArea + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onEntered: link.color = hoverColor + onExited: link.color = MaterialPalette.primary + onClicked: { + if (href.length > 0) Qt.openUrlExternally(href) + } + } +} diff --git a/frontends/qt6/qmllib/Material/MaterialPaper.qml b/frontends/qt6/qmllib/Material/MaterialPaper.qml new file mode 100644 index 000000000..b579ef761 --- /dev/null +++ b/frontends/qt6/qmllib/Material/MaterialPaper.qml @@ -0,0 +1,14 @@ +import QtQuick 2.15 +import "MaterialSurface.qml" as Surface + +Surface.MaterialSurface { + id: paper + property alias content: paperLoader.sourceComponent + + Loader { + id: paperLoader + anchors.fill: parent + anchors.margins: 12 + sourceComponent: content + } +} diff --git a/frontends/qt6/qmllib/Material/MaterialTypography.qml b/frontends/qt6/qmllib/Material/MaterialTypography.qml new file mode 100644 index 000000000..c5990a40a --- /dev/null +++ b/frontends/qt6/qmllib/Material/MaterialTypography.qml @@ -0,0 +1,18 @@ +import QtQuick 2.15 + +import "MaterialPalette.qml" as MaterialPalette + +Text { + id: typ + property alias content: text + property string variant: "body1" + + color: MaterialPalette.onSurface + font.pixelSize: variant === "h1" ? 32 : + variant === "h2" ? 28 : + variant === "h3" ? 24 : + variant === "h4" ? 20 : + variant === "button" ? 16 : + 14 + font.bold: variant === "h1" || variant === "h2" || variant === "h3" +}