Skip to content

Commit

Permalink
feat(ux): icons + fix protocol handler
Browse files Browse the repository at this point in the history
  • Loading branch information
gorillamoe committed Nov 26, 2024
1 parent 27cbb00 commit 3f21426
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
9 changes: 8 additions & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import { app, shell, BrowserWindow, session, desktopCapturer } from 'electron'
import path from 'path'
import { join } from 'path'
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import icon from '../../resources/icon.png?asset'
import { windowStateKeeper } from './stateKeeper'
import { ipcMainHandlersInit } from './ipcMainHandlers'

app.setAsDefaultProtocolClient('bananas')
if (process.defaultApp) {
if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient('bananas', process.execPath, [path.resolve(process.argv[1])])
}
} else {
app.setAsDefaultProtocolClient('bananas')
}

async function createWindow(): Promise<void> {
const mainWindowState = await windowStateKeeper('main')
Expand Down
21 changes: 17 additions & 4 deletions src/renderer/src/Host.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@
<div class="form">
<div class="field">
<div class="control">
<button class="button is-link" bind:this={copyButton}>Copy my connection string</button>
<button class="button is-link" bind:this={copyButton}>
<span class="icon">
<i class="fas fa-copy"></i>
</span>
<span>Copy my connection string</span>
</button>
</div>
</div>

Expand Down Expand Up @@ -91,20 +96,28 @@

<div class="field">
<div class="control">
<button class="button is-link" bind:this={connectButton} disabled>Connect</button>
<button class="button is-link" bind:this={connectButton} disabled>
<span class="icon">
<i class="fas fa-link"></i>
</span>
<span>Connect</span>
</button>
</div>
</div>

<div class="field">
<div class="control">
<button bind:this={toggleRemoteCursorsButton} class="button is-warning is-hidden" on:click={toggleRemoteCursors}>
<button
bind:this={toggleRemoteCursorsButton}
class="button is-warning is-hidden"
on:click={toggleRemoteCursors}
>
<span class="icon">
<i class="fas fa-mouse-pointer"></i>
</span>
<span>{cursorsActive ? 'Disable remote cursors' : 'Enable remote cursors'}</span>
</button>
</div>
</div>

</div>
</div>
16 changes: 12 additions & 4 deletions src/renderer/src/Join.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,24 @@

<div class="field">
<div class="control">
<button class="button is-link" bind:this={connectButton} disabled>Connect</button>
<button class="button is-link" bind:this={connectButton} disabled>
<span class="icon">
<i class="fas fa-link"></i>
</span>
<span>Connect</span>
</button>
</div>
</div>
</div>

<div class="field">
<div class="control">
<button class="button is-link is-hidden" bind:this={copyButton}
>Copy my connection string</button
>
<button class="button is-link is-hidden" bind:this={copyButton}>
<span class="icon">
<i class="fas fa-copy"></i>
</span>
<span>Copy my connection string</span>
</button>
</div>
</div>

Expand Down

0 comments on commit 3f21426

Please sign in to comment.