feat: 增加 getFileIcon api

This commit is contained in:
muwoo
2023-05-26 09:43:06 +08:00
parent 971ad0e3e2
commit de7fee6a23
3 changed files with 11 additions and 3 deletions

View File

@@ -110,7 +110,7 @@ class API {
}
public showOpenDialog({ data }, window) {
dialog.showOpenDialogSync(window, data);
return dialog.showOpenDialogSync(window, data);
}
public setExpendHeight({ data: height }, window: BrowserWindow, e) {
@@ -307,6 +307,10 @@ class API {
shell.showItemInFolder(data.path);
return true;
}
public async getFileIcon({ data }) {
const nativeImage = await app.getFileIcon(data.path, { size: 'normal' });
return nativeImage.toDataURL();
}
public shellBeep() {
shell.beep();