mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
add missing table body to hotkeys manager
This commit is contained in:
@@ -266,97 +266,102 @@ export const HotkeyManagerSettings = memo(() => {
|
|||||||
/>
|
/>
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<Table withColumnBorders withRowBorders>
|
<Table withColumnBorders withRowBorders>
|
||||||
{filteredBindings.map((binding) => (
|
<Table.Tbody>
|
||||||
<Table.Tr key={`hotkey-${binding}`}>
|
{filteredBindings.map((binding) => (
|
||||||
<Table.Td style={{ userSelect: 'none' }}>
|
<Table.Tr key={`hotkey-${binding}`}>
|
||||||
{BINDINGS_MAP[binding as keyof typeof BINDINGS_MAP]}
|
<Table.Td style={{ userSelect: 'none' }}>
|
||||||
</Table.Td>
|
{BINDINGS_MAP[binding as keyof typeof BINDINGS_MAP]}
|
||||||
<Table.Td>
|
</Table.Td>
|
||||||
<TextInput
|
<Table.Td>
|
||||||
id={`hotkey-${binding}`}
|
<TextInput
|
||||||
leftSection={<Icon icon="keyboard" />}
|
id={`hotkey-${binding}`}
|
||||||
onBlur={() => setSelected(null)}
|
leftSection={<Icon icon="keyboard" />}
|
||||||
onChange={() => {}}
|
onBlur={() => setSelected(null)}
|
||||||
onKeyDownCapture={(e) => {
|
onChange={() => {}}
|
||||||
if (selected !== (binding as BindingActions))
|
onKeyDownCapture={(e) => {
|
||||||
return;
|
if (selected !== (binding as BindingActions))
|
||||||
handleSetHotkey(binding as BindingActions, e);
|
return;
|
||||||
}}
|
handleSetHotkey(binding as BindingActions, e);
|
||||||
readOnly
|
}}
|
||||||
rightSection={
|
readOnly
|
||||||
<ActionIcon
|
rightSection={
|
||||||
icon="edit"
|
<ActionIcon
|
||||||
onClick={() => {
|
icon="edit"
|
||||||
setSelected(binding as BindingActions);
|
onClick={() => {
|
||||||
document
|
setSelected(binding as BindingActions);
|
||||||
.getElementById(`hotkey-${binding}`)
|
document
|
||||||
?.focus();
|
.getElementById(`hotkey-${binding}`)
|
||||||
|
?.focus();
|
||||||
|
}}
|
||||||
|
variant="transparent"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
style={{
|
||||||
|
opacity:
|
||||||
|
selected === (binding as BindingActions)
|
||||||
|
? 0.8
|
||||||
|
: 1,
|
||||||
|
outline: duplicateHotkeyMap.includes(
|
||||||
|
bindings[
|
||||||
|
binding as keyof typeof BINDINGS_MAP
|
||||||
|
].hotkey!,
|
||||||
|
)
|
||||||
|
? '1px dashed red'
|
||||||
|
: undefined,
|
||||||
|
}}
|
||||||
|
value={
|
||||||
|
bindings[binding as keyof typeof BINDINGS_MAP]
|
||||||
|
.hotkey
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Table.Td>
|
||||||
|
{isElectron() && (
|
||||||
|
<Table.Td>
|
||||||
|
<Checkbox
|
||||||
|
checked={
|
||||||
|
bindings[
|
||||||
|
binding as keyof typeof BINDINGS_MAP
|
||||||
|
].isGlobal
|
||||||
|
}
|
||||||
|
disabled={
|
||||||
|
bindings[
|
||||||
|
binding as keyof typeof BINDINGS_MAP
|
||||||
|
].hotkey === ''
|
||||||
|
}
|
||||||
|
onChange={(e) =>
|
||||||
|
handleSetGlobalHotkey(
|
||||||
|
binding as BindingActions,
|
||||||
|
e,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
size="md"
|
||||||
|
style={{
|
||||||
|
opacity: bindings[
|
||||||
|
binding as keyof typeof BINDINGS_MAP
|
||||||
|
].allowGlobal
|
||||||
|
? 1
|
||||||
|
: 0,
|
||||||
}}
|
}}
|
||||||
|
/>
|
||||||
|
</Table.Td>
|
||||||
|
)}
|
||||||
|
{bindings[binding as keyof typeof BINDINGS_MAP].hotkey && (
|
||||||
|
<Table.Td>
|
||||||
|
<ActionIcon
|
||||||
|
icon="x"
|
||||||
|
iconProps={{
|
||||||
|
color: 'error',
|
||||||
|
}}
|
||||||
|
onClick={() =>
|
||||||
|
handleClearHotkey(binding as BindingActions)
|
||||||
|
}
|
||||||
variant="transparent"
|
variant="transparent"
|
||||||
/>
|
/>
|
||||||
}
|
</Table.Td>
|
||||||
style={{
|
)}
|
||||||
opacity:
|
</Table.Tr>
|
||||||
selected === (binding as BindingActions)
|
))}
|
||||||
? 0.8
|
</Table.Tbody>
|
||||||
: 1,
|
|
||||||
outline: duplicateHotkeyMap.includes(
|
|
||||||
bindings[binding as keyof typeof BINDINGS_MAP]
|
|
||||||
.hotkey!,
|
|
||||||
)
|
|
||||||
? '1px dashed red'
|
|
||||||
: undefined,
|
|
||||||
}}
|
|
||||||
value={
|
|
||||||
bindings[binding as keyof typeof BINDINGS_MAP]
|
|
||||||
.hotkey
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Table.Td>
|
|
||||||
{isElectron() && (
|
|
||||||
<Table.Td>
|
|
||||||
<Checkbox
|
|
||||||
checked={
|
|
||||||
bindings[binding as keyof typeof BINDINGS_MAP]
|
|
||||||
.isGlobal
|
|
||||||
}
|
|
||||||
disabled={
|
|
||||||
bindings[binding as keyof typeof BINDINGS_MAP]
|
|
||||||
.hotkey === ''
|
|
||||||
}
|
|
||||||
onChange={(e) =>
|
|
||||||
handleSetGlobalHotkey(
|
|
||||||
binding as BindingActions,
|
|
||||||
e,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
size="md"
|
|
||||||
style={{
|
|
||||||
opacity: bindings[
|
|
||||||
binding as keyof typeof BINDINGS_MAP
|
|
||||||
].allowGlobal
|
|
||||||
? 1
|
|
||||||
: 0,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Table.Td>
|
|
||||||
)}
|
|
||||||
{bindings[binding as keyof typeof BINDINGS_MAP].hotkey && (
|
|
||||||
<Table.Td>
|
|
||||||
<ActionIcon
|
|
||||||
icon="x"
|
|
||||||
iconProps={{
|
|
||||||
color: 'error',
|
|
||||||
}}
|
|
||||||
onClick={() =>
|
|
||||||
handleClearHotkey(binding as BindingActions)
|
|
||||||
}
|
|
||||||
variant="transparent"
|
|
||||||
/>
|
|
||||||
</Table.Td>
|
|
||||||
)}
|
|
||||||
</Table.Tr>
|
|
||||||
))}
|
|
||||||
</Table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user