1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 00:35:52 +02:00
This commit is contained in:
syuilo
2026-04-27 14:46:57 +09:00
parent f98394fc60
commit 036b8ea320
5 changed files with 33 additions and 13 deletions

View File

@@ -234,7 +234,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts">
import { computed, defineAsyncComponent, inject, nextTick, onBeforeUnmount, onMounted, ref, useTemplateRef, unref, watch, shallowRef, reactive, isRef } from 'vue';
import type { MenuItem, InnerMenuItem, MenuPending, MenuAction, MenuSwitch, MenuRadio, MenuRadioOption, MenuParent } from '@/types/menu.js';
import type { MenuItem, InnerMenuItem, MenuPending, MenuAction, MenuSwitch, MenuRadio, MenuRadioOption, MenuParent, MenuDivider } from '@/types/menu.js';
import type { Keymap } from '@/utility/hotkey.js';
import MkSwitchButton from '@/components/MkSwitch.button.vue';
import * as os from '@/os.js';
@@ -339,7 +339,11 @@ function onItemMouseLeave() {
}
async function showRadioOptions(item: MenuRadio, ev: MouseEvent | PointerEvent | KeyboardEvent) {
const children: MenuItem[] = item.options.map<MenuRadioOption>(def => {
const children: MenuItem[] = item.options.map<MenuRadioOption | MenuDivider>(def => {
if (def.type === 'divider') {
return { type: 'divider' };
}
return {
type: 'radioOption',
text: def.label,

View File

@@ -474,12 +474,12 @@ function impor() {
function showOtherMenu(ev: PointerEvent) {
os.popupMenu([{
type: 'radio',
text: 'Graphics quality',
text: i18n.ts._room.graphicsQuality,
caption: graphicsQualityRaw.value == null ? i18n.ts.auto : graphicsQualityRaw.value === GRAPHICS_QUALITY_HIGH ? 'High' : graphicsQualityRaw.value === GRAPHICS_QUALITY_MEDIUM ? 'Medium' : 'Low',
options: [{
label: `Auto (${graphicsQualityAutoValue.value === GRAPHICS_QUALITY_HIGH ? 'High' : graphicsQualityAutoValue.value === GRAPHICS_QUALITY_MEDIUM ? 'Medium' : 'Low'})`,
label: `${i18n.ts.auto} (${graphicsQualityAutoValue.value === GRAPHICS_QUALITY_HIGH ? 'High' : graphicsQualityAutoValue.value === GRAPHICS_QUALITY_MEDIUM ? 'Medium' : 'Low'})`,
value: null,
}, {
}, { type: 'divider' }, {
label: 'High',
value: GRAPHICS_QUALITY_HIGH,
}, {
@@ -492,12 +492,12 @@ function showOtherMenu(ev: PointerEvent) {
ref: graphicsQualityRaw,
}, {
type: 'radio',
text: 'Framerate',
text: i18n.ts._room.frameRate,
caption: fpsRaw.value == null ? i18n.ts.auto : fpsRaw.value === 'max' ? 'Max' : `~${fpsRaw.value}fps`,
options: [{
label: `Auto (${fpsAutoValue.value}fps)`,
label: `${i18n.ts.auto} (${fpsAutoValue.value}fps)`,
value: null,
}, {
}, { type: 'divider' }, {
label: 'Max',
value: 'max',
}, {
@@ -513,12 +513,12 @@ function showOtherMenu(ev: PointerEvent) {
ref: fpsRaw,
}, {
type: 'radio',
text: 'Resolution',
text: i18n.ts._room.resolution,
caption: resolutionRaw.value == null ? i18n.ts.auto : resolutionRaw.value + 'x',
options: [{
label: `Auto (${resolutionAutoValue.value}x)`,
label: `${i18n.ts.auto} (${resolutionAutoValue.value}x)`,
value: null,
}, {
}, { type: 'divider' }, {
label: '2x',
value: 2,
}, {

View File

@@ -78,10 +78,11 @@ export interface MenuSwitch extends TextMenuBase {
export interface MenuRadio extends TextMenuBase {
type: 'radio';
ref: Ref<OptionValue>;
options: {
options: ({
type?: 'option';
label: string;
value: OptionValue;
}[];
} | MenuDivider)[];
disabled?: boolean | Ref<boolean>;
}