From f7700ed5d795bc2a52c8028b02799a6d078f6d14 Mon Sep 17 00:00:00 2001 From: pjx206 Date: Tue, 6 Apr 2021 00:20:56 +0800 Subject: [PATCH] Optimize viewMethod change --- .gitignore | 1 + qml/main.qml | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6f50db9..0b823ea 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ compile_commands.json *creator.user* /build/* +.vscode \ No newline at end of file diff --git a/qml/main.qml b/qml/main.qml index ffe603f..77bb93d 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -72,10 +72,7 @@ Meui.Window { source: settings.viewMethod === 0 ? listSource : gridSource onClicked: { - if (settings.viewMethod === 1) - settings.viewMethod = 0 - else - settings.viewMethod = 1 + settings.viewMethod ^= 1 // reverse settings.viewMethod } } }