Browse Source

设置前刷新样式列表,加载第三方样式

master
mashiros 2 years ago
parent
commit
d36ea57d51
  1. 9
      qml/Common.qml
  2. 6
      qml/Main.qml

9
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();
}
}

6
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
}
}
}

Loading…
Cancel
Save