mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-12-27 09:48:21 +01:00
fix visualize bug after style changes
This commit is contained in:
parent
e63cae1550
commit
52af4b6940
Binary file not shown.
@ -294,7 +294,8 @@ namespace OS {
|
|||||||
.css("padding", 0)
|
.css("padding", 0)
|
||||||
.css("margin", 0)
|
.css("margin", 0)
|
||||||
.css("background-color", "transparent")
|
.css("background-color", "transparent")
|
||||||
.css("width", v * 15 + "px");
|
.css("width", v * 15 + "px")
|
||||||
|
.css("flex-shrink", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -375,6 +376,9 @@ namespace OS {
|
|||||||
$(this.refs.container)
|
$(this.refs.container)
|
||||||
.css("padding", 0)
|
.css("padding", 0)
|
||||||
.css("margin", 0)
|
.css("margin", 0)
|
||||||
|
.css("display","flex")
|
||||||
|
.css("flex-direction", "row")
|
||||||
|
.css("align-items", "center")
|
||||||
.css("white-space", "nowrap");
|
.css("white-space", "nowrap");
|
||||||
$(this.refs.itemholder).css("display", "inline-block");
|
$(this.refs.itemholder).css("display", "inline-block");
|
||||||
$(this.refs.wrapper).on("click",(e) => {
|
$(this.refs.wrapper).on("click",(e) => {
|
||||||
@ -388,6 +392,7 @@ namespace OS {
|
|||||||
$(this.refs.toggle)
|
$(this.refs.toggle)
|
||||||
.css("display", "inline-block")
|
.css("display", "inline-block")
|
||||||
.css("width", "15px")
|
.css("width", "15px")
|
||||||
|
.css("flex-shrink", 0)
|
||||||
.addClass("afx-tree-view-item")
|
.addClass("afx-tree-view-item")
|
||||||
.on("click",(e) => {
|
.on("click",(e) => {
|
||||||
this.open = !this.open;
|
this.open = !this.open;
|
||||||
|
@ -71,24 +71,26 @@ namespace OS {
|
|||||||
|
|
||||||
this.view.contextmenuHandle = (e, m) => {
|
this.view.contextmenuHandle = (e, m) => {
|
||||||
const file = this.view.selectedFile;
|
const file = this.view.selectedFile;
|
||||||
if (!file) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const apps = [];
|
const apps = [];
|
||||||
if (file.type === "dir") {
|
|
||||||
file.mime = "dir";
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let v of this._gui.appsByMime(file.mime)) {
|
|
||||||
apps.push({
|
|
||||||
text: v.text,
|
|
||||||
app: v.app,
|
|
||||||
icon: v.icon,
|
|
||||||
iconclass: v.iconclass,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
let ctx_menu = [
|
let ctx_menu = [
|
||||||
{
|
this.mnFile(),
|
||||||
|
];
|
||||||
|
if(file)
|
||||||
|
{
|
||||||
|
ctx_menu.push(this.mnEdit());
|
||||||
|
if (file.type === "dir") {
|
||||||
|
file.mime = "dir";
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let v of this._gui.appsByMime(file.mime)) {
|
||||||
|
apps.push({
|
||||||
|
text: v.text,
|
||||||
|
app: v.app,
|
||||||
|
icon: v.icon,
|
||||||
|
iconclass: v.iconclass,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
ctx_menu.unshift( {
|
||||||
text: "__(Open with)",
|
text: "__(Open with)",
|
||||||
nodes: apps,
|
nodes: apps,
|
||||||
onchildselect: (e: GUI.TagEventType<GUI.tag.MenuEventData>) => {
|
onchildselect: (e: GUI.TagEventType<GUI.tag.MenuEventData>) => {
|
||||||
@ -98,77 +100,76 @@ namespace OS {
|
|||||||
const it = e.data.item.data;
|
const it = e.data.item.data;
|
||||||
return this._gui.launch(it.app, [file]);
|
return this._gui.launch(it.app, [file]);
|
||||||
},
|
},
|
||||||
},
|
});
|
||||||
this.mnFile(),
|
if(file.mime === "application/zip")
|
||||||
this.mnEdit(),
|
{
|
||||||
];
|
ctx_menu = ctx_menu.concat([
|
||||||
if(file.mime === "application/zip")
|
{
|
||||||
{
|
text: "__(Extract Here)",
|
||||||
ctx_menu = ctx_menu.concat([
|
onmenuselect: (e: GUI.TagEventType<GUI.tag.MenuEventData>) => {
|
||||||
{
|
if (!e) {
|
||||||
text: "__(Extract Here)",
|
return;
|
||||||
onmenuselect: (e: GUI.TagEventType<GUI.tag.MenuEventData>) => {
|
}
|
||||||
if (!e) {
|
API.VFS.extractZip(file.path,
|
||||||
return;
|
(z) => new Promise((r,e) => r(file.path.asFileHandle().parent().path)))
|
||||||
}
|
.catch((err) => this.error(__("Unable to extract file"), err));
|
||||||
API.VFS.extractZip(file.path,
|
},
|
||||||
(z) => new Promise((r,e) => r(file.path.asFileHandle().parent().path)))
|
},
|
||||||
.catch((err) => this.error(__("Unable to extract file"), err));
|
{
|
||||||
},
|
text: "__(Extract to)",
|
||||||
},
|
onmenuselect: async (e: GUI.TagEventType<GUI.tag.MenuEventData>) => {
|
||||||
{
|
if (!e) {
|
||||||
text: "__(Extract to)",
|
return;
|
||||||
onmenuselect: async (e: GUI.TagEventType<GUI.tag.MenuEventData>) => {
|
}
|
||||||
if (!e) {
|
try {
|
||||||
return;
|
OS.GUI.dialogs.FileDialog.last_opened = this.currdir.path;
|
||||||
}
|
const d = await this.openDialog("FileDialog", {
|
||||||
try {
|
title: __("Select extract destination"),
|
||||||
OS.GUI.dialogs.FileDialog.last_opened = this.currdir.path;
|
type: "dir",
|
||||||
const d = await this.openDialog("FileDialog", {
|
file: file.path.replace(".zip","").asFileHandle()
|
||||||
title: __("Select extract destination"),
|
});
|
||||||
type: "dir",
|
const path = `${d.file.path}/${d.name}`;
|
||||||
file: file.path.replace(".zip","").asFileHandle()
|
await API.VFS.mkdirAll([path]);
|
||||||
});
|
await API.VFS.extractZip(file.path,
|
||||||
const path = `${d.file.path}/${d.name}`;
|
(z) => new Promise((r,e) => r(path)));
|
||||||
await API.VFS.mkdirAll([path]);
|
} catch (error) {
|
||||||
await API.VFS.extractZip(file.path,
|
this.error(__("Unable to extract file"), error);
|
||||||
(z) => new Promise((r,e) => r(path)));
|
}
|
||||||
} catch (error) {
|
},
|
||||||
this.error(__("Unable to extract file"), error);
|
},
|
||||||
}
|
]);
|
||||||
},
|
}
|
||||||
},
|
else
|
||||||
]);
|
{
|
||||||
}
|
ctx_menu.push(
|
||||||
else
|
{
|
||||||
{
|
text: "__(Compress)",
|
||||||
ctx_menu.push(
|
onmenuselect: async (e: GUI.TagEventType<GUI.tag.MenuEventData>) => {
|
||||||
{
|
if (!e) {
|
||||||
text: "__(Compress)",
|
return;
|
||||||
onmenuselect: async (e: GUI.TagEventType<GUI.tag.MenuEventData>) => {
|
}
|
||||||
if (!e) {
|
try {
|
||||||
return;
|
OS.GUI.dialogs.FileDialog.last_opened = this.currdir.path;
|
||||||
}
|
const d = await this.openDialog("FileDialog", {
|
||||||
try {
|
title: __("Save compressed file to"),
|
||||||
OS.GUI.dialogs.FileDialog.last_opened = this.currdir.path;
|
type: "dir",
|
||||||
const d = await this.openDialog("FileDialog", {
|
file: `${this.currdir.path}/${file.name}.zip`.asFileHandle()
|
||||||
title: __("Save compressed file to"),
|
});
|
||||||
type: "dir",
|
if(d.name.trim() === "")
|
||||||
file: `${this.currdir.path}/${file.name}.zip`.asFileHandle()
|
{
|
||||||
});
|
return this.error(__("Invalid file name"));
|
||||||
if(d.name.trim() === "")
|
}
|
||||||
{
|
const path = `${d.file.path}/${d.name}`;
|
||||||
return this.error(__("Invalid file name"));
|
await API.VFS.mkar(file.path, path);
|
||||||
|
this.notify(__("Archive file created: {0}",path ));
|
||||||
|
} catch (error) {
|
||||||
|
this.error(__("Unable to compress file, folder"), error);
|
||||||
}
|
}
|
||||||
const path = `${d.file.path}/${d.name}`;
|
|
||||||
await API.VFS.mkar(file.path, path);
|
|
||||||
this.notify(__("Archive file created: {0}",path ));
|
|
||||||
} catch (error) {
|
|
||||||
this.error(__("Unable to compress file, folder"), error);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
m.items = ctx_menu;
|
m.items = ctx_menu;
|
||||||
m.show(e);
|
m.show(e);
|
||||||
@ -764,7 +765,7 @@ namespace OS {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case `${this.name}-download`:
|
case `${this.name}-download`:
|
||||||
if (file.type !== "file") {
|
if (!file || file.type !== "file") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
file.path
|
file.path
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"author": "Xuan Sang LE",
|
"author": "Xuan Sang LE",
|
||||||
"email": "xsang.le@gmail.com"
|
"email": "xsang.le@gmail.com"
|
||||||
},
|
},
|
||||||
"version":"0.1.5-b",
|
"version":"0.1.6-b",
|
||||||
"category":"System",
|
"category":"System",
|
||||||
"iconclass":"fa fa-hdd-o",
|
"iconclass":"fa fa-hdd-o",
|
||||||
"mimes":["dir"],
|
"mimes":["dir"],
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
</afx-vbox>
|
</afx-vbox>
|
||||||
<afx-resizer data-width = "3" ></afx-resizer>
|
<afx-resizer data-width = "3" ></afx-resizer>
|
||||||
<afx-vbox data-id = "container">
|
<afx-vbox data-id = "container">
|
||||||
<afx-label data-id = "appname" data-height = "25"></afx-label>
|
<afx-label data-id = "appname" data-height = "45"></afx-label>
|
||||||
<afx-hbox data-height = "50">
|
<afx-hbox data-height = "50">
|
||||||
<div style = "text-align:left;">
|
<div style = "text-align:left;">
|
||||||
<afx-button data-id = "bt-remove" text = "__(Uninstall)"></afx-button>
|
<afx-button data-id = "bt-remove" text = "__(Uninstall)"></afx-button>
|
||||||
|
@ -25,6 +25,11 @@ afx-file-view afx-list-view i.label-text{
|
|||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
afx-file-view afx-list-view afx-label span
|
||||||
|
{
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
afx-file-view afx-grid-view i{
|
afx-file-view afx-grid-view i{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ afx-label span {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items:center;
|
align-items:center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
afx-label i.label-text{
|
afx-label i.label-text{
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
@ -130,3 +130,7 @@ body
|
|||||||
height: 1px;
|
height: 1px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
afx-desktop > .list-container > ul > afx-list-item afx-label span {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user