From df45147c2165355e67dae1b0df88d2c3b10187f5 Mon Sep 17 00:00:00 2001 From: nezznee Date: Sat, 6 Jun 2026 10:58:48 +0200 Subject: [PATCH 1/3] Added subtype tool switching for selection and spacer --- api/lib/src/models/tool.dart | 2 +- api/lib/src/models/tool.freezed.dart | 12 ++++----- api/lib/src/models/tool.g.dart | 6 ++--- app/lib/dialogs/import/add.dart | 4 +-- app/lib/handlers/select.dart | 6 ++--- app/lib/models/defaults.dart | 2 +- app/lib/selections/selection.dart | 2 ++ app/lib/selections/tools/selection.dart | 36 +++++++++++++++++++++++++ app/lib/selections/tools/spacer.dart | 36 +++++++++++++++++++++++++ app/lib/selections/tools/tool.dart | 2 ++ app/lib/visualizer/tool.dart | 31 +++++++++++++++++++-- 11 files changed, 121 insertions(+), 18 deletions(-) create mode 100644 app/lib/selections/tools/selection.dart create mode 100644 app/lib/selections/tools/spacer.dart diff --git a/api/lib/src/models/tool.dart b/api/lib/src/models/tool.dart index 3e99119029d1..26899531663d 100644 --- a/api/lib/src/models/tool.dart +++ b/api/lib/src/models/tool.dart @@ -48,7 +48,7 @@ sealed class Tool with _$Tool { @Default('') String name, @Default('') String displayIcon, @IdJsonConverter() String? id, - @Default(SelectMode.rectangle) SelectMode mode, + @Default(SelectMode.rectangle) SelectMode selectMode, }) = SelectTool; factory Tool.hand({ diff --git a/api/lib/src/models/tool.freezed.dart b/api/lib/src/models/tool.freezed.dart index a4bcf4d86a98..ee286eaa2bde 100644 --- a/api/lib/src/models/tool.freezed.dart +++ b/api/lib/src/models/tool.freezed.dart @@ -190,13 +190,13 @@ as String?, @JsonSerializable() class SelectTool extends Tool { - SelectTool({this.name = '', this.displayIcon = '', @IdJsonConverter() this.id, this.mode = SelectMode.rectangle, final String? $type}): $type = $type ?? 'select',super._(); + SelectTool({this.name = '', this.displayIcon = '', @IdJsonConverter() this.id, this.selectMode = SelectMode.rectangle, final String? $type}): $type = $type ?? 'select',super._(); factory SelectTool.fromJson(Map json) => _$SelectToolFromJson(json); @override@JsonKey() final String name; @override@JsonKey() final String displayIcon; @override@IdJsonConverter() final String? id; -@JsonKey() final SelectMode mode; +@JsonKey() final SelectMode selectMode; @JsonKey(name: 'type') final String $type; @@ -217,7 +217,7 @@ Map toJson() { @override String toString() { - return 'Tool.select(name: $name, displayIcon: $displayIcon, id: $id, mode: $mode)'; + return 'Tool.select(name: $name, displayIcon: $displayIcon, id: $id, selectMode: $selectMode)'; } @@ -228,7 +228,7 @@ abstract mixin class $SelectToolCopyWith<$Res> implements $ToolCopyWith<$Res> { factory $SelectToolCopyWith(SelectTool value, $Res Function(SelectTool) _then) = _$SelectToolCopyWithImpl; @override @useResult $Res call({ - String name, String displayIcon,@IdJsonConverter() String? id, SelectMode mode + String name, String displayIcon,@IdJsonConverter() String? id, SelectMode selectMode }); @@ -245,12 +245,12 @@ class _$SelectToolCopyWithImpl<$Res> /// Create a copy of Tool /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? displayIcon = null,Object? id = freezed,Object? mode = null,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? displayIcon = null,Object? id = freezed,Object? selectMode = null,}) { return _then(SelectTool( name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,displayIcon: null == displayIcon ? _self.displayIcon : displayIcon // ignore: cast_nullable_to_non_nullable as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String?,mode: null == mode ? _self.mode : mode // ignore: cast_nullable_to_non_nullable +as String?,selectMode: null == selectMode ? _self.selectMode : selectMode // ignore: cast_nullable_to_non_nullable as SelectMode, )); } diff --git a/api/lib/src/models/tool.g.dart b/api/lib/src/models/tool.g.dart index 1d2bbb16c19c..82afb2909f93 100644 --- a/api/lib/src/models/tool.g.dart +++ b/api/lib/src/models/tool.g.dart @@ -10,8 +10,8 @@ SelectTool _$SelectToolFromJson(Map json) => SelectTool( name: json['name'] as String? ?? '', displayIcon: json['displayIcon'] as String? ?? '', id: const IdJsonConverter().fromJson(json['id'] as String?), - mode: - $enumDecodeNullable(_$SelectModeEnumMap, json['mode']) ?? + selectMode: + $enumDecodeNullable(_$SelectModeEnumMap, json['selectMode']) ?? SelectMode.rectangle, $type: json['type'] as String?, ); @@ -21,7 +21,7 @@ Map _$SelectToolToJson(SelectTool instance) => 'name': instance.name, 'displayIcon': instance.displayIcon, 'id': const IdJsonConverter().toJson(instance.id), - 'mode': _$SelectModeEnumMap[instance.mode]!, + 'selectMode': _$SelectModeEnumMap[instance.selectMode]!, 'type': instance.$type, }; diff --git a/app/lib/dialogs/import/add.dart b/app/lib/dialogs/import/add.dart index 7924b83b7f79..2d2b06c5ba26 100644 --- a/app/lib/dialogs/import/add.dart +++ b/app/lib/dialogs/import/add.dart @@ -249,8 +249,8 @@ class _AddDialogState extends State { final tools = [ Tool.hand, - () => Tool.select(mode: SelectMode.lasso), - () => Tool.select(mode: SelectMode.rectangle), + () => Tool.select(selectMode: SelectMode.lasso), + () => Tool.select(selectMode: SelectMode.rectangle), Tool.pen, Tool.laser, Tool.pathEraser, diff --git a/app/lib/handlers/select.dart b/app/lib/handlers/select.dart index 1be231b4ac4c..d3d55f805d29 100644 --- a/app/lib/handlers/select.dart +++ b/app/lib/handlers/select.dart @@ -403,7 +403,7 @@ class SelectHandler extends Handler { ); return true; } - _rectangleFreeSelectionStart = data.mode == SelectMode.rectangle + _rectangleFreeSelectionStart = data.selectMode == SelectMode.rectangle ? globalPos : null; context.refresh(); @@ -477,10 +477,10 @@ class SelectHandler extends Handler { return; } final start = _rectangleFreeSelectionStart ?? globalPos; - _rectangleFreeSelection = data.mode == SelectMode.rectangle + _rectangleFreeSelection = data.selectMode == SelectMode.rectangle ? Rect.fromLTRB(start.dx, start.dy, globalPos.dx, globalPos.dy) : null; - if (data.mode == SelectMode.lasso) { + if (data.selectMode == SelectMode.lasso) { _lassoFreeSelection ??= []; _lassoFreeSelection!.add(globalPos); } else { diff --git a/app/lib/models/defaults.dart b/app/lib/models/defaults.dart index 4c58215983d4..44be70ad6444 100644 --- a/app/lib/models/defaults.dart +++ b/app/lib/models/defaults.dart @@ -38,7 +38,7 @@ class DocumentDefaults { static List createTools([SRGBColor? background]) => [ - SelectTool(mode: SelectMode.lasso, id: createUniqueId()), + SelectTool(selectMode: SelectMode.lasso, id: createUniqueId()), PenTool(id: createUniqueId()), PathEraserTool(id: createUniqueId()), UndoTool(id: createUniqueId()), diff --git a/app/lib/selections/selection.dart b/app/lib/selections/selection.dart index bd897a23d464..8fc12cc153db 100644 --- a/app/lib/selections/selection.dart +++ b/app/lib/selections/selection.dart @@ -41,6 +41,7 @@ part 'tools/eraser.dart'; part 'tools/grid.dart'; part 'tools/label.dart'; part 'tools/laser.dart'; +part 'tools/selection.dart'; part 'tools/path_eraser.dart'; part 'tools/pen.dart'; part 'tools/polygon.dart'; @@ -48,6 +49,7 @@ part 'tools/ruler.dart'; part 'tools/shape.dart'; part 'tools/stamp.dart'; part 'tools/texture.dart'; +part 'tools/spacer.dart'; part 'properties/property.dart'; part 'properties/pen.dart'; diff --git a/app/lib/selections/tools/selection.dart b/app/lib/selections/tools/selection.dart new file mode 100644 index 000000000000..4d76bc8de4a3 --- /dev/null +++ b/app/lib/selections/tools/selection.dart @@ -0,0 +1,36 @@ +part of '../selection.dart'; + +class SelectToolSelection extends ToolSelection { + SelectToolSelection(super.selected); + + @override + List buildProperties(BuildContext context) { + final loc = AppLocalizations.of(context); + return [ + ...super.buildProperties(context), + ListTile( + title: Text(loc.select), + trailing: DropdownMenu( + initialSelection: selected.first.selectMode, + dropdownMenuEntries: SelectMode.values + .map( + (e) => DropdownMenuEntry( + label: e.getLocalizedName(context), + leadingIcon: Icon(e.icon(PhosphorIconsStyle.light)), + value: e, + ), + ) + .toList(), + onSelected: (value) { + if (value != null) { + update( + context, + selected.map((e) => e.copyWith(selectMode: value)).toList(), + ); + } + }, + ), + ), + ]; + } +} diff --git a/app/lib/selections/tools/spacer.dart b/app/lib/selections/tools/spacer.dart new file mode 100644 index 000000000000..2c2bd2b25e24 --- /dev/null +++ b/app/lib/selections/tools/spacer.dart @@ -0,0 +1,36 @@ +part of '../selection.dart'; + +class SpacerToolSelection extends ToolSelection { + SpacerToolSelection(super.selected); + + @override + List buildProperties(BuildContext context) { + final loc = AppLocalizations.of(context); + return [ + ...super.buildProperties(context), + ListTile( + title: Text(loc.spacer), + trailing: DropdownMenu( + initialSelection: selected.first.axis, + dropdownMenuEntries: Axis2D.values + .map( + (e) => DropdownMenuEntry( + label: e.getLocalizedName(context), + leadingIcon: Icon(e.icon(PhosphorIconsStyle.light)), + value: e, + ), + ) + .toList(), + onSelected: (value) { + if (value != null) { + update( + context, + selected.map((e) => e.copyWith(axis: value)).toList(), + ); + } + }, + ), + ), + ]; + } +} diff --git a/app/lib/selections/tools/tool.dart b/app/lib/selections/tools/tool.dart index e901a91ff0d2..f9fba3d81bfb 100644 --- a/app/lib/selections/tools/tool.dart +++ b/app/lib/selections/tools/tool.dart @@ -19,6 +19,8 @@ class ToolSelection extends Selection { TextureTool e => TextureToolSelection([e]), BarcodeTool e => BarcodeToolSelection([e]), PolygonTool e => PolygonToolSelection([e]), + SelectTool e => SelectToolSelection([e]), + SpacerTool e => SpacerToolSelection([e]), _ => ToolSelection([selected]), } as ToolSelection; diff --git a/app/lib/visualizer/tool.dart b/app/lib/visualizer/tool.dart index 953be4ecb1d2..5e0df49b0e0f 100644 --- a/app/lib/visualizer/tool.dart +++ b/app/lib/visualizer/tool.dart @@ -21,6 +21,7 @@ extension ToolCategoryVisualizer on ToolCategory { ToolCategory.action => PhosphorIcons.play, ToolCategory.view => PhosphorIcons.eye, }; + String getLocalizedName(BuildContext context) => switch (this) { ToolCategory.normal => AppLocalizations.of(context).normal, ToolCategory.import => AppLocalizations.of(context).import, @@ -36,6 +37,7 @@ extension BarcodeTypeVisualizer on BarcodeType { BarcodeType.dataMatrix => AppLocalizations.of(context).dataMatrix, BarcodeType.code128 => AppLocalizations.of(context).code128, }; + IconGetter get icon => switch (this) { BarcodeType.qrCode => PhosphorIcons.qrCode, BarcodeType.dataMatrix => PhosphorIcons.scan, @@ -43,6 +45,30 @@ extension BarcodeTypeVisualizer on BarcodeType { }; } +extension SelectModeVisualizer on SelectMode { + String getLocalizedName(BuildContext context) => switch (this) { + SelectMode.rectangle => AppLocalizations.of(context).rectangle, + SelectMode.lasso => AppLocalizations.of(context).lasso, + }; + + IconGetter get icon => switch (this) { + SelectMode.rectangle => PhosphorIcons.selection, + SelectMode.lasso => PhosphorIcons.lasso, + }; +} + +extension Axis2DVisualizer on Axis2D { + String getLocalizedName(BuildContext context) => switch (this) { + Axis2D.horizontal => AppLocalizations.of(context).horizontal, + Axis2D.vertical => AppLocalizations.of(context).vertical, + }; + + IconGetter get icon => switch (this) { + Axis2D.horizontal => PhosphorIcons.splitHorizontal, + Axis2D.vertical => PhosphorIcons.splitVertical, + }; +} + extension ToolVisualizer on Tool { String getDisplay(BuildContext context) { if (name.trim().isEmpty) return getLocalizedName(context); @@ -85,7 +111,8 @@ extension ToolVisualizer on Tool { return switch (this) { SpacerTool e => e.axis == Axis2D.horizontal ? loc.horizontal : loc.vertical, - SelectTool e => e.mode == SelectMode.lasso ? loc.lasso : loc.rectangle, + SelectTool e => + e.selectMode == SelectMode.lasso ? loc.lasso : loc.rectangle, ExportTool e => switch (e.options) { ImageExportOptions() => loc.image, SvgExportOptions() => loc.svg, @@ -99,7 +126,7 @@ extension ToolVisualizer on Tool { IconGetter get icon => switch (this) { HandTool() => PhosphorIcons.hand, SelectTool tool => - tool.mode == SelectMode.lasso + tool.selectMode == SelectMode.lasso ? PhosphorIcons.lasso : PhosphorIcons.selection, ImportTool() => PhosphorIcons.arrowSquareIn, From 4c9793b87f3e29c6e1efcf8c65e8250a0194a5df Mon Sep 17 00:00:00 2001 From: nezznee Date: Sat, 6 Jun 2026 17:11:06 +0200 Subject: [PATCH 2/3] added insert methods to selections, renamed selectMode to mode, improved getLocalizedCaption --- api/lib/src/models/tool.dart | 2 +- api/lib/src/models/tool.freezed.dart | 12 ++++++------ api/lib/src/models/tool.g.dart | 6 +++--- app/lib/dialogs/import/add.dart | 4 ++-- app/lib/handlers/select.dart | 6 +++--- app/lib/models/defaults.dart | 2 +- app/lib/selections/tools/selection.dart | 12 ++++++++++-- app/lib/selections/tools/spacer.dart | 8 ++++++++ app/lib/visualizer/tool.dart | 8 +++----- 9 files changed, 37 insertions(+), 23 deletions(-) diff --git a/api/lib/src/models/tool.dart b/api/lib/src/models/tool.dart index 26899531663d..3e99119029d1 100644 --- a/api/lib/src/models/tool.dart +++ b/api/lib/src/models/tool.dart @@ -48,7 +48,7 @@ sealed class Tool with _$Tool { @Default('') String name, @Default('') String displayIcon, @IdJsonConverter() String? id, - @Default(SelectMode.rectangle) SelectMode selectMode, + @Default(SelectMode.rectangle) SelectMode mode, }) = SelectTool; factory Tool.hand({ diff --git a/api/lib/src/models/tool.freezed.dart b/api/lib/src/models/tool.freezed.dart index ee286eaa2bde..a4bcf4d86a98 100644 --- a/api/lib/src/models/tool.freezed.dart +++ b/api/lib/src/models/tool.freezed.dart @@ -190,13 +190,13 @@ as String?, @JsonSerializable() class SelectTool extends Tool { - SelectTool({this.name = '', this.displayIcon = '', @IdJsonConverter() this.id, this.selectMode = SelectMode.rectangle, final String? $type}): $type = $type ?? 'select',super._(); + SelectTool({this.name = '', this.displayIcon = '', @IdJsonConverter() this.id, this.mode = SelectMode.rectangle, final String? $type}): $type = $type ?? 'select',super._(); factory SelectTool.fromJson(Map json) => _$SelectToolFromJson(json); @override@JsonKey() final String name; @override@JsonKey() final String displayIcon; @override@IdJsonConverter() final String? id; -@JsonKey() final SelectMode selectMode; +@JsonKey() final SelectMode mode; @JsonKey(name: 'type') final String $type; @@ -217,7 +217,7 @@ Map toJson() { @override String toString() { - return 'Tool.select(name: $name, displayIcon: $displayIcon, id: $id, selectMode: $selectMode)'; + return 'Tool.select(name: $name, displayIcon: $displayIcon, id: $id, mode: $mode)'; } @@ -228,7 +228,7 @@ abstract mixin class $SelectToolCopyWith<$Res> implements $ToolCopyWith<$Res> { factory $SelectToolCopyWith(SelectTool value, $Res Function(SelectTool) _then) = _$SelectToolCopyWithImpl; @override @useResult $Res call({ - String name, String displayIcon,@IdJsonConverter() String? id, SelectMode selectMode + String name, String displayIcon,@IdJsonConverter() String? id, SelectMode mode }); @@ -245,12 +245,12 @@ class _$SelectToolCopyWithImpl<$Res> /// Create a copy of Tool /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? displayIcon = null,Object? id = freezed,Object? selectMode = null,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? name = null,Object? displayIcon = null,Object? id = freezed,Object? mode = null,}) { return _then(SelectTool( name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,displayIcon: null == displayIcon ? _self.displayIcon : displayIcon // ignore: cast_nullable_to_non_nullable as String,id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String?,selectMode: null == selectMode ? _self.selectMode : selectMode // ignore: cast_nullable_to_non_nullable +as String?,mode: null == mode ? _self.mode : mode // ignore: cast_nullable_to_non_nullable as SelectMode, )); } diff --git a/api/lib/src/models/tool.g.dart b/api/lib/src/models/tool.g.dart index 82afb2909f93..1d2bbb16c19c 100644 --- a/api/lib/src/models/tool.g.dart +++ b/api/lib/src/models/tool.g.dart @@ -10,8 +10,8 @@ SelectTool _$SelectToolFromJson(Map json) => SelectTool( name: json['name'] as String? ?? '', displayIcon: json['displayIcon'] as String? ?? '', id: const IdJsonConverter().fromJson(json['id'] as String?), - selectMode: - $enumDecodeNullable(_$SelectModeEnumMap, json['selectMode']) ?? + mode: + $enumDecodeNullable(_$SelectModeEnumMap, json['mode']) ?? SelectMode.rectangle, $type: json['type'] as String?, ); @@ -21,7 +21,7 @@ Map _$SelectToolToJson(SelectTool instance) => 'name': instance.name, 'displayIcon': instance.displayIcon, 'id': const IdJsonConverter().toJson(instance.id), - 'selectMode': _$SelectModeEnumMap[instance.selectMode]!, + 'mode': _$SelectModeEnumMap[instance.mode]!, 'type': instance.$type, }; diff --git a/app/lib/dialogs/import/add.dart b/app/lib/dialogs/import/add.dart index 2d2b06c5ba26..7924b83b7f79 100644 --- a/app/lib/dialogs/import/add.dart +++ b/app/lib/dialogs/import/add.dart @@ -249,8 +249,8 @@ class _AddDialogState extends State { final tools = [ Tool.hand, - () => Tool.select(selectMode: SelectMode.lasso), - () => Tool.select(selectMode: SelectMode.rectangle), + () => Tool.select(mode: SelectMode.lasso), + () => Tool.select(mode: SelectMode.rectangle), Tool.pen, Tool.laser, Tool.pathEraser, diff --git a/app/lib/handlers/select.dart b/app/lib/handlers/select.dart index d3d55f805d29..1be231b4ac4c 100644 --- a/app/lib/handlers/select.dart +++ b/app/lib/handlers/select.dart @@ -403,7 +403,7 @@ class SelectHandler extends Handler { ); return true; } - _rectangleFreeSelectionStart = data.selectMode == SelectMode.rectangle + _rectangleFreeSelectionStart = data.mode == SelectMode.rectangle ? globalPos : null; context.refresh(); @@ -477,10 +477,10 @@ class SelectHandler extends Handler { return; } final start = _rectangleFreeSelectionStart ?? globalPos; - _rectangleFreeSelection = data.selectMode == SelectMode.rectangle + _rectangleFreeSelection = data.mode == SelectMode.rectangle ? Rect.fromLTRB(start.dx, start.dy, globalPos.dx, globalPos.dy) : null; - if (data.selectMode == SelectMode.lasso) { + if (data.mode == SelectMode.lasso) { _lassoFreeSelection ??= []; _lassoFreeSelection!.add(globalPos); } else { diff --git a/app/lib/models/defaults.dart b/app/lib/models/defaults.dart index 44be70ad6444..4c58215983d4 100644 --- a/app/lib/models/defaults.dart +++ b/app/lib/models/defaults.dart @@ -38,7 +38,7 @@ class DocumentDefaults { static List createTools([SRGBColor? background]) => [ - SelectTool(selectMode: SelectMode.lasso, id: createUniqueId()), + SelectTool(mode: SelectMode.lasso, id: createUniqueId()), PenTool(id: createUniqueId()), PathEraserTool(id: createUniqueId()), UndoTool(id: createUniqueId()), diff --git a/app/lib/selections/tools/selection.dart b/app/lib/selections/tools/selection.dart index 4d76bc8de4a3..beb2f9e758c0 100644 --- a/app/lib/selections/tools/selection.dart +++ b/app/lib/selections/tools/selection.dart @@ -11,7 +11,7 @@ class SelectToolSelection extends ToolSelection { ListTile( title: Text(loc.select), trailing: DropdownMenu( - initialSelection: selected.first.selectMode, + initialSelection: selected.first.mode, dropdownMenuEntries: SelectMode.values .map( (e) => DropdownMenuEntry( @@ -25,7 +25,7 @@ class SelectToolSelection extends ToolSelection { if (value != null) { update( context, - selected.map((e) => e.copyWith(selectMode: value)).toList(), + selected.map((e) => e.copyWith(mode: value)).toList(), ); } }, @@ -33,4 +33,12 @@ class SelectToolSelection extends ToolSelection { ), ]; } + + @override + Selection insert(dynamic element) { + if (element is SelectTool) { + return SelectToolSelection([...selected, element]); + } + return super.insert(element); + } } diff --git a/app/lib/selections/tools/spacer.dart b/app/lib/selections/tools/spacer.dart index 2c2bd2b25e24..fd8d037d3637 100644 --- a/app/lib/selections/tools/spacer.dart +++ b/app/lib/selections/tools/spacer.dart @@ -33,4 +33,12 @@ class SpacerToolSelection extends ToolSelection { ), ]; } + + @override + Selection insert(dynamic element) { + if (element is SpacerTool) { + return SpacerToolSelection([...selected, element]); + } + return super.insert(element); + } } diff --git a/app/lib/visualizer/tool.dart b/app/lib/visualizer/tool.dart index 5e0df49b0e0f..77d8276c1aac 100644 --- a/app/lib/visualizer/tool.dart +++ b/app/lib/visualizer/tool.dart @@ -109,10 +109,8 @@ extension ToolVisualizer on Tool { String getLocalizedCaption(BuildContext context) { final loc = AppLocalizations.of(context); return switch (this) { - SpacerTool e => - e.axis == Axis2D.horizontal ? loc.horizontal : loc.vertical, - SelectTool e => - e.selectMode == SelectMode.lasso ? loc.lasso : loc.rectangle, + SpacerTool e => e.axis.getLocalizedName(context), + SelectTool e => e.mode.getLocalizedName(context), ExportTool e => switch (e.options) { ImageExportOptions() => loc.image, SvgExportOptions() => loc.svg, @@ -126,7 +124,7 @@ extension ToolVisualizer on Tool { IconGetter get icon => switch (this) { HandTool() => PhosphorIcons.hand, SelectTool tool => - tool.selectMode == SelectMode.lasso + tool.mode == SelectMode.lasso ? PhosphorIcons.lasso : PhosphorIcons.selection, ImportTool() => PhosphorIcons.arrowSquareIn, From 58d8313dcb08e5f314026d835fe0da6301f2f466 Mon Sep 17 00:00:00 2001 From: nezznee Date: Mon, 8 Jun 2026 16:19:17 +0200 Subject: [PATCH 3/3] Changed Label --- app/lib/l10n/app_en.arb | 2 ++ app/lib/selections/tools/selection.dart | 2 +- app/lib/selections/tools/spacer.dart | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/lib/l10n/app_en.arb b/app/lib/l10n/app_en.arb index b2c6b3b078cc..d4e6601d992a 100644 --- a/app/lib/l10n/app_en.arb +++ b/app/lib/l10n/app_en.arb @@ -618,6 +618,7 @@ }, "inputGestures": "Input gestures", "nativeTitleBar": "Native title bar", + "mode": "Mode", "syncMode": "Sync mode", "connection": "Connection", "always": "Always", @@ -919,6 +920,7 @@ "bringForward": "Bring forward", "sendBackward": "Send backward", "rotation": "Rotation", + "direction": "Direction", "onlyAvailableLargerScreen": "Only available on larger screens", "toolbarPosition": "Toolbar position", "rotate": "Rotate", diff --git a/app/lib/selections/tools/selection.dart b/app/lib/selections/tools/selection.dart index beb2f9e758c0..a8962ad9abcd 100644 --- a/app/lib/selections/tools/selection.dart +++ b/app/lib/selections/tools/selection.dart @@ -9,7 +9,7 @@ class SelectToolSelection extends ToolSelection { return [ ...super.buildProperties(context), ListTile( - title: Text(loc.select), + title: Text(loc.mode), trailing: DropdownMenu( initialSelection: selected.first.mode, dropdownMenuEntries: SelectMode.values diff --git a/app/lib/selections/tools/spacer.dart b/app/lib/selections/tools/spacer.dart index fd8d037d3637..b83f463eebc5 100644 --- a/app/lib/selections/tools/spacer.dart +++ b/app/lib/selections/tools/spacer.dart @@ -9,7 +9,7 @@ class SpacerToolSelection extends ToolSelection { return [ ...super.buildProperties(context), ListTile( - title: Text(loc.spacer), + title: Text(loc.direction), trailing: DropdownMenu( initialSelection: selected.first.axis, dropdownMenuEntries: Axis2D.values