Skip to content

Commit

Permalink
Add trigger select button changes & add icons to OTA buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Jun 9, 2024
1 parent c9304f4 commit 1672c9c
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 7 deletions.
22 changes: 21 additions & 1 deletion lib/Frontend/pages/action_selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,27 @@ class _ActionSelectorState extends ConsumerState<ActionSelector> {
}
});
},
child: Text(triggersSelectSaveLabel()),
child: Row(
children: [
Icon(
Icons.save,
color: getTextColor(
Theme.of(context).colorScheme.primary,
),
),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 4),
),
Text(
triggersSelectSaveLabel(),
style: Theme.of(context).textTheme.labelLarge!.copyWith(
color: getTextColor(
Theme.of(context).colorScheme.primary,
),
),
)
],
),
)
],
),
Expand Down
22 changes: 20 additions & 2 deletions lib/Frontend/pages/ota_update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,26 @@ class _OtaUpdateState extends ConsumerState<OtaUpdate> {
children: [
FilledButton(
onPressed: (firmwareInfo != null || firmwareFile != null) ? () => beginUpdate() : null,
child: Text(
otaDownloadButtonLabel(),
child: Row(
children: [
Icon(
Icons.system_update,
color: getTextColor(
Theme.of(context).colorScheme.primary,
),
),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 4),
),
Text(
otaDownloadButtonLabel(),
style: Theme.of(context).textTheme.labelLarge!.copyWith(
color: getTextColor(
Theme.of(context).colorScheme.primary,
),
),
),
],
),
),
if (HiveProxy.getOrDefault(settings, showDebugging, defaultValue: showDebuggingDefault)) ...[
Expand Down
19 changes: 18 additions & 1 deletion lib/Frontend/pages/shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,24 @@ class _ManageGearState extends ConsumerState<ManageGear> {
foregroundColor: getTextColor(color),
elevation: 1,
),
child: Text(manageDevicesOtaButton())),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.system_update,
color: getTextColor(color),
),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 4),
),
Text(
manageDevicesOtaButton(),
style: Theme.of(context).textTheme.labelLarge!.copyWith(
color: getTextColor(color),
),
),
],
)),
)
],
Padding(
Expand Down
28 changes: 25 additions & 3 deletions lib/Frontend/pages/triggers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:tail_app/Backend/Bluetooth/bluetooth_manager.dart';
import 'package:tail_app/Backend/Definitions/Action/base_action.dart';
import 'package:tail_app/Backend/Definitions/Device/device_definition.dart';
import 'package:tail_app/Backend/sensors.dart';
import 'package:tail_app/Frontend/utils.dart';
import 'package:uuid/uuid.dart';

import '../../constants.dart';
Expand Down Expand Up @@ -56,9 +57,30 @@ class _TriggersState extends ConsumerState<Triggers> {
promptDelegate: ChoicePrompt.delegateBottomSheet(useRootNavigator: true, enableDrag: true, maxHeightFactor: 0.8),
modalHeaderBuilder: ChoiceModal.createHeader(
automaticallyImplyLeading: true,
actionsBuilder: [
ChoiceModal.createConfirmButton(),
ChoiceModal.createSpacer(width: 10),
actionsBuilder: [],
),
modalFooterBuilder: ChoiceModal.createFooter(
mainAxisAlignment: MainAxisAlignment.center,
children: [
(choiceController) => FilledButton(
onPressed: () => choiceController.closeModal(confirmed: true),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.check),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 4),
),
Text(
triggersDefSelectSaveLabel(),
style: Theme.of(context).textTheme.labelLarge!.copyWith(
color: getTextColor(
Theme.of(context).colorScheme.primary,
)),
)
],
),
),
],
),
title: triggersSelectLabel(),
Expand Down
2 changes: 2 additions & 0 deletions lib/Frontend/translation_string_definitions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ String triggersSelectAllLabel() => Intl.message('Select All', name: 'triggersSel

String triggersSelectSaveLabel() => Intl.message('Save Actions', name: 'triggersSelectSaveLabel', desc: 'The button label on the trigger select screen for saving the selected actions');

String triggersDefSelectSaveLabel() => Intl.message('Select', name: 'triggersDefSelectSaveLabel', desc: 'The button label on the trigger select screen for saving the selected actions');

String ok() => Intl.message('Ok', name: 'ok', desc: 'Ok on dialog boxes');

String cancel() => Intl.message('Cancel', name: 'cancel', desc: 'Cancel on dialog boxes');
Expand Down

0 comments on commit 1672c9c

Please sign in to comment.