mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 09:16:54 +00:00
fix(services): Make text gray for disabled service options
- Resolves https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/issues/544
This commit is contained in:
parent
758a67f59d
commit
449b9ebcb6
|
@ -47,6 +47,16 @@ class _ServicePageState extends State<ServicePage> {
|
||||||
final bool serviceLocked =
|
final bool serviceLocked =
|
||||||
context.watch<ServicesBloc>().state.isServiceLocked(service.id);
|
context.watch<ServicesBloc>().state.isServiceLocked(service.id);
|
||||||
|
|
||||||
|
final bool isRestartingEnabled = !serviceDisabled && !serviceLocked;
|
||||||
|
final bool isMovingEnabled = !serviceDisabled &&
|
||||||
|
!serviceLocked &&
|
||||||
|
service.storageUsage.volume != null;
|
||||||
|
|
||||||
|
final enabledTitleStyle = Theme.of(context).textTheme.titleMedium;
|
||||||
|
final disabledTitleStyle = enabledTitleStyle?.copyWith(
|
||||||
|
color: Theme.of(context).colorScheme.outline,
|
||||||
|
);
|
||||||
|
|
||||||
return BrandHeroScreen(
|
return BrandHeroScreen(
|
||||||
hasBackButton: true,
|
hasBackButton: true,
|
||||||
hasFlashButton: true,
|
hasFlashButton: true,
|
||||||
|
@ -75,7 +85,7 @@ class _ServicePageState extends State<ServicePage> {
|
||||||
leading: const Icon(Icons.open_in_browser),
|
leading: const Icon(Icons.open_in_browser),
|
||||||
title: Text(
|
title: Text(
|
||||||
'service_page.open_in_browser'.tr(),
|
'service_page.open_in_browser'.tr(),
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: enabledTitleStyle,
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
service.url!.replaceAll('https://', ''),
|
service.url!.replaceAll('https://', ''),
|
||||||
|
@ -92,9 +102,9 @@ class _ServicePageState extends State<ServicePage> {
|
||||||
leading: const Icon(Icons.restart_alt_outlined),
|
leading: const Icon(Icons.restart_alt_outlined),
|
||||||
title: Text(
|
title: Text(
|
||||||
'service_page.restart'.tr(),
|
'service_page.restart'.tr(),
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: isRestartingEnabled ? enabledTitleStyle : disabledTitleStyle,
|
||||||
),
|
),
|
||||||
enabled: !serviceDisabled && !serviceLocked,
|
enabled: isRestartingEnabled,
|
||||||
),
|
),
|
||||||
if (!service.isRequired)
|
if (!service.isRequired)
|
||||||
ListTile(
|
ListTile(
|
||||||
|
@ -110,7 +120,7 @@ class _ServicePageState extends State<ServicePage> {
|
||||||
serviceDisabled
|
serviceDisabled
|
||||||
? 'service_page.enable'.tr()
|
? 'service_page.enable'.tr()
|
||||||
: 'service_page.disable'.tr(),
|
: 'service_page.disable'.tr(),
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: !serviceLocked ? enabledTitleStyle : disabledTitleStyle,
|
||||||
),
|
),
|
||||||
enabled: !serviceLocked,
|
enabled: !serviceLocked,
|
||||||
),
|
),
|
||||||
|
@ -123,7 +133,7 @@ class _ServicePageState extends State<ServicePage> {
|
||||||
leading: const Icon(Icons.settings_outlined),
|
leading: const Icon(Icons.settings_outlined),
|
||||||
title: Text(
|
title: Text(
|
||||||
'service_page.settings'.tr(),
|
'service_page.settings'.tr(),
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: enabledTitleStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (service.isMovable)
|
if (service.isMovable)
|
||||||
|
@ -140,7 +150,7 @@ class _ServicePageState extends State<ServicePage> {
|
||||||
leading: const Icon(Icons.drive_file_move_outlined),
|
leading: const Icon(Icons.drive_file_move_outlined),
|
||||||
title: Text(
|
title: Text(
|
||||||
'service_page.move'.tr(),
|
'service_page.move'.tr(),
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: isMovingEnabled ? enabledTitleStyle : disabledTitleStyle,
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'service_page.uses'.tr(
|
'service_page.uses'.tr(
|
||||||
|
@ -153,11 +163,12 @@ class _ServicePageState extends State<ServicePage> {
|
||||||
.displayName,
|
.displayName,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
style: Theme.of(context).textTheme.bodyMedium,
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.bodyMedium
|
||||||
|
?.copyWith(color: Theme.of(context).colorScheme.outline),
|
||||||
),
|
),
|
||||||
enabled: !serviceDisabled &&
|
enabled: isMovingEnabled,
|
||||||
!serviceLocked &&
|
|
||||||
service.storageUsage.volume != null,
|
|
||||||
),
|
),
|
||||||
if (service.canBeBackedUp)
|
if (service.canBeBackedUp)
|
||||||
ListTile(
|
ListTile(
|
||||||
|
@ -169,7 +180,7 @@ class _ServicePageState extends State<ServicePage> {
|
||||||
leading: const Icon(Icons.settings_backup_restore_outlined),
|
leading: const Icon(Icons.settings_backup_restore_outlined),
|
||||||
title: Text(
|
title: Text(
|
||||||
'service_page.snapshots'.tr(),
|
'service_page.snapshots'.tr(),
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: enabledTitleStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
|
@ -180,7 +191,7 @@ class _ServicePageState extends State<ServicePage> {
|
||||||
leading: const Icon(Icons.manage_search_outlined),
|
leading: const Icon(Icons.manage_search_outlined),
|
||||||
title: Text(
|
title: Text(
|
||||||
'service_page.logs'.tr(),
|
'service_page.logs'.tr(),
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: enabledTitleStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue