Skip to content

Commit 7b7fa3b

Browse files
committed
Add application shortcut support to iconview (#51)
1 parent 9225d3c commit 7b7fa3b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/adapters/ui/iconview.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import {h, app} from 'hyperapp';
3232
import {doubleTap} from '../../utils/input';
3333
import {pathJoin} from '../../utils/vfs';
3434

35+
// TODO: Add context menu with refresh
36+
3537
const tapper = doubleTap();
3638

3739
const validVfsDrop = data => data && data.path;
@@ -78,7 +80,7 @@ const view = (fileIcon, themeIcon, droppable) => (state, actions) =>
7880
class: 'osjs-desktop-iconview__entry__icon'
7981
}, [
8082
h('img', {
81-
src: themeIcon(fileIcon(entry).name),
83+
src: entry.icon ? entry.icon : themeIcon(fileIcon(entry).name),
8284
class: 'osjs-desktop-iconview__entry__icon__icon'
8385
}),
8486
entry.shortcut !== false
@@ -240,6 +242,8 @@ export class DesktopIconView extends EventEmitter {
240242
this.core.run('FileManager', {
241243
path: entry
242244
});
245+
} else if (entry.mime === 'osjs/application') {
246+
this.core.run(entry.filename);
243247
} else {
244248
this.core.open(entry, {
245249
useDefault: true,
@@ -262,7 +266,7 @@ export class DesktopIconView extends EventEmitter {
262266
mkdir(root)
263267
.catch(() => true)
264268
.then(() => {
265-
if (shortcut) {
269+
if (shortcut || entry.mime === 'osjs/application') {
266270
return shortcuts.add(entry);
267271
}
268272

0 commit comments

Comments
 (0)