From 0e008894f21634cd346d7b4e82fe17700627f633 Mon Sep 17 00:00:00 2001 From: JohnDoe6345789 Date: Fri, 26 Dec 2025 06:38:33 +0000 Subject: [PATCH] update: qt6,frontends,qml (4 files) --- .../qt6/qmllib/Material/MaterialButton.qml | 20 +++++++++---------- .../qt6/qmllib/Material/MaterialCard.qml | 4 ++-- .../qt6/qmllib/Material/MaterialPalette.qml | 2 ++ frontends/qt6/qmllib/Material/qmldir | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/frontends/qt6/qmllib/Material/MaterialButton.qml b/frontends/qt6/qmllib/Material/MaterialButton.qml index 059bbe97b..3ce4c3665 100644 --- a/frontends/qt6/qmllib/Material/MaterialButton.qml +++ b/frontends/qt6/qmllib/Material/MaterialButton.qml @@ -9,34 +9,34 @@ Rectangle { property alias text: label.text property bool outlined: false property bool elevated: true - property color fillColor: outlined ? "transparent" : MaterialPalette.palette.primary - property color borderColor: outlined ? MaterialPalette.palette.outline : "transparent" - property color textColor: outlined ? MaterialPalette.palette.primary : MaterialPalette.palette.onPrimary + property color fillColor: outlined ? "transparent" : MaterialPalette.primary + property color borderColor: outlined ? MaterialPalette.outline : "transparent" + property color textColor: outlined ? MaterialPalette.primary : MaterialPalette.onPrimary property bool disabled: false property real cornerRadius: 12 signal clicked() implicitHeight: 48 radius: cornerRadius - color: disabled ? MaterialPalette.palette.surfaceVariant : fillColor - border.color: disabled ? MaterialPalette.palette.surfaceVariant : borderColor + color: disabled ? MaterialPalette.surfaceVariant : fillColor + border.color: disabled ? MaterialPalette.surfaceVariant : borderColor border.width: outlined ? 1 : 0 layer.enabled: elevated && !outlined && !disabled layer.effect: DropShadow { anchors.fill: parent horizontalOffset: 0 verticalOffset: 4 - radius: 16 - samples: 16 - color: "#22000000" - } + radius: 16 + samples: 16 + color: "#22000000" + } Text { id: label anchors.centerIn: parent font.pixelSize: 15 font.bold: true - color: disabled ? MaterialPalette.palette.surface : textColor + color: disabled ? MaterialPalette.surface : textColor } MouseArea { diff --git a/frontends/qt6/qmllib/Material/MaterialCard.qml b/frontends/qt6/qmllib/Material/MaterialCard.qml index ef270a661..166bf3cee 100644 --- a/frontends/qt6/qmllib/Material/MaterialCard.qml +++ b/frontends/qt6/qmllib/Material/MaterialCard.qml @@ -8,13 +8,13 @@ Rectangle { id: card property alias contentItem: contentLoader.sourceComponent property real cornerRadius: 16 - property color surfaceColor: MaterialPalette.palette.surface + property color surfaceColor: MaterialPalette.surface property real elevation: MaterialPalette.palette.elevationLow width: parent ? parent.width : 320 radius: cornerRadius color: surfaceColor - border.color: MaterialPalette.palette.outline + border.color: MaterialPalette.outline border.width: 1 layer.enabled: true layer.effect: DropShadow { diff --git a/frontends/qt6/qmllib/Material/MaterialPalette.qml b/frontends/qt6/qmllib/Material/MaterialPalette.qml index a5f469fbe..07a949014 100644 --- a/frontends/qt6/qmllib/Material/MaterialPalette.qml +++ b/frontends/qt6/qmllib/Material/MaterialPalette.qml @@ -1,5 +1,7 @@ import QtQuick 2.15 +pragma Singleton + QtObject { id: palette diff --git a/frontends/qt6/qmllib/Material/qmldir b/frontends/qt6/qmllib/Material/qmldir index c2b82385b..388745b39 100644 --- a/frontends/qt6/qmllib/Material/qmldir +++ b/frontends/qt6/qmllib/Material/qmldir @@ -1,5 +1,5 @@ module Material -MaterialPalette 1.0 MaterialPalette.qml +singleton MaterialPalette 1.0 MaterialPalette.qml MaterialButton 1.0 MaterialButton.qml MaterialCard 1.0 MaterialCard.qml MaterialTextField 1.0 MaterialTextField.qml