From 84b2045b5f17227e61e851b12bace6700abd5972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Thu, 4 Apr 2024 02:48:26 +0800 Subject: [PATCH] update --- example/src/main.cpp | 12 ++++++------ .../FluentUI/Controls/FluTextBoxBackground.qml | 4 ++-- .../FluentUI/Controls/FluTextBoxBackground.qml | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/example/src/main.cpp b/example/src/main.cpp index ca39b245..be38a0b5 100644 --- a/example/src/main.cpp +++ b/example/src/main.cpp @@ -32,8 +32,11 @@ Q_IMPORT_QML_PLUGIN(FluentUIPlugin) int main(int argc, char *argv[]) { + const char *uri = "example"; + int major = 1; + int minor = 0; #ifdef WIN32 -// ::SetUnhandledExceptionFilter(MyUnhandledExceptionFilter); + ::SetUnhandledExceptionFilter(MyUnhandledExceptionFilter); qputenv("QT_QPA_PLATFORM","windows:darkmode=2"); #endif #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) @@ -54,8 +57,8 @@ int main(int argc, char *argv[]) QGuiApplication::setApplicationVersion(APPLICATION_VERSION); QGuiApplication::setQuitOnLastWindowClosed(false); SettingsHelper::getInstance()->init(argv); - Log::setup(argv,"example"); -#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)) + Log::setup(argv,uri); +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL); #endif #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) @@ -66,9 +69,6 @@ int main(int argc, char *argv[]) #endif #endif QGuiApplication app(argc, argv); - const char *uri = "example"; - int major = 1; - int minor = 0; //@uri example qmlRegisterType(uri, major, minor, "CircularReveal"); qmlRegisterType(uri, major, minor, "FileWatcher"); diff --git a/src/Qt5/imports/FluentUI/Controls/FluTextBoxBackground.qml b/src/Qt5/imports/FluentUI/Controls/FluTextBoxBackground.qml index 82fd34df..f4ec61f8 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTextBoxBackground.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTextBoxBackground.qml @@ -20,13 +20,13 @@ FluControlBackground{ border.width: 1 gradient: Gradient { GradientStop { position: 0.0; color: d.startColor } - GradientStop { position: d.position; color: d.startColor } + GradientStop { position: 1 - 3/control.height; color: d.startColor } + GradientStop { position: 1 - 2/control.height; color: d.startColor } GradientStop { position: 1.0; color: d.endColor } } bottomMargin: inputItem && inputItem.activeFocus ? 2 : 1 QtObject{ id:d - property real position: 1 - 3/control.height property color startColor: FluTheme.dark ? Qt.rgba(66/255,66/255,66/255,1) : Qt.rgba(232/255,232/255,232/255,1) property color endColor: { if(!control.enabled){ diff --git a/src/Qt6/imports/FluentUI/Controls/FluTextBoxBackground.qml b/src/Qt6/imports/FluentUI/Controls/FluTextBoxBackground.qml index 96bc1c72..03dce01d 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTextBoxBackground.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTextBoxBackground.qml @@ -20,13 +20,13 @@ FluControlBackground{ border.width: 1 gradient: Gradient { GradientStop { position: 0.0; color: d.startColor } - GradientStop { position: d.position; color: d.startColor } + GradientStop { position: 1 - 3/control.height; color: d.startColor } + GradientStop { position: 1 - 2/control.height; color: d.startColor } GradientStop { position: 1.0; color: d.endColor } } bottomMargin: inputItem && inputItem.activeFocus ? 2 : 1 QtObject{ id:d - property real position: 1 - 3/control.height property color startColor: FluTheme.dark ? Qt.rgba(66/255,66/255,66/255,1) : Qt.rgba(232/255,232/255,232/255,1) property color endColor: { if(!control.enabled){