mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-09 03:22:49 +00:00
feat: add info for current and after next save action
This commit is contained in:
@@ -26,6 +26,7 @@ const de = {
|
|||||||
actionSearch: {
|
actionSearch: {
|
||||||
PLACEHOLDER: "Nach Aktionen suchen",
|
PLACEHOLDER: "Nach Aktionen suchen",
|
||||||
CURRENT_ACTION: "Aktuelle Aktion",
|
CURRENT_ACTION: "Aktuelle Aktion",
|
||||||
|
NEXT_ACTION: "Aktion nach dem nächsten Speichern",
|
||||||
DELETE: "Entfernen",
|
DELETE: "Entfernen",
|
||||||
filter: {
|
filter: {
|
||||||
ALL: "Alle",
|
ALL: "Alle",
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ const en = {
|
|||||||
actionSearch: {
|
actionSearch: {
|
||||||
PLACEHOLDER: "Search for actions",
|
PLACEHOLDER: "Search for actions",
|
||||||
CURRENT_ACTION: "Current action",
|
CURRENT_ACTION: "Current action",
|
||||||
|
NEXT_ACTION: "Action after next save",
|
||||||
DELETE: "Remove",
|
DELETE: "Remove",
|
||||||
filter: {
|
filter: {
|
||||||
ALL: "All",
|
ALL: "All",
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
import {action} from "$lib/title"
|
import {action} from "$lib/title"
|
||||||
|
|
||||||
export let currentAction: number | undefined = undefined
|
export let currentAction: number | undefined = undefined
|
||||||
|
export let nextAction: number | undefined = undefined
|
||||||
|
|
||||||
const index = new Index({tokenize: "full"})
|
const index = new Index({tokenize: "full"})
|
||||||
for (const action of Object.values(KEYMAP_CODES)) {
|
for (const action of Object.values(KEYMAP_CODES)) {
|
||||||
@@ -121,6 +122,12 @@
|
|||||||
<h3>{$LL.actionSearch.CURRENT_ACTION()}</h3>
|
<h3>{$LL.actionSearch.CURRENT_ACTION()}</h3>
|
||||||
<ActionListItem id={currentAction} />
|
<ActionListItem id={currentAction} />
|
||||||
</aside>
|
</aside>
|
||||||
|
<aside>
|
||||||
|
{#if nextAction}
|
||||||
|
<h3>{$LL.actionSearch.NEXT_ACTION()}</h3>
|
||||||
|
<ActionListItem id={nextAction} />
|
||||||
|
{/if}
|
||||||
|
</aside>
|
||||||
{/if}
|
{/if}
|
||||||
<ul bind:this={resultList}>
|
<ul bind:this={resultList}>
|
||||||
{#if exact !== undefined}
|
{#if exact !== undefined}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import KeyboardKey from "$lib/components/layout/KeyboardKey.svelte"
|
import KeyboardKey from "$lib/components/layout/KeyboardKey.svelte"
|
||||||
import {getContext} from "svelte"
|
import {getContext} from "svelte"
|
||||||
import type {VisualLayoutConfig} from "./visual-layout.js"
|
import type {VisualLayoutConfig} from "./visual-layout.js"
|
||||||
import {changes, ChangeType} from "$lib/undo-redo"
|
import {changes, ChangeType, layout} from "$lib/undo-redo"
|
||||||
|
|
||||||
const {scale, margin, strokeWidth, fontSize, iconFontSize} =
|
const {scale, margin, strokeWidth, fontSize, iconFontSize} =
|
||||||
getContext<VisualLayoutConfig>("visual-layout-config")
|
getContext<VisualLayoutConfig>("visual-layout-config")
|
||||||
@@ -113,9 +113,14 @@
|
|||||||
function edit(index: number) {
|
function edit(index: number) {
|
||||||
const keyInfo = layoutInfo.keys[index]
|
const keyInfo = layoutInfo.keys[index]
|
||||||
const clickedGroup = groupParent.children.item(index) as SVGGElement
|
const clickedGroup = groupParent.children.item(index) as SVGGElement
|
||||||
|
const nextAction = get(layout)[get(activeLayer)][keyInfo.id]
|
||||||
|
const currentAction = get(deviceLayout)[get(activeLayer)][keyInfo.id]
|
||||||
const component = new ActionSelector({
|
const component = new ActionSelector({
|
||||||
target: document.body,
|
target: document.body,
|
||||||
props: {currentAction: get(deviceLayout)[get(activeLayer)][keyInfo.id]},
|
props: {
|
||||||
|
currentAction,
|
||||||
|
nextAction: nextAction.isApplied ? undefined : nextAction.action,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
const dialog = document.querySelector("dialog > div") as HTMLDivElement
|
const dialog = document.querySelector("dialog > div") as HTMLDivElement
|
||||||
const backdrop = document.querySelector("dialog") as HTMLDialogElement
|
const backdrop = document.querySelector("dialog") as HTMLDialogElement
|
||||||
|
|||||||
Reference in New Issue
Block a user