From dae5ce8782bbfb7a0f7d130838ce14f118f63df0 Mon Sep 17 00:00:00 2001 From: cutefishd Date: Thu, 18 Mar 2021 22:49:46 +0800 Subject: [PATCH] Fix font thread warning --- src/fontsmodel.cpp | 2 +- src/qml/AddUserDialog.qml | 1 + src/qml/AppearancePage.qml | 24 +++++++++++------------- src/qml/IconCheckBox.qml | 2 ++ src/qml/WirelessDetailsDialog.qml | 1 + 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/fontsmodel.cpp b/src/fontsmodel.cpp index 89ca6db..ff4acfa 100644 --- a/src/fontsmodel.cpp +++ b/src/fontsmodel.cpp @@ -33,8 +33,8 @@ FontsModel::FontsModel(QObject *parent) : QThread(parent) { - QThread::setPriority(QThread::HighestPriority); QThread::start(); + QThread::setPriority(QThread::HighestPriority); } void FontsModel::run() diff --git a/src/qml/AddUserDialog.qml b/src/qml/AddUserDialog.qml index 2a5f13c..e017952 100644 --- a/src/qml/AddUserDialog.qml +++ b/src/qml/AddUserDialog.qml @@ -58,6 +58,7 @@ Dialog { passwordField.text != "" && passwordField.text == verifyPasswordField.text DialogButtonBox.buttonRole: DialogButtonBox.Ok + flat: true onClicked: { if (manager.createUser(userNameField.text, "", accountTypeCombo.currentIndex)) control.accept() diff --git a/src/qml/AppearancePage.qml b/src/qml/AppearancePage.qml index 31affeb..b9a54bc 100644 --- a/src/qml/AppearancePage.qml +++ b/src/qml/AppearancePage.qml @@ -128,26 +128,32 @@ ItemPage { delegate: Rectangle { property bool checked: Qt.colorEqual(Meui.Theme.highlightColor, accentColor) + property color currentColor: accentColor width: accentColorView.itemSize + Meui.Units.largeSpacing height: width color: "transparent" radius: width / 2 - border.color: Qt.rgba(Meui.Theme.highlightColor.r, - Meui.Theme.highlightColor.g, - Meui.Theme.highlightColor.b, 0.5) - border.width: checked ? 2 : 0 + border.color: _mouseArea.pressed ? Qt.rgba(currentColor.r, + currentColor.g, + currentColor.b, 0.6) + : Qt.rgba(currentColor.r, + currentColor.g, + currentColor.b, 0.4) + border.width: checked ? 3 : _mouseArea.containsMouse ? 2 : 0 MouseArea { id: _mouseArea + anchors.fill: parent hoverEnabled: true + onClicked: appearance.setAccentColor(index) } Rectangle { - color: accentColor width: 32 height: width anchors.centerIn: parent + color: currentColor radius: width / 2 Image { @@ -166,14 +172,6 @@ ItemPage { visible: true } } - - MouseArea { - anchors.fill: parent - onClicked: function() { - appearance.setAccentColor(index) - console.log(`Set accent color to ${index}.`) - } - } } } } diff --git a/src/qml/IconCheckBox.qml b/src/qml/IconCheckBox.qml index cd1235f..b6c6002 100644 --- a/src/qml/IconCheckBox.qml +++ b/src/qml/IconCheckBox.qml @@ -30,12 +30,14 @@ Item { color: "transparent" border.width: 3 border.color: control.checked ? Meui.Theme.highlightColor : "transparent" + Behavior on border.color { ColorAnimation { duration: 125 easing.type: Easing.InOutCubic } } + radius: Meui.Theme.bigRadius + control.iconSpacing visible: true diff --git a/src/qml/WirelessDetailsDialog.qml b/src/qml/WirelessDetailsDialog.qml index 98135c7..082a40a 100644 --- a/src/qml/WirelessDetailsDialog.qml +++ b/src/qml/WirelessDetailsDialog.qml @@ -35,6 +35,7 @@ Dialog { id: detailsLayout // I couldn't find a way of making the GridLayout resize. anchors.centerIn: parent + GridLayout { id: gridLayout columns: 2