クロップ時の質問を分かりやすく

This commit is contained in:
syuilo 2023-02-10 10:45:32 +09:00
parent b3e8671dd9
commit adad4bcfe3
4 changed files with 12 additions and 2 deletions

View File

@ -864,6 +864,8 @@ failedToFetchAccountInformation: "アカウント情報の取得に失敗しま
rateLimitExceeded: "レート制限を超えました" rateLimitExceeded: "レート制限を超えました"
cropImage: "画像のクロップ" cropImage: "画像のクロップ"
cropImageAsk: "画像をクロップしますか?" cropImageAsk: "画像をクロップしますか?"
cropYes: "クロップする"
cropNo: "そのまま使う"
file: "ファイル" file: "ファイル"
recentNHours: "直近{n}時間" recentNHours: "直近{n}時間"
recentNDays: "直近{n}日" recentNDays: "直近{n}日"

View File

@ -28,8 +28,8 @@
</template> </template>
</MkSelect> </MkSelect>
<div v-if="(showOkButton || showCancelButton) && !actions" :class="$style.buttons"> <div v-if="(showOkButton || showCancelButton) && !actions" :class="$style.buttons">
<MkButton v-if="showOkButton" inline primary :autofocus="!input && !select" @click="ok">{{ (showCancelButton || input || select) ? i18n.ts.ok : i18n.ts.gotIt }}</MkButton> <MkButton v-if="showOkButton" inline primary :autofocus="!input && !select" @click="ok">{{ okText ?? ((showCancelButton || input || select) ? i18n.ts.ok : i18n.ts.gotIt) }}</MkButton>
<MkButton v-if="showCancelButton || input || select" inline @click="cancel">{{ i18n.ts.cancel }}</MkButton> <MkButton v-if="showCancelButton || input || select" inline @click="cancel">{{ cancelText ?? i18n.ts.cancel }}</MkButton>
</div> </div>
<div v-if="actions" :class="$style.buttons"> <div v-if="actions" :class="$style.buttons">
<MkButton v-for="action in actions" :key="action.text" inline :primary="action.primary" @click="() => { action.callback(); close(); }">{{ action.text }}</MkButton> <MkButton v-for="action in actions" :key="action.text" inline :primary="action.primary" @click="() => { action.callback(); close(); }">{{ action.text }}</MkButton>
@ -82,6 +82,8 @@ const props = withDefaults(defineProps<{
showOkButton?: boolean; showOkButton?: boolean;
showCancelButton?: boolean; showCancelButton?: boolean;
cancelableByBgClick?: boolean; cancelableByBgClick?: boolean;
okText?: string;
cancelText?: string;
}>(), { }>(), {
type: 'info', type: 'info',
showOkButton: true, showOkButton: true,

View File

@ -171,6 +171,8 @@ export function confirm(props: {
type: 'error' | 'info' | 'success' | 'warning' | 'waiting' | 'question'; type: 'error' | 'info' | 'success' | 'warning' | 'waiting' | 'question';
title?: string | null; title?: string | null;
text?: string | null; text?: string | null;
okText?: string;
cancelText?: string;
}): Promise<{ canceled: boolean }> { }): Promise<{ canceled: boolean }> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup(MkDialog, { popup(MkDialog, {

View File

@ -150,6 +150,8 @@ function changeAvatar(ev) {
const { canceled } = await os.confirm({ const { canceled } = await os.confirm({
type: 'question', type: 'question',
text: i18n.t('cropImageAsk'), text: i18n.t('cropImageAsk'),
okText: i18n.ts.cropYes,
cancelText: i18n.ts.cropNo,
}); });
if (!canceled) { if (!canceled) {
@ -174,6 +176,8 @@ function changeBanner(ev) {
const { canceled } = await os.confirm({ const { canceled } = await os.confirm({
type: 'question', type: 'question',
text: i18n.t('cropImageAsk'), text: i18n.t('cropImageAsk'),
okText: i18n.ts.cropYes,
cancelText: i18n.ts.cropNo,
}); });
if (!canceled) { if (!canceled) {