diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 06ecbcfa2..791f05127 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -2221,6 +2221,26 @@ "@postTitleFontScale": { "description": "Setting for post title font scale" }, + "postTitleBold": "Bold post titles", + "@postTitleBold": { + "description": "Setting for bolding post titles" + }, + "postTitleFontWeight": "Post Title Weight", + "@postTitleFontWeight": { + "description": "Setting for post title font weight" + }, + "postTitleFontWeightNormal": "Normal", + "@postTitleFontWeightNormal": { + "description": "Label for normal post title font weight" + }, + "postTitleFontWeightBold": "Bold", + "@postTitleFontWeightBold": { + "description": "Label for bold post title font weight" + }, + "postTitleFontWeightExtraBold": "Extra bold", + "@postTitleFontWeightExtraBold": { + "description": "Label for extra bold post title font weight" + }, "postTogglePreview": "Toggle Preview", "@postTogglePreview": {}, "postURL": "URL", diff --git a/lib/l10n/generated/app_localizations.dart b/lib/l10n/generated/app_localizations.dart index 8e683522e..31bac4a8c 100644 --- a/lib/l10n/generated/app_localizations.dart +++ b/lib/l10n/generated/app_localizations.dart @@ -3522,6 +3522,36 @@ abstract class AppLocalizations { /// **'Post Title Font Scale'** String get postTitleFontScale; + /// Setting for bolding post titles + /// + /// In en, this message translates to: + /// **'Bold post titles'** + String get postTitleBold; + + /// Setting for post title font weight + /// + /// In en, this message translates to: + /// **'Post Title Weight'** + String get postTitleFontWeight; + + /// Label for normal post title font weight + /// + /// In en, this message translates to: + /// **'Normal'** + String get postTitleFontWeightNormal; + + /// Label for bold post title font weight + /// + /// In en, this message translates to: + /// **'Bold'** + String get postTitleFontWeightBold; + + /// Label for extra bold post title font weight + /// + /// In en, this message translates to: + /// **'Extra bold'** + String get postTitleFontWeightExtraBold; + /// No description provided for @postTogglePreview. /// /// In en, this message translates to: diff --git a/lib/l10n/generated/app_localizations_ar.dart b/lib/l10n/generated/app_localizations_ar.dart index 799a042a9..a9e140a9f 100644 --- a/lib/l10n/generated/app_localizations_ar.dart +++ b/lib/l10n/generated/app_localizations_ar.dart @@ -1924,6 +1924,21 @@ class AppLocalizationsAr extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Toggle Preview'; diff --git a/lib/l10n/generated/app_localizations_be.dart b/lib/l10n/generated/app_localizations_be.dart index 869cda153..b8296024a 100644 --- a/lib/l10n/generated/app_localizations_be.dart +++ b/lib/l10n/generated/app_localizations_be.dart @@ -1932,6 +1932,21 @@ class AppLocalizationsBe extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Toggle Preview'; diff --git a/lib/l10n/generated/app_localizations_cs.dart b/lib/l10n/generated/app_localizations_cs.dart index 64acbf230..56e3fa3e6 100644 --- a/lib/l10n/generated/app_localizations_cs.dart +++ b/lib/l10n/generated/app_localizations_cs.dart @@ -1937,6 +1937,21 @@ class AppLocalizationsCs extends AppLocalizations { @override String get postTitleFontScale => 'Velikost Fontu u Nadpisu Příspěvku'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Ukázat Náhled'; diff --git a/lib/l10n/generated/app_localizations_de.dart b/lib/l10n/generated/app_localizations_de.dart index 7274151aa..79b5e5865 100644 --- a/lib/l10n/generated/app_localizations_de.dart +++ b/lib/l10n/generated/app_localizations_de.dart @@ -1963,6 +1963,21 @@ class AppLocalizationsDe extends AppLocalizations { @override String get postTitleFontScale => 'Posttitel Schriftgröße'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Vorschau umschalten'; diff --git a/lib/l10n/generated/app_localizations_en.dart b/lib/l10n/generated/app_localizations_en.dart index 532b62bb2..fda7acebd 100644 --- a/lib/l10n/generated/app_localizations_en.dart +++ b/lib/l10n/generated/app_localizations_en.dart @@ -1932,6 +1932,21 @@ class AppLocalizationsEn extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Toggle Preview'; diff --git a/lib/l10n/generated/app_localizations_eo.dart b/lib/l10n/generated/app_localizations_eo.dart index 77ebcec4d..a01a4a827 100644 --- a/lib/l10n/generated/app_localizations_eo.dart +++ b/lib/l10n/generated/app_localizations_eo.dart @@ -1921,6 +1921,21 @@ class AppLocalizationsEo extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Baskuligi Antaŭrigardon'; diff --git a/lib/l10n/generated/app_localizations_es.dart b/lib/l10n/generated/app_localizations_es.dart index 41538e7d9..5ea782fe7 100644 --- a/lib/l10n/generated/app_localizations_es.dart +++ b/lib/l10n/generated/app_localizations_es.dart @@ -1971,6 +1971,21 @@ class AppLocalizationsEs extends AppLocalizations { String get postTitleFontScale => 'Tamaño de la fuente del título de la publicación'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Cambiar vista previa'; diff --git a/lib/l10n/generated/app_localizations_fi.dart b/lib/l10n/generated/app_localizations_fi.dart index 5bdd3bdb3..0f465c110 100644 --- a/lib/l10n/generated/app_localizations_fi.dart +++ b/lib/l10n/generated/app_localizations_fi.dart @@ -1924,6 +1924,21 @@ class AppLocalizationsFi extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Kytke Esikatselu'; diff --git a/lib/l10n/generated/app_localizations_fr.dart b/lib/l10n/generated/app_localizations_fr.dart index 65557e083..45bb50264 100644 --- a/lib/l10n/generated/app_localizations_fr.dart +++ b/lib/l10n/generated/app_localizations_fr.dart @@ -1959,6 +1959,21 @@ class AppLocalizationsFr extends AppLocalizations { @override String get postTitleFontScale => 'Taille de police du titre des publications'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Aperçu des modifications'; diff --git a/lib/l10n/generated/app_localizations_hu.dart b/lib/l10n/generated/app_localizations_hu.dart index 90e10c906..3e32d90a4 100644 --- a/lib/l10n/generated/app_localizations_hu.dart +++ b/lib/l10n/generated/app_localizations_hu.dart @@ -1932,6 +1932,21 @@ class AppLocalizationsHu extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Toggle Preview'; diff --git a/lib/l10n/generated/app_localizations_it.dart b/lib/l10n/generated/app_localizations_it.dart index b7502d997..a496b77bd 100644 --- a/lib/l10n/generated/app_localizations_it.dart +++ b/lib/l10n/generated/app_localizations_it.dart @@ -1937,6 +1937,21 @@ class AppLocalizationsIt extends AppLocalizations { @override String get postTitleFontScale => 'Scala Font Titolo Post'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Aziona Anteprima'; diff --git a/lib/l10n/generated/app_localizations_nb.dart b/lib/l10n/generated/app_localizations_nb.dart index b81727c77..d9e6cae66 100644 --- a/lib/l10n/generated/app_localizations_nb.dart +++ b/lib/l10n/generated/app_localizations_nb.dart @@ -1914,6 +1914,21 @@ class AppLocalizationsNb extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Veksle forhåndsvisning'; diff --git a/lib/l10n/generated/app_localizations_nl.dart b/lib/l10n/generated/app_localizations_nl.dart index 2a84ecaec..d5a50c1dc 100644 --- a/lib/l10n/generated/app_localizations_nl.dart +++ b/lib/l10n/generated/app_localizations_nl.dart @@ -1952,6 +1952,21 @@ class AppLocalizationsNl extends AppLocalizations { @override String get postTitleFontScale => 'Letter­grootte van bericht­titel'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Voor­vertoning omschakelen'; diff --git a/lib/l10n/generated/app_localizations_pl.dart b/lib/l10n/generated/app_localizations_pl.dart index 91f3a1046..afa3de2c8 100644 --- a/lib/l10n/generated/app_localizations_pl.dart +++ b/lib/l10n/generated/app_localizations_pl.dart @@ -1939,6 +1939,21 @@ class AppLocalizationsPl extends AppLocalizations { @override String get postTitleFontScale => 'Skala Czcionki Tytułu Wpisu'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Przełącz Podgląd'; diff --git a/lib/l10n/generated/app_localizations_ps.dart b/lib/l10n/generated/app_localizations_ps.dart index 695af5418..eb9998154 100644 --- a/lib/l10n/generated/app_localizations_ps.dart +++ b/lib/l10n/generated/app_localizations_ps.dart @@ -1933,6 +1933,21 @@ class AppLocalizationsPs extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Toggle Preview'; diff --git a/lib/l10n/generated/app_localizations_pt.dart b/lib/l10n/generated/app_localizations_pt.dart index 218e9b93d..bf79d787e 100644 --- a/lib/l10n/generated/app_localizations_pt.dart +++ b/lib/l10n/generated/app_localizations_pt.dart @@ -1962,6 +1962,21 @@ class AppLocalizationsPt extends AppLocalizations { @override String get postTitleFontScale => 'Escala da fonte de título de postagens'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Alternar pré-visualização'; diff --git a/lib/l10n/generated/app_localizations_ru.dart b/lib/l10n/generated/app_localizations_ru.dart index f96479b97..f4dd41831 100644 --- a/lib/l10n/generated/app_localizations_ru.dart +++ b/lib/l10n/generated/app_localizations_ru.dart @@ -1930,6 +1930,21 @@ class AppLocalizationsRu extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Переключить просмотр'; diff --git a/lib/l10n/generated/app_localizations_sk.dart b/lib/l10n/generated/app_localizations_sk.dart index 053067a72..081d52d78 100644 --- a/lib/l10n/generated/app_localizations_sk.dart +++ b/lib/l10n/generated/app_localizations_sk.dart @@ -1940,6 +1940,21 @@ class AppLocalizationsSk extends AppLocalizations { @override String get postTitleFontScale => 'Mierka písma nadpisu'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Ukázať náhľad'; diff --git a/lib/l10n/generated/app_localizations_sv.dart b/lib/l10n/generated/app_localizations_sv.dart index 09af78650..906e5f26c 100644 --- a/lib/l10n/generated/app_localizations_sv.dart +++ b/lib/l10n/generated/app_localizations_sv.dart @@ -1926,6 +1926,21 @@ class AppLocalizationsSv extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Förhandsvisning'; diff --git a/lib/l10n/generated/app_localizations_ta.dart b/lib/l10n/generated/app_localizations_ta.dart index c565b64d3..787e2aa9a 100644 --- a/lib/l10n/generated/app_localizations_ta.dart +++ b/lib/l10n/generated/app_localizations_ta.dart @@ -1967,6 +1967,21 @@ class AppLocalizationsTa extends AppLocalizations { @override String get postTitleFontScale => 'தலைப்பு எழுத்துரு அளவை இடுங்கள்'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'முன்னோட்டத்தை மாற்றவும்'; diff --git a/lib/l10n/generated/app_localizations_tr.dart b/lib/l10n/generated/app_localizations_tr.dart index 812ed5bcb..93b36debd 100644 --- a/lib/l10n/generated/app_localizations_tr.dart +++ b/lib/l10n/generated/app_localizations_tr.dart @@ -1940,6 +1940,21 @@ class AppLocalizationsTr extends AppLocalizations { @override String get postTitleFontScale => 'Gönderi Başlığı Yazı Tipi Ölçeği'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Önizlemeyi Aç/Kapat'; diff --git a/lib/l10n/generated/app_localizations_uk.dart b/lib/l10n/generated/app_localizations_uk.dart index 27de31a2c..89afa5ee5 100644 --- a/lib/l10n/generated/app_localizations_uk.dart +++ b/lib/l10n/generated/app_localizations_uk.dart @@ -1927,6 +1927,21 @@ class AppLocalizationsUk extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Toggle Preview'; diff --git a/lib/l10n/generated/app_localizations_zh.dart b/lib/l10n/generated/app_localizations_zh.dart index 1c30a6b91..93930ef8e 100644 --- a/lib/l10n/generated/app_localizations_zh.dart +++ b/lib/l10n/generated/app_localizations_zh.dart @@ -1932,6 +1932,21 @@ class AppLocalizationsZh extends AppLocalizations { @override String get postTitleFontScale => 'Post Title Font Scale'; + @override + String get postTitleBold => 'Bold post titles'; + + @override + String get postTitleFontWeight => 'Post Title Weight'; + + @override + String get postTitleFontWeightNormal => 'Normal'; + + @override + String get postTitleFontWeightBold => 'Bold'; + + @override + String get postTitleFontWeightExtraBold => 'Extra bold'; + @override String get postTogglePreview => 'Toggle Preview'; diff --git a/lib/src/features/post/presentation/widgets/post_body/post_body_title.dart b/lib/src/features/post/presentation/widgets/post_body/post_body_title.dart index 6c6f70840..2eaa91194 100644 --- a/lib/src/features/post/presentation/widgets/post_body/post_body_title.dart +++ b/lib/src/features/post/presentation/widgets/post_body/post_body_title.dart @@ -102,6 +102,7 @@ class PostBodyTitle extends StatelessWidget { Widget _buildTitleText(BuildContext context) { final theme = Theme.of(context); final titleFontSizeScale = context.select((cubit) => cubit.state.titleFontSizeScale); + final titleFontWeight = context.select((cubit) => cubit.state.titleFontWeight); return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -109,7 +110,7 @@ class PostBodyTitle extends StatelessWidget { ThunderScalableText( post.name, textScaleFactor: titleFontSizeScale.textScaleFactor, - style: theme.textTheme.titleMedium, + style: theme.textTheme.titleMedium?.copyWith(fontWeight: titleFontWeight.toWeight()), ), ], ); diff --git a/lib/src/features/post/presentation/widgets/post_card_title.dart b/lib/src/features/post/presentation/widgets/post_card_title.dart index 8ef3c85c7..96b595e4b 100644 --- a/lib/src/features/post/presentation/widgets/post_card_title.dart +++ b/lib/src/features/post/presentation/widgets/post_card_title.dart @@ -69,6 +69,7 @@ class PostCardTitle extends StatelessWidget { final theme = Theme.of(context); final textStyle = theme.textTheme.bodyMedium; + final titleFontWeight = context.select((cubit) => cubit.state.titleFontWeight); final textScaleFactor = context.select((cubit) => cubit.state.titleFontSizeScale.textScaleFactor); final fontSize = _calculateFontSize(context, textStyle, textScaleFactor); @@ -84,7 +85,7 @@ class PostCardTitle extends StatelessWidget { TextSpan( text: title, style: textStyle?.copyWith( - fontWeight: FontWeight.w600, + fontWeight: titleFontWeight.toWeight(), fontSize: fontSize, color: _getTitleColor(theme), ), diff --git a/lib/src/features/settings/application/state/theme_preferences_cubit/theme_preferences_cubit.dart b/lib/src/features/settings/application/state/theme_preferences_cubit/theme_preferences_cubit.dart index a620aa83f..d81bea9c8 100644 --- a/lib/src/features/settings/application/state/theme_preferences_cubit/theme_preferences_cubit.dart +++ b/lib/src/features/settings/application/state/theme_preferences_cubit/theme_preferences_cubit.dart @@ -49,6 +49,7 @@ class ThemePreferencesCubit extends Cubit { // Font Settings final titleFontSizeScale = FontScale.values.byName(_preferencesStore.getLocalSetting(LocalSettings.titleFontSizeScale) ?? FontScale.base.name); + final titleFontWeight = TitleFontWeight.values.byName(_preferencesStore.getLocalSetting(LocalSettings.titleFontWeight) ?? TitleFontWeight.normal.name); final contentFontSizeScale = FontScale.values.byName(_preferencesStore.getLocalSetting(LocalSettings.contentFontSizeScale) ?? FontScale.base.name); final commentFontSizeScale = FontScale.values.byName(_preferencesStore.getLocalSetting(LocalSettings.commentFontSizeScale) ?? FontScale.base.name); final metadataFontSizeScale = FontScale.values.byName(_preferencesStore.getLocalSetting(LocalSettings.metadataFontSizeScale) ?? FontScale.base.name); @@ -79,6 +80,7 @@ class ThemePreferencesCubit extends Cubit { replyColor: replyColor, hideColor: hideColor, titleFontSizeScale: titleFontSizeScale, + titleFontWeight: titleFontWeight, contentFontSizeScale: contentFontSizeScale, commentFontSizeScale: commentFontSizeScale, metadataFontSizeScale: metadataFontSizeScale, diff --git a/lib/src/features/settings/application/state/theme_preferences_cubit/theme_preferences_state.dart b/lib/src/features/settings/application/state/theme_preferences_cubit/theme_preferences_state.dart index d6c8fd037..fa0a23fe4 100644 --- a/lib/src/features/settings/application/state/theme_preferences_cubit/theme_preferences_state.dart +++ b/lib/src/features/settings/application/state/theme_preferences_cubit/theme_preferences_state.dart @@ -13,6 +13,7 @@ class ThemePreferencesState extends Equatable { this.replyColor = const ActionColor.fromString(colorRaw: ActionColor.green), this.hideColor = const ActionColor.fromString(colorRaw: ActionColor.red), this.titleFontSizeScale = FontScale.base, + this.titleFontWeight = TitleFontWeight.normal, this.contentFontSizeScale = FontScale.base, this.commentFontSizeScale = FontScale.base, this.metadataFontSizeScale = FontScale.base, @@ -63,6 +64,9 @@ class ThemePreferencesState extends Equatable { /// The font scale to use for the title font size (post title) final FontScale titleFontSizeScale; + /// The font weight to use for the title font (post title) + final TitleFontWeight titleFontWeight; + /// The font scale to use for the content font size (post content) final FontScale contentFontSizeScale; @@ -128,6 +132,7 @@ class ThemePreferencesState extends Equatable { ActionColor? replyColor, ActionColor? hideColor, FontScale? titleFontSizeScale, + TitleFontWeight? titleFontWeight, FontScale? contentFontSizeScale, FontScale? commentFontSizeScale, FontScale? metadataFontSizeScale, @@ -156,6 +161,7 @@ class ThemePreferencesState extends Equatable { replyColor: replyColor ?? this.replyColor, hideColor: hideColor ?? this.hideColor, titleFontSizeScale: titleFontSizeScale ?? this.titleFontSizeScale, + titleFontWeight: titleFontWeight ?? this.titleFontWeight, contentFontSizeScale: contentFontSizeScale ?? this.contentFontSizeScale, commentFontSizeScale: commentFontSizeScale ?? this.commentFontSizeScale, metadataFontSizeScale: metadataFontSizeScale ?? this.metadataFontSizeScale, @@ -188,6 +194,7 @@ class ThemePreferencesState extends Equatable { replyColor, hideColor, titleFontSizeScale, + titleFontWeight, contentFontSizeScale, commentFontSizeScale, metadataFontSizeScale, @@ -205,3 +212,27 @@ class ThemePreferencesState extends Equatable { communityFullNameInstanceNameColor, ]; } + +enum TitleFontWeight { + normal, + bold, + extraBold, +} + +extension TitleFontWeightExtension on TitleFontWeight { + FontWeight toWeight() { + return switch (this) { + TitleFontWeight.normal => FontWeight.w600, + TitleFontWeight.bold => FontWeight.w800, + TitleFontWeight.extraBold => FontWeight.w900, + }; + } + + String get label { + return switch (this) { + TitleFontWeight.normal => 'Normal', + TitleFontWeight.bold => 'Bold', + TitleFontWeight.extraBold => 'Extra bold', + }; + } +} diff --git a/lib/src/features/settings/presentation/pages/appearance/theme_settings_page.dart b/lib/src/features/settings/presentation/pages/appearance/theme_settings_page.dart index 3a8f98283..cddf70aba 100644 --- a/lib/src/features/settings/presentation/pages/appearance/theme_settings_page.dart +++ b/lib/src/features/settings/presentation/pages/appearance/theme_settings_page.dart @@ -121,6 +121,8 @@ class _ThemeSettingsPageState extends State { // Font Settings FontScale titleFontSizeScale = FontScale.base; + TitleFontWeight titleFontWeight = TitleFontWeight.normal; + List> titleFontWeightOptions = []; FontScale contentFontSizeScale = FontScale.base; FontScale commentFontSizeScale = FontScale.base; FontScale metadataFontSizeScale = FontScale.base; @@ -231,6 +233,13 @@ class _ThemeSettingsPageState extends State { context.read().reload(); } break; + case LocalSettings.titleFontWeight: + await prefs.setString(LocalSettings.titleFontWeight.name, (value as TitleFontWeight).name); + setState(() => titleFontWeight = value); + if (context.mounted) { + context.read().reload(); + } + break; case LocalSettings.contentFontSizeScale: await prefs.setString(LocalSettings.contentFontSizeScale.name, (value as FontScale).name); setState(() => contentFontSizeScale = value); @@ -333,6 +342,7 @@ class _ThemeSettingsPageState extends State { // Font Settings titleFontSizeScale = FontScale.values.byName(prefs.getString(LocalSettings.titleFontSizeScale.name) ?? FontScale.base.name); + titleFontWeight = TitleFontWeight.values.byName(prefs.getString(LocalSettings.titleFontWeight.name) ?? TitleFontWeight.normal.name); contentFontSizeScale = FontScale.values.byName(prefs.getString(LocalSettings.contentFontSizeScale.name) ?? FontScale.base.name); commentFontSizeScale = FontScale.values.byName(prefs.getString(LocalSettings.commentFontSizeScale.name) ?? FontScale.base.name); metadataFontSizeScale = FontScale.values.byName(prefs.getString(LocalSettings.metadataFontSizeScale.name) ?? FontScale.base.name); @@ -373,6 +383,19 @@ class _ThemeSettingsPageState extends State { ), ) .toList(); + titleFontWeightOptions = TitleFontWeight.values + .map( + (TitleFontWeight weight) => ThunderListPickerItem( + icon: Icons.format_bold, + label: switch (weight) { + TitleFontWeight.normal => l10n.postTitleFontWeightNormal, + TitleFontWeight.bold => l10n.postTitleFontWeightBold, + TitleFontWeight.extraBold => l10n.postTitleFontWeightExtraBold, + }, + payload: weight, + ), + ) + .toList(); }); } @@ -553,6 +576,22 @@ class _ThemeSettingsPageState extends State { highlightKey: settingToHighlightKey, onLongPress: () => shareLocalSetting(context, LocalSettings.titleFontSizeScale), highlighted: settingToHighlight == LocalSettings.titleFontSizeScale), + ThunderListOption( + title: l10n.postTitleFontWeight, + value: ThunderListPickerItem( + label: switch (titleFontWeight) { + TitleFontWeight.normal => l10n.postTitleFontWeightNormal, + TitleFontWeight.bold => l10n.postTitleFontWeightBold, + TitleFontWeight.extraBold => l10n.postTitleFontWeightExtraBold, + }, + icon: Icons.format_bold, + payload: titleFontWeight), + options: titleFontWeightOptions, + leading: Icon(Icons.format_bold), + onChanged: (value) async => setPreferences(LocalSettings.titleFontWeight, value.payload), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting(context, LocalSettings.titleFontWeight), + highlighted: settingToHighlight == LocalSettings.titleFontWeight), ThunderListOption( title: l10n.postContentFontScale, value: ThunderListPickerItem(label: contentFontSizeScale.name.capitalize, icon: Icons.feed, payload: contentFontSizeScale), diff --git a/lib/src/foundation/primitives/enums/local_settings.dart b/lib/src/foundation/primitives/enums/local_settings.dart index 0785c88bb..9a5878528 100644 --- a/lib/src/foundation/primitives/enums/local_settings.dart +++ b/lib/src/foundation/primitives/enums/local_settings.dart @@ -284,6 +284,7 @@ enum LocalSettings { // Font Settings titleFontSizeScale(name: 'setting_theme_title_font_size_scale', key: 'postTitleFontScale', category: LocalSettingsCategories.theming, subCategory: LocalSettingsSubCategories.fonts), + titleFontWeight(name: 'setting_theme_title_font_weight', key: 'postTitleFontWeight', category: LocalSettingsCategories.theming, subCategory: LocalSettingsSubCategories.fonts), contentFontSizeScale(name: 'setting_theme_content_font_size_scale', key: 'postContentFontScale', category: LocalSettingsCategories.theming, subCategory: LocalSettingsSubCategories.fonts), commentFontSizeScale(name: 'setting_theme_comment_font_size_scale', key: 'commentFontScale', category: LocalSettingsCategories.theming, subCategory: LocalSettingsSubCategories.fonts), metadataFontSizeScale(name: 'setting_theme_metadata_font_size_scale', key: 'metadataFontScale', category: LocalSettingsCategories.theming, subCategory: LocalSettingsSubCategories.fonts),