diff --git a/src/App.js b/src/App.js index 487090565..9fb4d32e5 100644 --- a/src/App.js +++ b/src/App.js @@ -67,6 +67,11 @@ export default { data: () => ({ mobileActivePanel: 'timeline', }), + provide() { + return { + allowNonSquareEmoji: useMergedConfigStore().mergedConfig.nonSquareEmoji, + } + }, watch: { themeApplied() { this.removeSplash() diff --git a/src/components/basic_user_card/basic_user_card.js b/src/components/basic_user_card/basic_user_card.js index 0e45b140a..849e35090 100644 --- a/src/components/basic_user_card/basic_user_card.js +++ b/src/components/basic_user_card/basic_user_card.js @@ -24,6 +24,11 @@ const BasicUserCard = { ) }, }, + computed: { + allowNonSquareEmoji() { + return useMergedConfigStore().mergedConfig.nonSquareEmoji + }, + } } export default BasicUserCard diff --git a/src/components/basic_user_card/basic_user_card.vue b/src/components/basic_user_card/basic_user_card.vue index 29a60cd1e..572b07abb 100644 --- a/src/components/basic_user_card/basic_user_card.vue +++ b/src/components/basic_user_card/basic_user_card.vue @@ -27,6 +27,7 @@ class="basic-user-card-user-name-value" :html="user.name" :emoji="user.emoji" + :allow-non-square-emoji="allowNonSquareEmoji" />
diff --git a/src/components/chat_title/chat_title.js b/src/components/chat_title/chat_title.js index 3447f5163..7ec4c81f1 100644 --- a/src/components/chat_title/chat_title.js +++ b/src/components/chat_title/chat_title.js @@ -20,5 +20,8 @@ export default { htmlTitle() { return this.user ? this.user.name_html : '' }, + allowNonSquareEmoji() { + return useMergedConfigStore().mergedConfig.nonSquareEmoji + }, }, } diff --git a/src/components/chat_title/chat_title.vue b/src/components/chat_title/chat_title.vue index 00521260f..313e66ce3 100644 --- a/src/components/chat_title/chat_title.vue +++ b/src/components/chat_title/chat_title.vue @@ -19,6 +19,7 @@ :title="'@'+(user && user.screen_name_ui)" :html="htmlTitle" :emoji="user.emoji || []" + :allow-non-square-emoji="allowNonSquareEmoji" :is-local="user.is_local" />
diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 52579a413..fc4ffc518 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -210,6 +210,9 @@ const Notification = { mergedConfig() { return useMergedConfigStore().mergedConfig }, + allowNonSquareEmoji() { + return this.mergedConfig.nonSquareEmoji + }, shouldConfirmApprove() { return this.mergedConfig.modalOnApproveFollow }, diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 8d5db1374..d0accc389 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -71,6 +71,7 @@ :title="'@'+notification.from_profile.screen_name_ui" :html="notification.from_profile.name_html" :emoji="notification.from_profile.emoji" + :allow-non-square-emoji="allowNonSquareEmoji" :is-local="notification.from_profile.is_local" /> diff --git a/src/components/poll/poll.js b/src/components/poll/poll.js index 945b8b372..5033726f3 100644 --- a/src/components/poll/poll.js +++ b/src/components/poll/poll.js @@ -55,6 +55,9 @@ export default { return this.expired ? 'polls.expired' : 'polls.expires_in' } }, + allowNonSquareEmoji() { + return useMergedConfigStore().mergedConfig.nonSquareEmoji + }, loggedIn() { return this.$store.state.users.currentUser }, diff --git a/src/components/poll/poll.vue b/src/components/poll/poll.vue index 24de14200..9ac859824 100644 --- a/src/components/poll/poll.vue +++ b/src/components/poll/poll.vue @@ -24,6 +24,7 @@ :html="option.title_html" :handle-links="false" :emoji="emoji" + :allow-non-square-emoji="allowNonSquareEmoji" />
rerender -> emit -> update up the tree -> rerender -> ... // at least until vue3? const result = ( - + {this.collapse ? pass2.map((x) => { if (!Array.isArray(x)) return x.replace(/\n/g, ' ') diff --git a/src/components/rich_content/rich_content.scss b/src/components/rich_content/rich_content.scss index d2ec77dcb..33effc623 100644 --- a/src/components/rich_content/rich_content.scss +++ b/src/components/rich_content/rich_content.scss @@ -77,6 +77,14 @@ height: var(--emoji-size, 32px); } + &.-allow-non-square-emoji { + .emoji { + width: auto; + max-width: calc(var(--emoji-size, 32px) * 3); + min-width: var(--emoji-size, 32px); + } + } + .img, video { max-width: 100%; diff --git a/src/components/settings_modal/tabs/posts_tab.vue b/src/components/settings_modal/tabs/posts_tab.vue index 1e684246d..fc33d5476 100644 --- a/src/components/settings_modal/tabs/posts_tab.vue +++ b/src/components/settings_modal/tabs/posts_tab.vue @@ -169,6 +169,11 @@ {{ $t('settings.stop_gifs') }} +
  • + + {{ $t('settings.non_square_emoji') }} + +
  • @@ -153,6 +154,7 @@ diff --git a/src/components/status_body/status_body.js b/src/components/status_body/status_body.js index 5250acb9f..1b7d26403 100644 --- a/src/components/status_body/status_body.js +++ b/src/components/status_body/status_body.js @@ -43,6 +43,9 @@ const StatusBody = { localCollapseSubjectDefault() { return this.mergedConfig.collapseMessageWithSubject }, + allowNonSquareEmoji() { + return this.mergedConfig.nonSquareEmoji + }, // This is a bit hacky, but we want to approximate post height before rendering // so we count newlines (masto uses

    for paragraphs, GS uses
    between them) // as well as approximate line count by counting characters and approximating ~80 diff --git a/src/components/status_body/status_body.vue b/src/components/status_body/status_body.vue index 677781d97..f724f2413 100644 --- a/src/components/status_body/status_body.vue +++ b/src/components/status_body/status_body.vue @@ -15,6 +15,7 @@ :html="status.summary_raw_html" :emoji="status.emojis" :is-local="status.isLocal" + :allow-non-square-emoji="allowNonSquareEmoji" />