From d36ea57d51eaa8edbf650baa5c79e403335f1fba Mon Sep 17 00:00:00 2001 From: mashiros <490328928@qq.com> Date: Sat, 9 Apr 2022 18:17:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=89=8D=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=88=97=E8=A1=A8=EF=BC=8C=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/Common.qml | 9 ++++++++- qml/Main.qml | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/qml/Common.qml b/qml/Common.qml index 9057ade..f86e41f 100644 --- a/qml/Common.qml +++ b/qml/Common.qml @@ -122,10 +122,17 @@ Item { }); } - Component.onCompleted: { + function updateStyleList() { + styles.length = 0; + stylesURL.length = 0; + stylesCFG.length = 0; const preset_list = NVG.Resources.filter(/advp.widget.mashiros.top/, /top.mashiros.advp-style/); parse_resource(preset_list, true); const third_list = NVG.Resources.filter(/.*/, /top.mashiros.advp-style/); parse_resource(third_list, false); } + + Component.onCompleted: { + updateStyleList(); + } } diff --git a/qml/Main.qml b/qml/Main.qml index 10858a7..f757f6c 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -50,7 +50,11 @@ T.Widget { menu: Menu { Action { text: qsTr("Settings") + "..." - onTriggered: styleDialog.active = true + enabled: !styleDialog.active + onTriggered: { + Common.updateStyleList(); + styleDialog.active = true + } } }