Skip to content

Commit

Permalink
Added option to show navigation labels
Browse files Browse the repository at this point in the history
  • Loading branch information
HarlJo committed Mar 26, 2024
1 parent 3327fbb commit c3fa4ee
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ const optionSubscriptionOrderByField = 'subscription.order_by.field';

const optionThemeMode = 'theme.mode';
const optionThemeTrueBlack = 'theme.true_black';
const optionThemeMaterial3 = 'theme.material3';
const optionThemeColorScheme = 'theme.color_scheme';
const optionShowNavigationLabels = 'theme.show_navigation_labels';

const optionTweetsHideSensitive = 'tweets.hide_sensitive';

Expand Down
2 changes: 2 additions & 0 deletions lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ class MessageLookup extends MessageLookupByLibrary {
"Check for updates when Quacker starts"),
"should_check_for_updates_label":
MessageLookupByLibrary.simpleMessage("Check for updates"),
"show_navigation_labels":
MessageLookupByLibrary.simpleMessage(" Show navigation labels"),
"small": MessageLookupByLibrary.simpleMessage("Small"),
"something_broke_in_fritter":
MessageLookupByLibrary.simpleMessage("Something broke in Quacker."),
Expand Down
10 changes: 10 additions & 0 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions lib/home/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ class _ScaffoldWithBottomNavigationState extends State<ScaffoldWithBottomNavigat

@override
Widget build(BuildContext context) {
final showNavigationLabels = PrefService.of(context).get(optionShowNavigationLabels);
return Scaffold(
body: PageView(
controller: _pageController,
Expand All @@ -225,9 +226,9 @@ class _ScaffoldWithBottomNavigationState extends State<ScaffoldWithBottomNavigat
),
bottomNavigationBar: NavigationBar(
selectedIndex: currentPage,
height: 50,
labelBehavior: NavigationDestinationLabelBehavior.alwaysHide,
indicatorShape: CircleBorder(),
labelBehavior: showNavigationLabels
? NavigationDestinationLabelBehavior.alwaysShow
: NavigationDestinationLabelBehavior.alwaysHide,
destinations: [
..._pages.map((e) => NavigationDestination(icon: Icon(e.icon, size: 22), label: e.titleBuilder(context)))
],
Expand Down
3 changes: 2 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -424,5 +424,6 @@
"regex": "Regex filters",
"regexSubtitle": "Filter exclude posts containing an expression. Each filter is separated by a pipe(|): \"+\"ExampleFilter1|ExampleFilter[2-3] \n If you want to show tweets containing just your expression\"+\", use this one :^((?!expression).)*\\$",
"foryou": "For You",
"clickToShowMore": " \nClick to show more.."
"clickToShowMore": " \nClick to show more..",
"show_navigation_labels": " Show navigation labels"
}
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ Future<void> main() async {
optionSubscriptionOrderByField: 'name',
optionThemeMode: 'system',
optionThemeTrueBlack: false,
optionShowNavigationLabels: true,
optionTweetsHideSensitive: true,
optionUserTrendsLocations: jsonEncode({
'active': {'name': 'Worldwide', 'woeid': 1},
Expand Down
4 changes: 4 additions & 0 deletions lib/settings/_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class SettingsThemeFragment extends StatelessWidget {
L10n.of(context).use_true_black_for_the_dark_mode_theme,
),
),
PrefSwitch(
title: Text(L10n.of(context).show_navigation_labels),
pref: optionShowNavigationLabels,
),
]),
),
);
Expand Down

0 comments on commit c3fa4ee

Please sign in to comment.