From 884ba91115c83f169cd971da28119bd803d5c766 Mon Sep 17 00:00:00 2001 From: David Frederick Batt <103059637+da-batt@users.noreply.github.com> Date: Thu, 31 Aug 2023 17:18:52 +0200 Subject: [PATCH] Add option to change thumbnail appearance (#3890) * Add option to blur thumbnails * Add dropdown for different thumbnail display modes * Add dropdown for different thumbnail display modes * Fix thumbnail display mode setting not appearing due to incorrect localization * Rename thumbnail display mode option 'Not Loaded' to 'Hidden' * Fix thumbnail display mode 'hidden' not working * Fix thumbnail display mode not applying to playlists Makes thumbnail display mode setting also affect thumbnails in ft-list-playlist and playlist-info. * Remove unnecessary styling Co-authored-by: PikachuEXE * Make hidden thumbnails toggleable from thumbnail preferences * Replace thumbnail placeholder png with svg * Fix thumbnail preference 'hidden' not applying to ft-list-playlist * Fix placeholder svg breaking playlist layout * Refactor ft-list-video --------- Co-authored-by: PikachuEXE --- .../assets/img/thumbnail_placeholder.svg | 1 + .../distraction-settings.js | 11 +++++++-- .../distraction-settings.vue | 7 ++++++ .../ft-list-playlist/ft-list-playlist.js | 24 +++++++++++++++++-- .../ft-list-playlist/ft-list-playlist.vue | 1 + .../components/ft-list-video/ft-list-video.js | 10 ++++++++ .../ft-list-video/ft-list-video.vue | 1 + .../general-settings/general-settings.js | 6 +++-- .../components/playlist-info/playlist-info.js | 11 +++++++++ .../playlist-info/playlist-info.vue | 1 + src/renderer/scss-partials/_ft-list-item.scss | 1 + src/renderer/store/modules/settings.js | 1 + static/locales/en-US.yaml | 2 ++ 13 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 src/renderer/assets/img/thumbnail_placeholder.svg diff --git a/src/renderer/assets/img/thumbnail_placeholder.svg b/src/renderer/assets/img/thumbnail_placeholder.svg new file mode 100644 index 000000000..aca0847aa --- /dev/null +++ b/src/renderer/assets/img/thumbnail_placeholder.svg @@ -0,0 +1 @@ + diff --git a/src/renderer/components/distraction-settings/distraction-settings.js b/src/renderer/components/distraction-settings/distraction-settings.js index 64efaa646..659409d12 100644 --- a/src/renderer/components/distraction-settings/distraction-settings.js +++ b/src/renderer/components/distraction-settings/distraction-settings.js @@ -11,7 +11,7 @@ export default defineComponent({ 'ft-settings-section': FtSettingsSection, 'ft-toggle-switch': FtToggleSwitch, 'ft-input-tags': FtInputTags, - 'ft-flex-box': FtFlexBox + 'ft-flex-box': FtFlexBox, }, computed: { hideVideoViews: function () { @@ -95,6 +95,12 @@ export default defineComponent({ showDistractionFreeTitles: function () { return this.$store.getters.getShowDistractionFreeTitles }, + thumbnailPreference: function () { + return this.$store.getters.getThumbnailPreference + }, + blurThumbnails: function () { + return this.$store.getters.getBlurThumbnails + }, channelsHidden: function () { return JSON.parse(this.$store.getters.getChannelsHidden) }, @@ -148,7 +154,8 @@ export default defineComponent({ 'updateHideChannelReleases', 'updateHideSubscriptionsVideos', 'updateHideSubscriptionsShorts', - 'updateHideSubscriptionsLive' + 'updateHideSubscriptionsLive', + 'updateBlurThumbnails' ]) } }) diff --git a/src/renderer/components/distraction-settings/distraction-settings.vue b/src/renderer/components/distraction-settings/distraction-settings.vue index 7968a2d88..4989782c0 100644 --- a/src/renderer/components/distraction-settings/distraction-settings.vue +++ b/src/renderer/components/distraction-settings/distraction-settings.vue @@ -199,6 +199,13 @@ :default-value="hideSharingActions" @change="updateHideSharingActions" /> +
diff --git a/src/renderer/scss-partials/_ft-list-item.scss b/src/renderer/scss-partials/_ft-list-item.scss index 3774ae5d4..f1a4fbb10 100644 --- a/src/renderer/scss-partials/_ft-list-item.scss +++ b/src/renderer/scss-partials/_ft-list-item.scss @@ -91,6 +91,7 @@ $watched-transition-duration: 0.5s; .thumbnailLink { display: flex; + overflow: hidden; } .thumbnailImage { diff --git a/src/renderer/store/modules/settings.js b/src/renderer/store/modules/settings.js index 816888548..ee3ff4e96 100644 --- a/src/renderer/store/modules/settings.js +++ b/src/renderer/store/modules/settings.js @@ -273,6 +273,7 @@ const state = { skip: 'doNothing' }, thumbnailPreference: '', + blurThumbnails: false, useProxy: false, useRssFeeds: false, useSponsorBlock: false, diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index fe1bccca9..b8517ca70 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -166,6 +166,7 @@ Settings: Beginning: Beginning Middle: Middle End: End + Hidden: Hidden Current Invidious Instance: Current Invidious Instance The currently set default instance is {instance}: The currently set default instance is {instance} No default instance has been set: No default instance has been set @@ -332,6 +333,7 @@ Settings: Channel Page: Channel Page Watch Page: Watch Page General: General + Blur Thumbnails: Blur Thumbnails Hide Video Views: Hide Video Views Hide Video Likes And Dislikes: Hide Video Likes And Dislikes Hide Channel Subscribers: Hide Channel Subscribers