Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚩PR: Fixed Copy/Paste for texts and fixed Icon display #725

Merged
merged 4 commits into from
May 17, 2024
Merged
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
13 changes: 13 additions & 0 deletions src/renderer/main/_actions/shortcut.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ export const shortcut = (node: HTMLElement, params?: ShortcutParameter) => {
setHandler = () => {
removeHandler();
if (!params) return;

handler = (e: KeyboardEvent) => {
// Check if the event target is an input, textarea, or contenteditable element
const target = e.target as HTMLElement;
const isInputField =
target.tagName === "INPUT" ||
target.tagName === "TEXTAREA" ||
target.isContentEditable;

// If the target is an input field, textarea, or contenteditable, allow default behavior
if (isInputField) {
return;
}

if (
!!params.alt != e.altKey ||
!!params.shift != e.shiftKey ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,7 @@
class:icon-corner-cut-l={isLeftCut}
class:scale-50={elementNumber == 255}
>
<SvgIcon
class="text-white"
iconPath={loaded ? "tick" : "download"}
displayMode={"static"}
/>
<SvgIcon fill="#FFF" iconPath={loaded ? "tick" : "download"} />
</button>
{/if}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,20 @@
{#if loadedState === 0}
<span class="text-white mr-2">Load Profile</span>
<SvgIcon
class="text-white"
fill="#FFF"
iconPath={"download"}
displayMode={"static"}
/>
{:else if loadedState === 1}
<span class="text-white mr-2">Loading...</span>
<SvgIcon
class="text-white"
fill="#FFF"
iconPath={"download"}
displayMode={"static"}
/>
{:else if loadedState === 2}
<span class="text-white">Loaded!</span>
<SvgIcon
class="text-white"
iconPath={"tick"}
displayMode={"static"}
/>
<SvgIcon fill="#FFF" iconPath={"tick"} displayMode={"static"} />
{/if}
</button>
{/key}
Expand Down
12 changes: 6 additions & 6 deletions src/renderer/main/panels/MidiMonitor/MidiMonitor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@
<div class="flex items-center">
{#if message.data.direction == "REPORT"}
<span>RX</span>
<SvgIcon class="scale-75" iconPath="arrow_left" />
<SvgIcon fill="#FFF" iconPath="arrow_left" />
{:else}
<span>TX</span>
<SvgIcon class="scale-75" iconPath="arrow_right" />
<SvgIcon fill="#FFF" iconPath="arrow_right" />
{/if}
</div>
</div>
Expand All @@ -316,9 +316,9 @@
<div class="flex flex-row text-white">
<span>{midi.device.name}</span>
{#if midi.data.direction == "REPORT"}
<SvgIcon class="scale-75" iconPath="arrow_left" />
<SvgIcon fill="#FFF" iconPath="arrow_left" />
{:else}
<SvgIcon class="scale-75" iconPath="arrow_right" />
<SvgIcon fill="#FFF" iconPath="arrow_right" />
{/if}
</div>
<span>Ch: {midi.data.channel}</span>
Expand Down Expand Up @@ -384,9 +384,9 @@
<div class="flex flex-row text-white">
<span>{sysex.device.name}</span>
{#if sysex.data.direction == "REPORT"}
<SvgIcon class="scale-75" iconPath="arrow_left" />
<SvgIcon fill="#FFF" iconPath="arrow_left" />
{:else}
<SvgIcon class="scale-75" iconPath="arrow_right" />
<SvgIcon fill="#FFF" iconPath="arrow_right" />
{/if}
</div>

Expand Down
3 changes: 2 additions & 1 deletion src/renderer/main/user-interface/SvgIcon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
export let iconPath: string = "";
export let width: number = 15;
export let height: number = 15;
export let fill: string | undefined = undefined;
let rawSvg: string;
Expand All @@ -14,7 +15,7 @@
}
</script>

<svg style="width: {width}px; height: {height}px;">
<svg style="width: {width}px; height: {height}px; fill: {fill};">
<g>
{@html rawSvg}
</g>
Expand Down
Loading