mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-29 01:02:47 +08:00
feat: 增加 getFileIcon api
This commit is contained in:
parent
971ad0e3e2
commit
de7fee6a23
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rubick",
|
"name": "rubick",
|
||||||
"version": "2.2.5",
|
"version": "2.2.6",
|
||||||
"author": "muwoo <2424880409@qq.com>",
|
"author": "muwoo <2424880409@qq.com>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -41,7 +41,7 @@ window.rubick = {
|
|||||||
ipcSendSync('showMainWindow');
|
ipcSendSync('showMainWindow');
|
||||||
},
|
},
|
||||||
showOpenDialog(options) {
|
showOpenDialog(options) {
|
||||||
ipcSendSync('showOpenDialog', options);
|
return ipcSendSync('showOpenDialog', options);
|
||||||
},
|
},
|
||||||
setExpendHeight(height) {
|
setExpendHeight(height) {
|
||||||
ipcSendSync('setExpendHeight', height);
|
ipcSendSync('setExpendHeight', height);
|
||||||
@ -162,4 +162,8 @@ window.rubick = {
|
|||||||
shellBeep: () => {
|
shellBeep: () => {
|
||||||
ipcSend('shellBeep');
|
ipcSend('shellBeep');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getFileIcon: (path) => {
|
||||||
|
return ipcSendSync('getFileIcon', { path });
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
@ -110,7 +110,7 @@ class API {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public showOpenDialog({ data }, window) {
|
public showOpenDialog({ data }, window) {
|
||||||
dialog.showOpenDialogSync(window, data);
|
return dialog.showOpenDialogSync(window, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public setExpendHeight({ data: height }, window: BrowserWindow, e) {
|
public setExpendHeight({ data: height }, window: BrowserWindow, e) {
|
||||||
@ -307,6 +307,10 @@ class API {
|
|||||||
shell.showItemInFolder(data.path);
|
shell.showItemInFolder(data.path);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
public async getFileIcon({ data }) {
|
||||||
|
const nativeImage = await app.getFileIcon(data.path, { size: 'normal' });
|
||||||
|
return nativeImage.toDataURL();
|
||||||
|
}
|
||||||
|
|
||||||
public shellBeep() {
|
public shellBeep() {
|
||||||
shell.beep();
|
shell.beep();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user