Commit 780bad5

derdilla <82763757+NobodyForNothing@users.noreply.github.com>
2023-10-01 11:51:19
remove custom label count
Signed-off-by: derdilla <82763757+NobodyForNothing@users.noreply.github.com>
1 parent 2cb46d5
lib/components/measurement_graph.dart
@@ -127,7 +127,6 @@ class _LineChartState extends State<_LineChart> {
       bottomTitles: AxisTitles(
         sideTitles: SideTitles(
           showTitles: true,
-
           getTitlesWidget: (double pos, TitleMeta meta) {
             // don't show fixed titles, as they are replaced by long dates below
             if (meta.axisPosition <= 1 || pos >= meta.max) {
@@ -136,11 +135,10 @@ class _LineChartState extends State<_LineChart> {
 
             // format of titles
             late final DateFormat formatter;
-
             if (graphRange.duration < const Duration(days: 2)) {
               formatter = DateFormat.Hm();
             } else if (graphRange.duration < const Duration(days: 15)) {
-              formatter = DateFormat.EEEE();
+              formatter = DateFormat.E();
             } else if (graphRange.duration < const Duration(days: 30)) {
               formatter = DateFormat.d();
             } else if (graphRange.duration < const Duration(days: 500)) {
@@ -148,8 +146,9 @@ class _LineChartState extends State<_LineChart> {
             } else {
               formatter = DateFormat.y();
             }
-              return Text(formatter
-                  .format(DateTime.fromMillisecondsSinceEpoch(pos.toInt())));
+              return Text(
+                formatter.format(DateTime.fromMillisecondsSinceEpoch(pos.toInt()))
+              );
           }
         ),
       ),
lib/l10n/app_en.arb
@@ -103,8 +103,6 @@
   "@graphLineThickness": {},
   "animationSpeed": "Animation duration",
   "@animationSpeed": {},
-  "graphTitlesCount": "Graph label count",
-  "@graphTitlesCount": {},
   "accentColor": "Theme color",
   "@accentColor": {},
   "sysColor": "Systolic color",
lib/model/ram_only_implementations.dart
@@ -68,7 +68,6 @@ class RamSettings extends ChangeNotifier implements Settings {
   int _sysWarn = 120;
   bool _useExportCompatability = false;
   bool _validateInputs = true;
-  int _graphTitlesCount = 5;
   ExportFormat _exportFormat = ExportFormat.csv;
   String _csvFieldDelimiter = ',';
   String _csvTextDelimiter = '"';
@@ -258,15 +257,6 @@ class RamSettings extends ChangeNotifier implements Settings {
     notifyListeners();
   }
 
-  @override
-  int get graphTitlesCount => _graphTitlesCount;
-
-  @override
-  set graphTitlesCount(int value) {
-    _graphTitlesCount = value;
-    notifyListeners();
-  }
-
   @override
   ExportFormat get exportFormat => _exportFormat;
 
lib/model/settings_store.dart
@@ -63,6 +63,9 @@ class Settings extends ChangeNotifier {
     if (keys.contains('iconSize')) {
       toAwait.add(_prefs.remove('iconSize'));
     }
+    if (keys.contains('titlesCount')) {
+      toAwait.add(_prefs.remove('titlesCount'));
+    }
 
     // reset variables for new version. Necessary for reusing variable names in new version and avoid having unexpected
     // breaking values in the preferences
@@ -373,15 +376,6 @@ class Settings extends ChangeNotifier {
     notifyListeners();
   }
 
-  int get graphTitlesCount {
-    return _prefs.getInt('titlesCount') ?? 5;
-  }
-
-  set graphTitlesCount(int newCount) {
-    _prefs.setInt('titlesCount', newCount);
-    notifyListeners();
-  }
-
   ExportFormat get exportFormat {
     switch (_prefs.getInt('exportFormat') ?? 0) {
       case 0:
lib/screens/settings.dart
@@ -114,18 +114,6 @@ class SettingsPage extends StatelessWidget {
                 end: 1000,
                 stepSize: 50,
               ),
-              SliderSettingsTile(
-                key: const Key('graphTitlesCount'),
-                title: Text(AppLocalizations.of(context)!.graphTitlesCount),
-                leading: const Icon(Icons.functions),
-                onChanged: (double value) {
-                  settings.graphTitlesCount = value.toInt();
-                },
-                initialValue: settings.graphTitlesCount.toDouble(),
-                start: 2,
-                end: 10,
-                stepSize: 1,
-              ),
               ColorSelectionSettingsTile(
                 key: const Key('sysColor'),
                 onMainColorChanged: (color) => settings.sysColor = createMaterialColor((color ?? Colors.green).value),