Skip to content

Commit

Permalink
enhance: リアクションの背景を表示するか選択できるように
Browse files Browse the repository at this point in the history
  • Loading branch information
Esurio committed Dec 11, 2024
1 parent 3be2c49 commit fa7c5de
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4382,6 +4382,10 @@ export interface Locale extends ILocale {
* リアクションの最大横幅を制限し、縮小して表示する
*/
readonly "limitWidthOfReaction": string;
/**
* リアクションの背景を表示する
*/
readonly "hideReactionBackground": string;
/**
* ノートIDまたはURL
*/
Expand Down
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ enableStatsForFederatedInstances: "リモートサーバーの情報を取得"
showClipButtonInNoteFooter: "ノートのアクションにクリップを追加"
reactionsDisplaySize: "リアクションの表示サイズ"
limitWidthOfReaction: "リアクションの最大横幅を制限し、縮小して表示する"
hideReactionBackground: "リアクションの背景を表示する"
noteIdOrUrl: "ノートIDまたはURL"
video: "動画"
videos: "動画"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
@click="toggleReaction()"
@contextmenu.prevent.stop="menu"
>
<MkReactionIcon :class="[$style.icon, { [$style.limitWidth]: defaultStore.state.limitWidthOfReaction }]" :reaction="reaction" :emojiUrl="note.reactionEmojis[reaction.substring(1, reaction.length - 1)]"/>
<MkReactionIcon :class="[$style.icon, { [$style.limitWidth]: defaultStore.state.limitWidthOfReaction, [$style.background]: !defaultStore.state.showReactionBackground }]" :reaction="reaction" :emojiUrl="note.reactionEmojis[reaction.substring(1, reaction.length - 1)]"/>
<span :class="$style.count">{{ count }}</span>
</button>
</template>
Expand Down Expand Up @@ -248,12 +248,15 @@ if (!mock) {
object-fit: contain;
}

.background {
background-color: var(--MI_THEME-panel);
}

.icon {
box-sizing: border-box;
padding: 4px;
height: 34px;
font-size: 1.5em;
background-color: #ffffff;
}

.count {
Expand Down
2 changes: 2 additions & 0 deletions packages/frontend/src/pages/settings/general.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="large">{{ i18n.ts.large }}</option>
</MkRadios>
<MkSwitch v-model="limitWidthOfReaction">{{ i18n.ts.limitWidthOfReaction }}</MkSwitch>
<MkSwitch v-model="showReactionBackground">{{ i18n.ts.hideReactionBackground }}</MkSwitch>
</div>

<MkSelect v-model="instanceTicker">
Expand Down Expand Up @@ -288,6 +289,7 @@ const showNoteActionsOnlyHover = computed(defaultStore.makeGetterSetter('showNot
const showClipButtonInNoteFooter = computed(defaultStore.makeGetterSetter('showClipButtonInNoteFooter'));
const reactionsDisplaySize = computed(defaultStore.makeGetterSetter('reactionsDisplaySize'));
const limitWidthOfReaction = computed(defaultStore.makeGetterSetter('limitWidthOfReaction'));
const showReactionBackground = computed(defaultStore.makeGetterSetter('showReactionBackground'));
const collapseRenotes = computed(defaultStore.makeGetterSetter('collapseRenotes'));
const reduceAnimation = computed(defaultStore.makeGetterSetter('animation', v => !v, v => !v));
const useBlurEffectForModal = computed(defaultStore.makeGetterSetter('useBlurEffectForModal'));
Expand Down
4 changes: 4 additions & 0 deletions packages/frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: true,
},
showReactionBackground: {
where: 'device',
default: false,
},
forceShowAds: {
where: 'device',
default: false,
Expand Down

0 comments on commit fa7c5de

Please sign in to comment.