Skip to content

Commit

Permalink
Use long press to move tools on all platforms to improve desktop touc…
Browse files Browse the repository at this point in the history
…h behavior
  • Loading branch information
CodeDoctorDE committed Nov 29, 2024
1 parent 2335bdb commit b3ac22a
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 77 deletions.
49 changes: 20 additions & 29 deletions app/lib/views/edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ class _EditToolbarState extends State<EditToolbar> {
physics: const NeverScrollableScrollPhysics(),
crossAxisCount: settings.toolbarRows,
childAspectRatio: 1,
itemDragEnable: (index) => index != tools.length,
buildDefaultDragHandles: false,
children: List.generate(
tools.length + 1,
(i) {
Expand Down Expand Up @@ -247,34 +249,23 @@ class _EditToolbarState extends State<EditToolbar> {
),
),
);
return GestureDetector(
onLongPress: () {},
onLongPressStart: (_) {},
onLongPressMoveUpdate: (_) {},
onLongPressEnd: (_) {},
onLongPressUp: () {},
onLongPressDown: (_) {},
onLongPressCancel: () {},
onScaleStart: (_) {},
onScaleUpdate: (_) {},
onScaleEnd: (_) {},
key: const Key('add'),
child: direction == Axis.horizontal
? Row(
mainAxisSize: MainAxisSize.min,
children: [
const VerticalDivider(),
Expanded(child: add),
],
)
: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Divider(),
Expanded(child: add),
],
),
);
return direction == Axis.horizontal
? Row(
mainAxisSize: MainAxisSize.min,
key: const Key('add-row'),
children: [
const VerticalDivider(),
Expanded(child: add),
],
)
: Column(
mainAxisSize: MainAxisSize.min,
key: const Key('add-column'),
children: [
const Divider(),
Expanded(child: add),
],
);
}
var e = tools[i];
final selected = i == currentIndex.index;
Expand Down Expand Up @@ -353,7 +344,7 @@ class _EditToolbarState extends State<EditToolbar> {
.changeSelection(e, true);
}
}));
return ReorderableDelayedDragStartListener(
return ReorderableGridDelayedDragStartListener(
index: i,
key: ObjectKey(i),
enabled: selected || highlighted,
Expand Down
15 changes: 8 additions & 7 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,10 @@ packages:
dependency: transitive
description:
name: file_selector_android
sha256: "934850f9702b0f9031bc331a306e7bebc62f894a6e5ca6c0681c7af17e7afb50"
sha256: "98ac58e878b05ea2fdb204e7f4fc4978d90406c9881874f901428e01d3b18fbc"
url: "https://pub.dev"
source: hosted
version: "0.5.1+11"
version: "0.5.1+12"
file_selector_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -1164,11 +1164,12 @@ packages:
reorderable_grid:
dependency: "direct main"
description:
name: reorderable_grid
sha256: "0b9cd95ef0f070ef99f92affe9cf85a4aa127099cd1334e5940950ce58cd981d"
url: "https://pub.dev"
source: hosted
version: "1.0.10"
path: "."
ref: d6f6a4fcf23129400529a055292133f1030b7eee
resolved-ref: d6f6a4fcf23129400529a055292133f1030b7eee
url: "https://github.com/CodeDoctorDE/reorderable_grid.git"
source: git
version: "1.0.9"
replay_bloc:
dependency: "direct main"
description:
Expand Down
5 changes: 4 additions & 1 deletion app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ dependencies:
connectivity_plus: ^6.0.3
cross_file: ^0.3.4+1
args: ^2.5.0
reorderable_grid: ^1.0.10
reorderable_grid:
git:
url: https://github.com/CodeDoctorDE/reorderable_grid.git
ref: d6f6a4fcf23129400529a055292133f1030b7eee
perfect_freehand:
git:
url: https://github.com/CodeDoctorDE/perfect-freehand-dart.git
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"sharp": "^0.33.5",
"typescript": "^5.7.2"
},
"packageManager": "[email protected].2",
"packageManager": "[email protected].4",
"devDependencies": {
"sass": "^1.81.0"
}
Expand Down
70 changes: 35 additions & 35 deletions docs/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions metadata/en-US/changelogs/123.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Add save button indicator for autosave ([#757](https://github.com/LinwoodDev/Butterfly/issues/757))
* Add duplicate layer button
* Add tool options panel position
* Use long press to move tools on all platforms to improve desktop touch behavior
* Use sha checksum for assets
* Separate personalization settings in new view settings
* Fix webdav on windows
Expand Down
8 changes: 4 additions & 4 deletions tools/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ packages:
dependency: "direct main"
description:
name: intl
sha256: "99f282cb0e02edcbbf8c6b3bbc7c90b65635156c412e58f3975a7e55284ce685"
sha256: "00f33b908655e606b86d2ade4710a231b802eec6f11e87e4ea3783fd72077a50"
url: "https://pub.dev"
source: hosted
version: "0.20.0"
version: "0.20.1"
lints:
dependency: "direct main"
description:
Expand Down Expand Up @@ -117,10 +117,10 @@ packages:
dependency: transitive
description:
name: web
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
url: "https://pub.dev"
source: hosted
version: "0.5.1"
version: "1.1.0"
yaml:
dependency: "direct main"
description:
Expand Down

0 comments on commit b3ac22a

Please sign in to comment.