Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/renderer/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type WinboatConfigObj = {
customApps: WinApp[]
experimentalFeatures: boolean
multiMonitor: number
hasDesktopShortcut: boolean
};

const defaultConfig: WinboatConfigObj = {
Expand All @@ -24,6 +25,7 @@ const defaultConfig: WinboatConfigObj = {
customApps: [],
experimentalFeatures: false,
multiMonitor: 0,
hasDesktopShortcut: false,
};

export class WinboatConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/lib/winboat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const presetApps: WinApp[] = [
Icon: AppIcons[InternalApps.WINDOWS_DESKTOP],
Source: "internal",
Path: InternalApps.WINDOWS_DESKTOP,
Usage: 0
Usage: 0
},
{
Name: "⚙️ Windows Explorer",
Expand Down
22 changes: 20 additions & 2 deletions src/renderer/views/Apps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,19 @@
<x-label class="truncate text-ellipsis">{{ app.Name }}</x-label>
</div>
<Icon icon="cuida:caret-right-outline"></Icon>
<WBContextMenu v-if="app.Source === 'custom'">
<WBMenuItem @click="removeCustomApp(app)">
<WBContextMenu>
<WBMenuItem v-if="app.Source === 'custom'" @click="removeCustomApp(app)">
<Icon class="size-4" icon="mdi:trash-can"></Icon>
<x-label>Remove Custom App</x-label>
</WBMenuItem>
<WBMenuItem v-if="!wbConfig.config.hasDesktopShortcut" @click="addDesktopShortcut(app)">
<Icon class="size-4" icon="mdi:plus"></Icon>
<x-label>Add Desktop Shortcut</x-label>
</WBMenuItem>
<WBMenuItem v-if="wbConfig.config.hasDesktopShortcut" @click="removeDesktopShortcut(app)">
<Icon class="size-4" icon="mdi:minus"></Icon>
<x-label>Remove Desktop Shortcut</x-label>
</WBMenuItem>
</WBContextMenu>
</x-card>
</TransitionGroup>
Expand Down Expand Up @@ -212,11 +220,13 @@ import WBMenuItem from '../components/WBMenuItem.vue';
import { AppIcons, DEFAULT_ICON } from '../data/appicons';
import { GUEST_API_PORT } from '../lib/constants';
import { debounce } from '../utils/debounce';
import { WinboatConfig } from '../lib/config';
import { Jimp, JimpMime } from 'jimp';
const nodeFetch: typeof import('node-fetch').default = require('node-fetch');
const FormData: typeof import('form-data') = require('form-data');

const winboat = new Winboat();
const wbConfig = new WinboatConfig();
const apps = ref<WinApp[]>([]);
const searchInput = ref('');
const sortBy = ref('');
Expand Down Expand Up @@ -377,6 +387,14 @@ async function removeCustomApp(app: WinApp) {
apps.value = await winboat.appMgr!.getApps(apiURL.value);
}

function addDesktopShortcut(app: WinApp) {
wbConfig.config.hasDesktopShortcut = true;
}

function removeDesktopShortcut(app: WinApp) {
wbConfig.config.hasDesktopShortcut = false;
}

/**
* Resets the custom app form to its default values
*/
Expand Down