キーボードでカラーモードを変更した際にtoastを表示するように
This commit is contained in:
parent
3f20639fba
commit
b0cad800cd
|
@ -4984,6 +4984,10 @@ export interface Locale extends ILocale {
|
||||||
* お問い合わせ
|
* お問い合わせ
|
||||||
*/
|
*/
|
||||||
"inquiry": string;
|
"inquiry": string;
|
||||||
|
/**
|
||||||
|
* カラーモードを{mode}に変更しました。
|
||||||
|
*/
|
||||||
|
"colorModeChangedToX": ParameterizedString<"mode">;
|
||||||
"_delivery": {
|
"_delivery": {
|
||||||
/**
|
/**
|
||||||
* 配信状態
|
* 配信状態
|
||||||
|
|
|
@ -1242,6 +1242,7 @@ keepOriginalFilenameDescription: "この設定をオフにすると、アップ
|
||||||
noDescription: "説明文はありません"
|
noDescription: "説明文はありません"
|
||||||
alwaysConfirmFollow: "フォローの際常に確認する"
|
alwaysConfirmFollow: "フォローの際常に確認する"
|
||||||
inquiry: "お問い合わせ"
|
inquiry: "お問い合わせ"
|
||||||
|
colorModeChangedToX: "カラーモードを{mode}に変更しました。"
|
||||||
|
|
||||||
_delivery:
|
_delivery:
|
||||||
status: "配信状態"
|
status: "配信状態"
|
||||||
|
|
|
@ -71,6 +71,7 @@ export async function mainBoot() {
|
||||||
'd': (): void => {
|
'd': (): void => {
|
||||||
ColdDeviceStorage.set('syncDeviceDarkMode', false);
|
ColdDeviceStorage.set('syncDeviceDarkMode', false);
|
||||||
defaultStore.set('darkMode', !defaultStore.state.darkMode);
|
defaultStore.set('darkMode', !defaultStore.state.darkMode);
|
||||||
|
toast(i18n.tsx.colorModeChangedToX({ mode: defaultStore.state.darkMode ? i18n.ts.dark : i18n.ts.light }), 1500);
|
||||||
},
|
},
|
||||||
's': (): void => {
|
's': (): void => {
|
||||||
mainRouter.push('/search');
|
mainRouter.push('/search');
|
||||||
|
|
|
@ -26,9 +26,12 @@ import { onMounted, ref } from 'vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
|
|
||||||
defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
message: string;
|
message: string;
|
||||||
}>();
|
duration?: number;
|
||||||
|
}>(), {
|
||||||
|
duration: 4000,
|
||||||
|
});
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'closed'): void;
|
(ev: 'closed'): void;
|
||||||
|
@ -40,7 +43,7 @@ const showing = ref(true);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
showing.value = false;
|
showing.value = false;
|
||||||
}, 4000);
|
}, props.duration);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -204,9 +204,10 @@ export function pageWindow(path: string) {
|
||||||
}, {}, 'closed');
|
}, {}, 'closed');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toast(message: string) {
|
export function toast(message: string, duration?: number) {
|
||||||
popup(MkToast, {
|
popup(MkToast, {
|
||||||
message,
|
message,
|
||||||
|
duration,
|
||||||
}, {}, 'closed');
|
}, {}, 'closed');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue