This repository has been archived by the owner on Dec 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/npm_and_yarn/electron-31.0.2
- Loading branch information
Showing
26 changed files
with
990 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
pull_request_rules: | ||
- name: Automatic merge for trusted authors and dependabot | ||
#- name: Automatic merge for trusted authors and dependabot | ||
# conditions: | ||
# - or: | ||
# - author=mtdvlpr | ||
# - author=sircharlo | ||
# - and: | ||
# - author=dependabot[bot] | ||
# - or: | ||
# - title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\. | ||
# - title~=^chore\(deps\). bump [^\s]+ from ([\d]+)\..+ to \1\. | ||
# - title~=^chore\(deps-dev\). bump [^\s]+ from ([\d]+)\..+ to \1\. | ||
# actions: | ||
# update: | ||
# merge: | ||
# method: squash | ||
- name: Automatically merge Dependabot PRs | ||
conditions: | ||
- or: | ||
- author=mtdvlpr | ||
- author=sircharlo | ||
- and: | ||
- author=dependabot[bot] | ||
- or: | ||
- title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\. | ||
- title~=^chore\(deps\). bump [^\s]+ from ([\d]+)\..+ to \1\. | ||
- title~=^chore\(deps-dev\). bump [^\s]+ from ([\d]+)\..+ to \1\. | ||
- author = dependabot[bot] | ||
actions: | ||
update: | ||
merge: | ||
method: squash | ||
#merge: | ||
queue: | ||
|
||
queue_rules: | ||
# If you have other queues defined, add this at the end so it is processed last | ||
- name: dep-update | ||
batch_size: 10 | ||
# Wait for up to 30 minutes for the batch to fill up | ||
batch_max_wait_time: 30 min | ||
queue_conditions: | ||
- author = dependabot[bot] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<template> | ||
<q-btn-group push v-if="localValue"> | ||
<q-btn | ||
:color="'blue-' + (8 + index)" | ||
:key="keyboardKey" | ||
:label="keyboardKey" | ||
@click="shortcutPicker = true" | ||
v-for="(keyboardKey, index) in localValue.split('+')" | ||
/> | ||
</q-btn-group> | ||
<q-btn | ||
:label="$t('enter-key-combination')" | ||
@click="shortcutPicker = true" | ||
color="primary" | ||
outline | ||
v-else | ||
/> | ||
<q-dialog | ||
@hide="stopListening()" | ||
@show="startListening()" | ||
persistent | ||
v-model="shortcutPicker" | ||
> | ||
<q-card style="min-width: 350px"> | ||
<q-card-section> | ||
<div class="text-h6">Enter a key combination</div> | ||
</q-card-section> | ||
|
||
<q-card-section | ||
:class="'q-pt-none ' + (localValue.length > 0 ? 'text-center' : '')" | ||
> | ||
<template v-if="localValue.length > 0"> | ||
<q-chip | ||
:key="key" | ||
class="glossy text-center text-uppercase" | ||
color="primary" | ||
size="lg" | ||
square | ||
text-color="white" | ||
v-for="key in localValue.split('+')" | ||
>{{ key }}</q-chip | ||
> | ||
</template> | ||
<p v-else>{{ $t('no-key-combination') }}</p> | ||
</q-card-section> | ||
|
||
<q-card-actions align="right" class="text-primary"> | ||
<q-btn | ||
:label="$t('clear')" | ||
@click="localValue = ''" | ||
color="negative" | ||
flat | ||
v-close-popup | ||
/> | ||
<q-btn :label="$t('confirm')" flat v-close-popup /> | ||
</q-card-actions> | ||
</q-card> | ||
</q-dialog> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { | ||
getCurrentShortcuts, | ||
registerCustomShortcut, | ||
unregisterShortcut, | ||
} from 'src/helpers/keyboardShortcuts'; | ||
import { SettingsValues } from 'src/types/settings'; | ||
import { ref, watch } from 'vue'; | ||
// Define props and emits | ||
const props = defineProps<{ | ||
modelValue: string; | ||
shortcutName: keyof SettingsValues; | ||
}>(); | ||
const emit = defineEmits(['update:modelValue']); | ||
// Setup component | ||
const localValue = ref(props.modelValue); | ||
watch(localValue, (newValue, oldValue) => { | ||
if (!getCurrentShortcuts().includes(newValue)) { | ||
emit('update:modelValue', newValue); | ||
unregisterShortcut(oldValue); | ||
registerCustomShortcut(props.shortcutName, newValue); | ||
} | ||
}); | ||
watch( | ||
() => props.modelValue, | ||
(newValue) => { | ||
localValue.value = newValue; | ||
}, | ||
); | ||
const handleKeyPress = (event: KeyboardEvent) => { | ||
const { altKey, ctrlKey, key, metaKey, shiftKey } = event; | ||
const keys = []; | ||
if (ctrlKey) keys.push('Ctrl'); | ||
if (shiftKey) keys.push('Shift'); | ||
if (altKey) keys.push('Alt'); | ||
if (metaKey) keys.push('Meta'); | ||
if (key.length < 3 && keys.length > 0) { | ||
keys.push(key); | ||
localValue.value = keys.join('+'); | ||
} | ||
}; | ||
const startListening = () => window.addEventListener('keydown', handleKeyPress); | ||
const stopListening = () => | ||
window.removeEventListener('keydown', handleKeyPress); | ||
const shortcutPicker = ref(false); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.