Always show add/cycle/delete direction buttons

This commit is contained in:
stopflock committed 2025-11-13 20:17:29 -06:00
1 parent 2cf840e74d
commit f108929dce
2 files changed
+78 -50

No files matched your search

+39 -25
View File
@@ -67,34 +67,48 @@ class AddNodeSheet extends StatelessWidget {
onChanged: requiresDirection ? (v) => appState.updateSession(directionDeg: v) : null, onChanged: requiresDirection ? (v) => appState.updateSession(directionDeg: v) : null,
), ),
), ),
// Buttons on the right (only show if direction is required) // Direction control buttons - always show but grey out when direction not required
if (requiresDirection) ...[ const SizedBox(width: 8),
const SizedBox(width: 8), // Remove button
// Remove button IconButton(
IconButton( icon: Icon(
icon: const Icon(Icons.remove, size: 20), Icons.remove,
onPressed: session.directions.length > 1 ? () => appState.removeDirection() : null, size: 20,
tooltip: 'Remove current direction', color: requiresDirection ? null : Theme.of(context).disabledColor,
padding: EdgeInsets.zero,
constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight),
), ),
// Add button onPressed: requiresDirection && session.directions.length > 1
IconButton( ? () => appState.removeDirection()
icon: const Icon(Icons.add, size: 20), : null,
onPressed: () => appState.addDirection(), tooltip: requiresDirection ? 'Remove current direction' : 'Direction not required for this profile',
tooltip: 'Add new direction', padding: EdgeInsets.zero,
padding: EdgeInsets.zero, constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight),
constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight), ),
// Add button
IconButton(
icon: Icon(
Icons.add,
size: 20,
color: requiresDirection ? null : Theme.of(context).disabledColor,
), ),
// Cycle button onPressed: requiresDirection ? () => appState.addDirection() : null,
IconButton( tooltip: requiresDirection ? 'Add new direction' : 'Direction not required for this profile',
icon: const Icon(Icons.repeat, size: 20), padding: EdgeInsets.zero,
onPressed: session.directions.length > 1 ? () => appState.cycleDirection() : null, constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight),
tooltip: 'Cycle through directions', ),
padding: EdgeInsets.zero, // Cycle button
constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight), IconButton(
icon: Icon(
Icons.repeat,
size: 20,
color: requiresDirection ? null : Theme.of(context).disabledColor,
), ),
], onPressed: requiresDirection && session.directions.length > 1
? () => appState.cycleDirection()
: null,
tooltip: requiresDirection ? 'Cycle through directions' : 'Direction not required for this profile',
padding: EdgeInsets.zero,
constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight),
),
], ],
), ),
), ),
+39 -25
View File
@@ -68,34 +68,48 @@ class EditNodeSheet extends StatelessWidget {
onChanged: requiresDirection ? (v) => appState.updateEditSession(directionDeg: v) : null, onChanged: requiresDirection ? (v) => appState.updateEditSession(directionDeg: v) : null,
), ),
), ),
// Buttons on the right (only show if direction is required) // Direction control buttons - always show but grey out when direction not required
if (requiresDirection) ...[ const SizedBox(width: 8),
const SizedBox(width: 8), // Remove button
// Remove button IconButton(
IconButton( icon: Icon(
icon: const Icon(Icons.remove, size: 20), Icons.remove,
onPressed: session.directions.length > 1 ? () => appState.removeDirection() : null, size: 20,
tooltip: 'Remove current direction', color: requiresDirection ? null : Theme.of(context).disabledColor,
padding: EdgeInsets.zero,
constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight),
), ),
// Add button onPressed: requiresDirection && session.directions.length > 1
IconButton( ? () => appState.removeDirection()
icon: const Icon(Icons.add, size: 20), : null,
onPressed: () => appState.addDirection(), tooltip: requiresDirection ? 'Remove current direction' : 'Direction not required for this profile',
tooltip: 'Add new direction', padding: EdgeInsets.zero,
padding: EdgeInsets.zero, constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight),
constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight), ),
// Add button
IconButton(
icon: Icon(
Icons.add,
size: 20,
color: requiresDirection ? null : Theme.of(context).disabledColor,
), ),
// Cycle button onPressed: requiresDirection ? () => appState.addDirection() : null,
IconButton( tooltip: requiresDirection ? 'Add new direction' : 'Direction not required for this profile',
icon: const Icon(Icons.repeat, size: 20), padding: EdgeInsets.zero,
onPressed: session.directions.length > 1 ? () => appState.cycleDirection() : null, constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight),
tooltip: 'Cycle through directions', ),
padding: EdgeInsets.zero, // Cycle button
constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight), IconButton(
icon: Icon(
Icons.repeat,
size: 20,
color: requiresDirection ? null : Theme.of(context).disabledColor,
), ),
], onPressed: requiresDirection && session.directions.length > 1
? () => appState.cycleDirection()
: null,
tooltip: requiresDirection ? 'Cycle through directions' : 'Direction not required for this profile',
padding: EdgeInsets.zero,
constraints: const BoxConstraints(minWidth: kDirectionButtonMinWidth, minHeight: kDirectionButtonMinHeight),
),
], ],
), ),
), ),