This commit is contained in:
kakkokari-gtyih 2025-05-24 18:55:52 +09:00
parent 926e8b71e9
commit 915b1ccf2e
3 changed files with 7 additions and 10 deletions

View File

@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<g fill-rule="evenodd"> <g fill-rule="evenodd">
<rect x="21.709" y="14.787" width="120" height="80" fill="var(--MI_THEME-bg)" stop-color="#000000" stroke-dasharray="1.1384, 3.4152" stroke-width="1.1384" style="mix-blend-mode:normal" /> <rect x="21.709" y="14.787" width="120" height="80" fill="var(--MI_THEME-bg)" stop-color="#000000" stroke-dasharray="1.1384, 3.4152" stroke-width="1.1384" style="mix-blend-mode:normal" />
<rect x="21.709" y="14.787" width="120" height="80" fill="url(#pattern5942)" stop-color="#000000" stroke-dasharray="1.1384, 3.4152" stroke-width="1.1384" style="mix-blend-mode:normal" /> <rect x="21.709" y="14.787" width="120" height="80" fill="url(#pattern5942)" stop-color="#000000" stroke-dasharray="1.1384, 3.4152" stroke-width="1.1384" style="mix-blend-mode:normal" />
<rect x="47.101" y="40.105" width="69.216" height="29.364" ry="5.3019" fill="var(--MI_THEME-accentDarken)" stop-color="#000000" stroke-dasharray="1.13855, 3.41565" stroke-width="1.1386" /> <rect x="47.101" y="40.105" width="69.216" height="29.364" ry="5.3019" fill="var(--MI_THEME-accent)" stop-color="#000000" stroke-dasharray="1.13855, 3.41565" stroke-width="1.1386" />
</g> </g>
<g fill="none" stroke="var(--MI_THEME-error)"> <g fill="none" stroke="var(--MI_THEME-error)">
<path v-if="props.arrow === 'top'" d="m81.709 16.167 2e-6 22.601" marker-end="url(#Arrow3)" marker-start="url(#Arrow3)" stop-color="#000000" stroke-width="1.3038" /> <path v-if="props.arrow === 'top'" d="m81.709 16.167 2e-6 22.601" marker-end="url(#Arrow3)" marker-start="url(#Arrow3)" stop-color="#000000" stroke-width="1.3038" />

View File

@ -109,9 +109,9 @@ import XAnchorSelector from '@/components/MkWatermarkEditorDialog.anchor.vue';
import XPaddingView from '@/components/MkWatermarkEditorDialog.padding.vue'; import XPaddingView from '@/components/MkWatermarkEditorDialog.padding.vue';
import * as os from '@/os.js'; import * as os from '@/os.js';
import { defaultStore } from '@/store.js'; import { prefer } from '@/preferences.js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { selectFile } from '@/utility/select-file.js'; import { selectFile } from '@/utility/drive.js';
import { applyWatermark, canApplyWatermark } from '@/utility/watermark.js'; import { applyWatermark, canApplyWatermark } from '@/utility/watermark.js';
import { misskeyApi } from '@/utility/misskey-api.js'; import { misskeyApi } from '@/utility/misskey-api.js';
@ -133,7 +133,7 @@ function cancel() {
//#endregion //#endregion
//#region //#region
const watermarkConfig = ref<WatermarkUserConfig>(defaultStore.state.watermarkConfig ?? { const watermarkConfig = ref<WatermarkUserConfig>(prefer.s.watermarkConfig ?? {
opacity: 0.2, opacity: 0.2,
repeat: true, repeat: true,
rotate: 15, rotate: 15,
@ -202,7 +202,7 @@ const paddingBottom = computed({
function save() { function save() {
if (canApplyWatermark(watermarkConfig.value)) { if (canApplyWatermark(watermarkConfig.value)) {
defaultStore.set('watermarkConfig', watermarkConfig.value); prefer.commit('watermarkConfig', watermarkConfig.value);
} else { } else {
os.alert({ os.alert({
type: 'warning', type: 'warning',
@ -251,10 +251,7 @@ const friendlyFileName = computed<string>(() => {
}); });
function chooseFile(ev: MouseEvent) { function chooseFile(ev: MouseEvent) {
selectFile(ev.currentTarget ?? ev.target, { selectFile(ev.currentTarget ?? ev.target, i18n.ts.selectFile).then((file) => {
label: i18n.ts.selectFile,
dontUseWatermark: true,
}).then((file) => {
if (!file.type.startsWith('image')) { if (!file.type.startsWith('image')) {
os.alert({ os.alert({
type: 'warning', type: 'warning',

View File

@ -57,7 +57,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #icon><i class="ti ti-ripple"></i></template> <template #icon><i class="ti ti-ripple"></i></template>
<template #label>{{ i18n.ts.watermark }}</template> <template #label>{{ i18n.ts.watermark }}</template>
<div> <div class="_gaps_m">
<div class="_gaps"> <div class="_gaps">
<MkInfo>{{ i18n.ts.useWatermarkInfo }}</MkInfo> <MkInfo>{{ i18n.ts.useWatermarkInfo }}</MkInfo>