Skip to content

Commit 96b2410

Browse files
committed
Add setting to enable full-width layout
Implements FreeTubeApp#3918
1 parent d8d6196 commit 96b2410

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+198
-55
lines changed

src/renderer/App.js

+4
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ export default defineComponent({
121121

122122
externalLinkHandling: function () {
123123
return this.$store.getters.getExternalLinkHandling
124+
},
125+
126+
useFullWidthLayout: function () {
127+
return this.$store.getters.getUseFullWidthLayout
124128
}
125129
},
126130
watch: {

src/renderer/App.css src/renderer/App.scss

+12
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
flex: 1 1 0%;
1515
margin-block: 18px;
1616
margin-inline: 10px;
17+
18+
&.fullWidth {
19+
margin-block: 5px;
20+
}
1721
}
1822

1923
.banner {
@@ -50,6 +54,10 @@
5054
.routerView {
5155
margin-block: 68px;
5256
margin-inline: 8px;
57+
58+
&.fullWidth {
59+
margin-block: 68px;
60+
}
5361
}
5462

5563
.banner {
@@ -60,5 +68,9 @@
6068
.flexBox {
6169
margin-block-start: 60px;
6270
margin-block-end: -75px;
71+
72+
&.fullWidth {
73+
margin-block-start: 0;
74+
}
6375
}
6476
}

src/renderer/App.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<side-nav ref="sideNav" />
1212
<ft-flex-box
1313
class="flexBox routerView"
14+
:class="{ fullWidth: useFullWidthLayout }"
1415
role="main"
1516
>
1617
<div
@@ -41,6 +42,7 @@
4142
<RouterView
4243
ref="router"
4344
class="routerView"
45+
:class="{ fullWidth: useFullWidthLayout }"
4446
/>
4547
<!-- </keep-alive> -->
4648
</transition>
@@ -85,4 +87,4 @@
8587

8688
<style src="./themes.css" />
8789
<style src="./videoJS.css" />
88-
<style scoped src="./App.css" />
90+
<style scoped src="./App.scss" lang="scss" />

src/renderer/components/ft-profile-channel-list/ft-profile-channel-list.js

+3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export default defineComponent({
6868
locale: function () {
6969
return this.$i18n.locale.replace('_', '-')
7070
},
71+
useFullWidthLayout: function () {
72+
return this.$store.getters.getUseFullWidthLayout
73+
}
7174
},
7275
watch: {
7376
profile: function () {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.card {
2-
inline-size: 85%;
32
margin-block: 0 15px;
43
margin-inline: auto;
4+
5+
&:not(.fullWidth) {
6+
inline-size: 85%;
7+
}
58
}

src/renderer/components/ft-profile-channel-list/ft-profile-channel-list.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<ft-card class="card">
3+
<ft-card class="card" :class="{ fullWidth: useFullWidthLayout }">
44
<h2>
55
{{ $t("Profile.Subscription List") }}
66
</h2>
@@ -47,4 +47,4 @@
4747
</template>
4848

4949
<script src="./ft-profile-channel-list.js" />
50-
<style scoped src="./ft-profile-channel-list.css" />
50+
<style scoped src="./ft-profile-channel-list.scss" lang="scss" />

src/renderer/components/ft-profile-edit/ft-profile-edit.js

+3
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ export default defineComponent({
6565
this.$t('Yes'),
6666
this.$t('No')
6767
]
68+
},
69+
useFullWidthLayout: function () {
70+
return this.$store.getters.getUseFullWidthLayout
6871
}
6972
},
7073
watch: {

src/renderer/components/ft-profile-edit/ft-profile-edit.css src/renderer/components/ft-profile-edit/ft-profile-edit.scss

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
.card {
2-
inline-size: 85%;
32
margin-block: 0 15px;
43
margin-inline: auto;
4+
5+
&:not(.fullWidth) {
6+
inline-size: 85%;
7+
}
58
}
69

710
.message {
@@ -42,7 +45,7 @@
4245
}
4346

4447
@media only screen and (max-width: 680px) {
45-
.card {
48+
.card:not(.fullWidth) {
4649
inline-size: 90%;
4750
}
4851
}

src/renderer/components/ft-profile-edit/ft-profile-edit.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<ft-card class="card">
3+
<ft-card class="card" :class="{ fullWidth: useFullWidthLayout }">
44
<h2>{{ $t("Profile.Edit Profile") }}</h2>
55
<ft-flex-box>
66
<ft-input
@@ -102,4 +102,4 @@
102102
</template>
103103

104104
<script src="./ft-profile-edit.js" />
105-
<style scoped src="./ft-profile-edit.css" />
105+
<style scoped src="./ft-profile-edit.scss" lang="scss" />

src/renderer/components/ft-profile-filter-channels-list/ft-profile-filter-channels-list.js

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export default defineComponent({
5050
locale: function () {
5151
return this.$i18n.locale.replace('_', '-')
5252
},
53+
useFullWidthLayout: function () {
54+
return this.$store.getters.getUseFullWidthLayout
55+
}
5356
},
5457
watch: {
5558
profile: 'updateChannelList',

src/renderer/components/ft-profile-filter-channels-list/ft-profile-filter-channels-list.css src/renderer/components/ft-profile-filter-channels-list/ft-profile-filter-channels-list.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
.card {
2-
inline-size: 85%;
32
margin-block: 0 30px;
43
margin-inline: auto;
4+
5+
&:not(.fullWidth) {
6+
inline-size: 85%;
7+
}
58
}
69

710
.selected {

src/renderer/components/ft-profile-filter-channels-list/ft-profile-filter-channels-list.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<ft-card class="card">
3+
<ft-card class="card" :class="{ fullWidth: useFullWidthLayout }">
44
<h2>
55
{{ $t("Profile.Other Channels") }}
66
</h2>
@@ -49,4 +49,4 @@
4949
</template>
5050

5151
<script src="./ft-profile-filter-channels-list.js" />
52-
<style scoped src="./ft-profile-filter-channels-list.css" />
52+
<style scoped src="./ft-profile-filter-channels-list.scss" lang="scss" />

src/renderer/components/password-dialog/password-dialog.js

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ export default defineComponent({
1212
computed: {
1313
settingsPassword: function () {
1414
return this.$store.getters.getSettingsPassword
15+
},
16+
useFullWidthLayout: function () {
17+
return this.$store.getters.getUseFullWidthLayout
1518
}
1619
},
1720
mounted: function () {

src/renderer/components/password-dialog/password-dialog.css src/renderer/components/password-dialog/password-dialog.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
.card {
2-
inline-size: 85%;
32
margin: auto;
43
box-sizing: border-box;
4+
5+
&:not(.fullWidth) {
6+
inline-size: 85%;
7+
}
58
}
69

710
.passwordInput {

src/renderer/components/password-dialog/password-dialog.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<ft-card
33
class="card"
4+
:class="{ fullWidth: useFullWidthLayout }"
45
>
56
<h3>{{ $t("Settings.Password Dialog.Enter Password To Unlock") }}</h3>
67

@@ -16,4 +17,4 @@
1617
</template>
1718

1819
<script src="./password-dialog.js" />
19-
<style scoped src="./password-dialog.css" />
20+
<style scoped src="./password-dialog.scss" lang="scss" />

src/renderer/components/theme-settings/theme-settings.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ export default defineComponent({
8282
return this.$store.getters.getHideHeaderLogo
8383
},
8484

85+
useFullWidthLayout: function () {
86+
return this.$store.getters.getUseFullWidthLayout
87+
},
88+
8589
restartPromptMessage: function () {
8690
return this.$t('Settings["The app needs to restart for changes to take effect. Restart and apply change?"]')
8791
},
@@ -168,7 +172,8 @@ export default defineComponent({
168172
'updateUiScale',
169173
'updateDisableSmoothScrolling',
170174
'updateHideLabelsSideBar',
171-
'updateHideHeaderLogo'
175+
'updateHideHeaderLogo',
176+
'updateUseFullWidthLayout'
172177
])
173178
}
174179
})

src/renderer/components/theme-settings/theme-settings.vue

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
:default-value="hideHeaderLogo"
3838
@change="updateHideHeaderLogo"
3939
/>
40+
<ft-toggle-switch
41+
:label="$t('Settings.Theme Settings.Use Full-Width Layout')"
42+
:compact="true"
43+
:default-value="useFullWidthLayout"
44+
@change="updateUseFullWidthLayout"
45+
/>
4046
</div>
4147
</div>
4248
<ft-flex-box>

src/renderer/store/modules/settings.js

+1
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ const state = {
297297
allowDashAv1Formats: false,
298298
commentAutoLoadEnabled: false,
299299
useDeArrowTitles: false,
300+
useFullWidthLayout: false,
300301
}
301302

302303
const stateWithSideEffects = {

src/renderer/views/About/About.js

+5
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,10 @@ export default defineComponent({
8383
}
8484
]
8585
}
86+
},
87+
computed: {
88+
useFullWidthLayout: function () {
89+
return this.$store.getters.getUseFullWidthLayout
90+
}
8691
}
8792
})

src/renderer/views/About/About.scss

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
.card {
22
margin-block: 0 60px;
33
margin-inline: auto;
4-
inline-size: 85%;
54

6-
@media only screen and (max-width: 680px) {
7-
inline-size: 90%;
5+
&:not(.fullWidth) {
6+
inline-size: 85%;
7+
8+
@media only screen and (max-width: 680px) {
9+
inline-size: 90%;
10+
}
811
}
912
}
1013

src/renderer/views/About/About.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<ft-card class="card">
3+
<ft-card class="card" :class="{ fullWidth: useFullWidthLayout }">
44
<h1>
55
{{ $t("About.About") }}
66
</h1>

src/renderer/views/Channel/Channel.js

+4
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ export default defineComponent({
288288
})
289289

290290
return values
291+
},
292+
293+
useFullWidthLayout: function () {
294+
return this.$store.getters.getUseFullWidthLayout
291295
}
292296
},
293297
watch: {

src/renderer/views/Channel/Channel.css src/renderer/views/Channel/Channel.scss

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
.card {
22
position: relative;
3-
inline-size: 85%;
43
margin-block: 0 20px;
54
margin-inline: auto;
65
box-sizing: border-box;
6+
7+
&:not(.fullWidth) {
8+
inline-size: 85%;
9+
}
710
}
811

912
.channelDetails {
1013
padding: 0;
11-
max-inline-size: 92vw;
14+
15+
&:not(.fullWidth) {
16+
max-inline-size: 92vw;
17+
}
1218
}
1319

1420
.channelBannerContainer {
@@ -237,7 +243,7 @@
237243
}
238244

239245
@media only screen and (max-width: 260px) {
240-
.channelDetails {
246+
.channelDetails {
241247
max-inline-size: none;
242248
}
243249
}

src/renderer/views/Channel/Channel.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/>
99
<ft-card
1010
v-else-if="(isFamilyFriendly || !showFamilyFriendlyOnly)"
11-
class="card channelDetails"
11+
class="card channelDetails" :class="{ fullWidth: useFullWidthLayout }"
1212
>
1313
<div
1414
class="channelBannerContainer"
@@ -216,7 +216,7 @@
216216
</ft-card>
217217
<ft-card
218218
v-if="!isLoading && !errorMessage && (isFamilyFriendly || !showFamilyFriendlyOnly)"
219-
class="card"
219+
class="card" :class="{ fullWidth: useFullWidthLayout }"
220220
>
221221
<channel-about
222222
v-if="currentTab === 'about'"
@@ -409,7 +409,7 @@
409409
</ft-card>
410410
<ft-card
411411
v-if="errorMessage"
412-
class="card"
412+
class="card" :class="{ fullWidth: useFullWidthLayout }"
413413
>
414414
<p>
415415
{{ errorMessage }}
@@ -424,4 +424,4 @@
424424
</template>
425425

426426
<script src="./Channel.js" />
427-
<style scoped src="./Channel.css" />
427+
<style scoped src="./Channel.scss" lang="scss" />

src/renderer/views/Hashtag/Hashtag.js

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export default defineComponent({
3838

3939
showFetchMoreButton() {
4040
return !isNullOrEmpty(this.hashtagContinuationData) || this.apiUsed === 'invidious'
41+
},
42+
43+
useFullWidthLayout: function () {
44+
return this.$store.getters.getUseFullWidthLayout
4145
}
4246
},
4347
watch: {

src/renderer/views/Hashtag/Hashtag.css src/renderer/views/Hashtag/Hashtag.scss

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
.card {
1717
margin-block: 0 20px;
1818
margin-inline: auto;
19-
inline-size: 85%;
19+
20+
&:not(.fullWidth) {
21+
inline-size: 85%;
22+
}
2023
}
2124

2225
@media only screen and (max-width: 680px) {
23-
.card {
26+
.card:not(.fullWidth) {
2427
inline-size: 90%;
2528
}
2629
}

0 commit comments

Comments
 (0)