右クリックでリアクションピッカーを開くオプション

This commit is contained in:
syuilo 2021-02-20 16:16:19 +09:00
parent 65fbca47f9
commit 8668bc2609
7 changed files with 29 additions and 3 deletions

View file

@ -705,6 +705,7 @@ apply: "適用"
receiveAnnouncementFromInstance: "インスタンスからのお知らせを受け取る"
emailNotification: "メール通知"
inChannelSearch: "チャンネル内検索"
useReactionPickerForContextMenu: "右クリックでリアクションピッカーを開く"
_email:
_follow:

View file

@ -756,7 +756,13 @@ export default defineComponent({
};
if (isLink(e.target)) return;
if (window.getSelection().toString() !== '') return;
os.contextMenu(this.getMenu(), e).then(this.focus);
if (this.$store.state.useReactionPickerForContextMenu) {
e.preventDefault();
this.react();
} else {
os.contextMenu(this.getMenu(), e).then(this.focus);
}
},
menu(viaKeyboard = false) {

View file

@ -731,7 +731,13 @@ export default defineComponent({
};
if (isLink(e.target)) return;
if (window.getSelection().toString() !== '') return;
os.contextMenu(this.getMenu(), e).then(this.focus);
if (this.$store.state.useReactionPickerForContextMenu) {
e.preventDefault();
this.react();
} else {
os.contextMenu(this.getMenu(), e).then(this.focus);
}
},
menu(viaKeyboard = false) {

View file

@ -70,6 +70,7 @@ export default defineComponent({
// TODO: ResizeObserver
new ResizeObserver((entries, observer) => {
const rect = this.src.getBoundingClientRect();
const width = popover.offsetWidth;
const height = popover.offsetHeight;

View file

@ -19,6 +19,7 @@
<template #label>{{ $ts.behavior }}</template>
<FormSwitch v-model:value="imageNewTab">{{ $ts.openImageInNewTab }}</FormSwitch>
<FormSwitch v-model:value="enableInfiniteScroll">{{ $ts.enableInfiniteScroll }}</FormSwitch>
<FormSwitch v-model:value="useReactionPickerForContextMenu">{{ $ts.useReactionPickerForContextMenu }}</FormSwitch>
<FormSwitch v-model:value="disablePagesScript">{{ $ts.disablePagesScript }}</FormSwitch>
</FormGroup>
@ -144,6 +145,7 @@ export default defineComponent({
chatOpenBehavior: ColdDeviceStorage.makeGetterSetter('chatOpenBehavior'),
instanceTicker: defaultStore.makeGetterSetter('instanceTicker'),
enableInfiniteScroll: defaultStore.makeGetterSetter('enableInfiniteScroll'),
useReactionPickerForContextMenu: defaultStore.makeGetterSetter('useReactionPickerForContextMenu'),
},
watch: {

View file

@ -144,6 +144,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: true
},
useReactionPickerForContextMenu: {
where: 'device',
default: true
},
showGapBetweenNotesInTimeline: {
where: 'device',
default: true

View file

@ -741,7 +741,13 @@ export default defineComponent({
};
if (isLink(e.target)) return;
if (window.getSelection().toString() !== '') return;
os.contextMenu(this.getMenu(), e).then(this.focus);
if (this.$store.state.useReactionPickerForContextMenu) {
e.preventDefault();
this.react();
} else {
os.contextMenu(this.getMenu(), e).then(this.focus);
}
},
menu(viaKeyboard = false) {