mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-27 15:22:46 +08:00
feat: 增加 getFileIcon api
This commit is contained in:
parent
971ad0e3e2
commit
de7fee6a23
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rubick",
|
||||
"version": "2.2.5",
|
||||
"version": "2.2.6",
|
||||
"author": "muwoo <2424880409@qq.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -41,7 +41,7 @@ window.rubick = {
|
||||
ipcSendSync('showMainWindow');
|
||||
},
|
||||
showOpenDialog(options) {
|
||||
ipcSendSync('showOpenDialog', options);
|
||||
return ipcSendSync('showOpenDialog', options);
|
||||
},
|
||||
setExpendHeight(height) {
|
||||
ipcSendSync('setExpendHeight', height);
|
||||
@ -162,4 +162,8 @@ window.rubick = {
|
||||
shellBeep: () => {
|
||||
ipcSend('shellBeep');
|
||||
},
|
||||
|
||||
getFileIcon: (path) => {
|
||||
return ipcSendSync('getFileIcon', { path });
|
||||
},
|
||||
};
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user