Make less obvious target highlighting optional

This commit is contained in:
Imran Remtulla
2023-09-09 07:29:35 -04:00
parent 4596e32258
commit 09421230f2
16 changed files with 42 additions and 1 deletions

View File

@@ -452,7 +452,11 @@ class AppsPageState extends State<AppsPage> {
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Theme.of(context).primaryColor.withAlpha(20)),
color: Theme.of(context).primaryColor.withAlpha(
(settingsProvider.highlightTouchTargets &&
showChangesFn != null)
? 20
: 0)),
padding: const EdgeInsets.fromLTRB(12, 0, 12, 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,

View File

@@ -484,6 +484,21 @@ class _SettingsPageState extends State<SettingsPage> {
})
],
),
height16,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
child: Text(tr('highlightTouchTargets'))),
Switch(
value:
settingsProvider.highlightTouchTargets,
onChanged: (value) {
settingsProvider.highlightTouchTargets =
value;
})
],
),
height32,
Text(
tr('categories'),

View File

@@ -348,4 +348,13 @@ class SettingsProvider with ChangeNotifier {
prefs?.setBool('showDebugOpts', val);
notifyListeners();
}
bool get highlightTouchTargets {
return prefs?.getBool('highlightTouchTargets') ?? false;
}
set highlightTouchTargets(bool val) {
prefs?.setBool('highlightTouchTargets', val);
notifyListeners();
}
}