Skip to content

Commit

Permalink
Add application shortcut support to iconview (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersevenrud committed Sep 11, 2019
1 parent 9225d3c commit 7b7fa3b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/adapters/ui/iconview.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import {h, app} from 'hyperapp';
import {doubleTap} from '../../utils/input';
import {pathJoin} from '../../utils/vfs';

// TODO: Add context menu with refresh

const tapper = doubleTap();

const validVfsDrop = data => data && data.path;
Expand Down Expand Up @@ -78,7 +80,7 @@ const view = (fileIcon, themeIcon, droppable) => (state, actions) =>
class: 'osjs-desktop-iconview__entry__icon'
}, [
h('img', {
src: themeIcon(fileIcon(entry).name),
src: entry.icon ? entry.icon : themeIcon(fileIcon(entry).name),
class: 'osjs-desktop-iconview__entry__icon__icon'
}),
entry.shortcut !== false
Expand Down Expand Up @@ -240,6 +242,8 @@ export class DesktopIconView extends EventEmitter {
this.core.run('FileManager', {
path: entry
});
} else if (entry.mime === 'osjs/application') {
this.core.run(entry.filename);
} else {
this.core.open(entry, {
useDefault: true,
Expand All @@ -262,7 +266,7 @@ export class DesktopIconView extends EventEmitter {
mkdir(root)
.catch(() => true)
.then(() => {
if (shortcut) {
if (shortcut || entry.mime === 'osjs/application') {
return shortcuts.add(entry);
}

Expand Down

0 comments on commit 7b7fa3b

Please sign in to comment.