Add leading icons to every settings row
This commit is contained in:
1 parent
1656486d77
commit
27cc332383
6 files changed
+382
-24
No files matched your search
@@ -496,6 +496,7 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
SettingsValueSlider(
|
||||
icon: Icons.route,
|
||||
title: l10n.appSettings_directRetries(settings.directRetries),
|
||||
subtitle: l10n.appSettings_directRetriesSubtitle,
|
||||
value: settings.directRetries,
|
||||
@@ -505,6 +506,7 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
SettingsValueSlider(
|
||||
icon: Icons.waves,
|
||||
title: l10n.appSettings_floodRetries(settings.floodRetries),
|
||||
subtitle: l10n.appSettings_floodRetriesSubtitle,
|
||||
value: settings.floodRetries,
|
||||
@@ -551,6 +553,7 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
visible: settings.channelMinHopsEnabled,
|
||||
children: [
|
||||
SettingsValueSlider(
|
||||
icon: Icons.linear_scale,
|
||||
title: l10n.appSettings_channelMinHopsCount(
|
||||
settings.channelMinHops,
|
||||
),
|
||||
@@ -560,6 +563,7 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
onChanged: settingsService.setChannelMinHops,
|
||||
),
|
||||
SettingsValueSlider(
|
||||
icon: Icons.repeat,
|
||||
title: l10n.appSettings_channelMinHopsRetries(
|
||||
settings.channelMinHopsRetries,
|
||||
),
|
||||
@@ -643,6 +647,7 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
SettingsValueSlider(
|
||||
icon: Icons.login,
|
||||
title: l10n.appSettings_loginAttempts(settings.loginAttempts),
|
||||
subtitle: l10n.appSettings_loginAttemptsSubtitle,
|
||||
value: settings.loginAttempts,
|
||||
@@ -721,15 +726,10 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
: null,
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 4,
|
||||
),
|
||||
leading: const Icon(Icons.link_outlined, size: 20),
|
||||
title: Text(context.l10n.appSettings_ipfsImageLinks),
|
||||
subtitle: Text(context.l10n.appSettings_ipfsImageLinksSubtitle),
|
||||
trailing: const Icon(Icons.chevron_right, size: 18),
|
||||
MeshNavTile(
|
||||
icon: Icons.link_outlined,
|
||||
title: context.l10n.appSettings_ipfsImageLinks,
|
||||
subtitle: context.l10n.appSettings_ipfsImageLinksSubtitle,
|
||||
onTap: () => _showIpfsImageLinksDialog(context, settingsService),
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
@@ -983,7 +983,7 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
size: 24,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@@ -1368,6 +1368,7 @@ class _RepeaterSettingsScreenState extends State<RepeaterSettingsScreen> {
|
||||
|
||||
Widget _buildClockSyncChoice() {
|
||||
final l10n = context.l10n;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final textTheme = Theme.of(context).textTheme;
|
||||
ButtonSegment<RepeaterClockSyncOverride> segment(
|
||||
RepeaterClockSyncOverride value,
|
||||
@@ -1378,16 +1379,31 @@ class _RepeaterSettingsScreenState extends State<RepeaterSettingsScreen> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
l10n.repeater_clockSyncAfterLogin,
|
||||
style: textTheme.bodyLarge?.copyWith(fontWeight: FontWeight.w600),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
l10n.repeater_clockSyncAfterLoginSubtitle,
|
||||
style: textTheme.bodyMedium?.copyWith(
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.schedule, size: 24, color: scheme.onSurfaceVariant),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
l10n.repeater_clockSyncAfterLogin,
|
||||
style: textTheme.bodyLarge?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
l10n.repeater_clockSyncAfterLoginSubtitle,
|
||||
style: textTheme.bodyMedium?.copyWith(
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
SegmentedButton<RepeaterClockSyncOverride>(
|
||||
|
||||
@@ -67,8 +67,10 @@ class SettingsReveal extends StatelessWidget {
|
||||
/// A settings slider whose selected value stays visible in the title.
|
||||
///
|
||||
/// The drag bubble repeats the same number. Pass a [title] that already
|
||||
/// includes [value], the way the channel-hop titles do.
|
||||
/// includes [value], the way the channel-hop titles do, and an [icon] so the
|
||||
/// row aligns with neighbouring [SwitchListTile] and [MeshNavTile] rows.
|
||||
class SettingsValueSlider extends StatelessWidget {
|
||||
final IconData icon;
|
||||
final String title;
|
||||
final String? subtitle;
|
||||
final int value;
|
||||
@@ -78,6 +80,7 @@ class SettingsValueSlider extends StatelessWidget {
|
||||
|
||||
const SettingsValueSlider({
|
||||
super.key,
|
||||
required this.icon,
|
||||
required this.title,
|
||||
this.subtitle,
|
||||
required this.value,
|
||||
@@ -91,6 +94,7 @@ class SettingsValueSlider extends StatelessWidget {
|
||||
final clamped = value.clamp(min, max);
|
||||
return ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||
leading: Icon(icon, size: 24),
|
||||
title: Text(title),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@@ -233,7 +233,7 @@ class TranslationSettingsSection extends StatelessWidget {
|
||||
? scheme.primary
|
||||
: scheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(MeshRadii.xs),
|
||||
|
||||
Reference in new issue
Block a user