From a86da11532801173b1ad40823701e010f7c4aab3 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Tue, 18 Jul 2023 10:43:42 +0200 Subject: [PATCH] fix: minor UI bugs on File and Setting apps --- src/packages/Files/README.md | 1 + src/packages/Files/main.ts | 10 +++++++--- src/packages/Files/package.json | 2 +- src/packages/Setting/README.md | 1 + src/packages/Setting/VFSHandle.ts | 19 ++++++------------- src/packages/Setting/package.json | 2 +- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/packages/Files/README.md b/src/packages/Files/README.md index a0085d1..2b8a5e0 100644 --- a/src/packages/Files/README.md +++ b/src/packages/Files/README.md @@ -6,6 +6,7 @@ This application is included in the AntOS delivery as system application and cannot be removed/uinstalled by regular user ## Change logs +- v0.1.10-b: improve file favorite behaviour - v0.1.9-b: use "column"/"row" for UI direction names - v0.1.8-b: use system css variables in theme - v0.1.7-b: fix - file grid view double click event hanling on diffent cells of a row \ No newline at end of file diff --git a/src/packages/Files/main.ts b/src/packages/Files/main.ts index e26e0f9..e582e14 100644 --- a/src/packages/Files/main.ts +++ b/src/packages/Files/main.ts @@ -252,15 +252,20 @@ namespace OS { const matched = this.favo.data.map((e,i) => { return { path: e.path, - index:i + index:i, } }) .filter(e => { return dir.path.startsWith(e.path as string); + }) + .sort((x,y) => { + if(x.path.length < y.path.length) return 1; + if(x == y) return 0; + return -1; }); if(matched.length != 0) { - //console.log(matched[0]); + // get the longest matched this.favo.selected = matched[0].index; } } @@ -482,7 +487,6 @@ namespace OS { } private mnFile(): GUI.BasicItemType{ - //console.log file const arr: GUI.BasicItemType = { text: "__(File)", nodes: [ diff --git a/src/packages/Files/package.json b/src/packages/Files/package.json index 0231124..6d801c0 100644 --- a/src/packages/Files/package.json +++ b/src/packages/Files/package.json @@ -6,7 +6,7 @@ "author": "Xuan Sang LE", "email": "xsang.le@gmail.com" }, - "version":"0.1.9-b", + "version":"0.1.10-b", "category":"System", "iconclass":"fa fa-hdd-o", "mimes":["dir"], diff --git a/src/packages/Setting/README.md b/src/packages/Setting/README.md index 0f41e1a..2adac35 100644 --- a/src/packages/Setting/README.md +++ b/src/packages/Setting/README.md @@ -10,6 +10,7 @@ In case of system anormaly after the modification, the system settings can be re by simply removing the setting file ## Change logs +- v0.1.5-b: fix VFS setting dialog bugs - v0.1.4-b: use system css variables in theme - v0.1.2-b: minor bug fix on UI - v0.1.2-b: add README diff --git a/src/packages/Setting/VFSHandle.ts b/src/packages/Setting/VFSHandle.ts index 55a6ca5..75e1b3b 100644 --- a/src/packages/Setting/VFSHandle.ts +++ b/src/packages/Setting/VFSHandle.ts @@ -96,25 +96,18 @@ namespace OS { } VFSSettingDialog.scheme = `\ - - + + -
-
- - -
- - -
+ +
- - + +
-
\ diff --git a/src/packages/Setting/package.json b/src/packages/Setting/package.json index 006ef71..b026ef8 100644 --- a/src/packages/Setting/package.json +++ b/src/packages/Setting/package.json @@ -6,7 +6,7 @@ "author": "Xuan Sang LE", "email": "xsang.le@gmail.com" }, - "version":"0.1.4-b", + "version":"0.1.5-b", "category":"System", "iconclass":"fa fa-wrench", "mimes":["none"]