Skip to content

Commit

Permalink
Add area options to context menu in area navigator page
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Dec 18, 2024
1 parent 6ce4742 commit da0fcc2
Show file tree
Hide file tree
Showing 12 changed files with 188 additions and 156 deletions.
62 changes: 31 additions & 31 deletions api/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -66,50 +66,50 @@ packages:
dependency: transitive
description:
name: build
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0"
sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0
url: "https://pub.dev"
source: hosted
version: "2.4.1"
version: "2.4.2"
build_config:
dependency: transitive
description:
name: build_config
sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1
sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
version: "1.1.2"
build_daemon:
dependency: transitive
description:
name: build_daemon
sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9"
sha256: "294a2edaf4814a378725bfe6358210196f5ea37af89ecd81bfa32960113d4948"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a"
sha256: "99d3980049739a985cf9b21f30881f46db3ebc62c5b8d5e60e27440876b1ba1e"
url: "https://pub.dev"
source: hosted
version: "2.4.2"
version: "2.4.3"
build_runner:
dependency: "direct dev"
description:
name: build_runner
sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d"
sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573"
url: "https://pub.dev"
source: hosted
version: "2.4.13"
version: "2.4.14"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0
sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021"
url: "https://pub.dev"
source: hosted
version: "7.3.2"
version: "8.0.0"
built_collection:
dependency: transitive
description:
Expand All @@ -122,10 +122,10 @@ packages:
dependency: transitive
description:
name: built_value
sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb
sha256: "28a712df2576b63c6c005c465989a348604960c0958d28be5303ba9baa841ac2"
url: "https://pub.dev"
source: hosted
version: "8.9.2"
version: "8.9.3"
checked_yaml:
dependency: transitive
description:
Expand Down Expand Up @@ -258,10 +258,10 @@ packages:
dependency: transitive
description:
name: http_multi_server
sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b"
sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8
url: "https://pub.dev"
source: hosted
version: "3.2.1"
version: "3.2.2"
http_parser:
dependency: transitive
description:
Expand Down Expand Up @@ -339,10 +339,10 @@ packages:
dependency: transitive
description:
name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
url: "https://pub.dev"
source: hosted
version: "0.12.16+1"
version: "0.12.17"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -483,10 +483,10 @@ packages:
dependency: transitive
description:
name: source_helper
sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd"
sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c"
url: "https://pub.dev"
source: hosted
version: "1.3.4"
version: "1.3.5"
source_map_stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -539,34 +539,34 @@ packages:
dependency: transitive
description:
name: stream_transform
sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f"
sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6"
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "1.2.2"
test:
dependency: "direct dev"
description:
name: test
sha256: "22eb7769bee38c7e032d532e8daa2e1cc901b799f603550a4db8f3a5f5173ea2"
sha256: "43490fe4c0f5ecb898f3fa1cdcdad8d521d7f6ff17ebdc4e8cd32b2e99524a20"
url: "https://pub.dev"
source: hosted
version: "1.25.12"
version: "1.25.13"
test_api:
dependency: transitive
description:
Expand Down Expand Up @@ -627,10 +627,10 @@ packages:
dependency: transitive
description:
name: watcher
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.1.1"
web:
dependency: transitive
description:
Expand Down Expand Up @@ -680,4 +680,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.6.0-0 <4.0.0"
dart: ">=3.6.0 <4.0.0"
12 changes: 6 additions & 6 deletions app/android/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.1023.0)
aws-partitions (1.1024.0)
aws-sdk-core (3.214.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
Expand Down Expand Up @@ -58,8 +58,8 @@ GEM
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-multipart (1.1.0)
multipart-post (~> 2.0)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
Expand Down Expand Up @@ -123,7 +123,7 @@ GEM
google-apis-core (>= 0.15.0, < 2.a)
google-apis-playcustomapp_v1 (0.16.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-storage_v1 (0.48.0)
google-apis-storage_v1 (0.49.0)
google-apis-core (>= 0.15.0, < 2.a)
google-cloud-core (1.7.1)
google-cloud-env (>= 1.0, < 3.a)
Expand Down Expand Up @@ -175,7 +175,7 @@ GEM
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.3.9)
rexml (3.4.0)
rouge (2.0.7)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
Expand Down Expand Up @@ -224,4 +224,4 @@ DEPENDENCIES
screengrab

BUNDLED WITH
2.5.23
2.6.1
23 changes: 14 additions & 9 deletions app/lib/dialogs/area/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,17 @@ ContextMenuBuilder buildAreaContextMenu(DocumentBloc bloc,
)(context)
];

ContextMenuBuilder buildGeneralAreaContextMenu(DocumentBloc bloc, Area area,
SettingsCubit settingsCubit, List<PadElement> elements) =>
ContextMenuBuilder buildGeneralAreaContextMenu(
DocumentBloc bloc,
Area area,
SettingsCubit settingsCubit,
List<PadElement> elements, {
bool pop = true,
}) =>
(context) => [
ContextMenuItem(
onPressed: () async {
Navigator.of(context).pop(true);
if (pop) Navigator.of(context).pop(true);
final result = await showDialog<String>(
builder: (context) => NameDialog(
button: AppLocalizations.of(context).update,
Expand All @@ -96,7 +101,7 @@ ContextMenuBuilder buildGeneralAreaContextMenu(DocumentBloc bloc, Area area,
),
ContextMenuItem(
onPressed: () async {
Navigator.of(context).pop(true);
if (pop) Navigator.of(context).pop(true);
final result = await showDialog<String>(
builder: (context) => NameDialog(), context: context);
if (result == null) return;
Expand All @@ -113,7 +118,7 @@ ContextMenuBuilder buildGeneralAreaContextMenu(DocumentBloc bloc, Area area,
MenuItemButton(
leadingIcon: const PhosphorIcon(PhosphorIconsLight.fileSvg),
onPressed: () {
Navigator.of(context).pop();
if (pop) Navigator.of(context).pop();
showDialog<void>(
builder: (context) => BlocProvider.value(
value: bloc,
Expand All @@ -132,7 +137,7 @@ ContextMenuBuilder buildGeneralAreaContextMenu(DocumentBloc bloc, Area area,
MenuItemButton(
leadingIcon: const PhosphorIcon(PhosphorIconsLight.fileImage),
onPressed: () {
Navigator.of(context).pop();
if (pop) Navigator.of(context).pop();
showDialog<void>(
builder: (context) => BlocProvider.value(
value: bloc,
Expand All @@ -153,7 +158,7 @@ ContextMenuBuilder buildGeneralAreaContextMenu(DocumentBloc bloc, Area area,
MenuItemButton(
leadingIcon: const PhosphorIcon(PhosphorIconsLight.filePdf),
onPressed: () {
Navigator.of(context).pop();
if (pop) Navigator.of(context).pop();
showDialog<void>(
builder: (context) => BlocProvider.value(
value: bloc,
Expand All @@ -167,7 +172,7 @@ ContextMenuBuilder buildGeneralAreaContextMenu(DocumentBloc bloc, Area area,
MenuItemButton(
leadingIcon: const PhosphorIcon(PhosphorIconsLight.printer),
onPressed: () {
Navigator.of(context).pop();
if (pop) Navigator.of(context).pop();
showDialog<void>(
builder: (context) => BlocProvider.value(
value: bloc,
Expand All @@ -186,7 +191,7 @@ ContextMenuBuilder buildGeneralAreaContextMenu(DocumentBloc bloc, Area area,
icon: const PhosphorIcon(PhosphorIconsLight.plusCircle),
label: AppLocalizations.of(context).addToPack,
onPressed: () async {
Navigator.of(context).pop();
if (pop) Navigator.of(context).pop();
addToPack(context, bloc, settingsCubit, elements, area.rect);
},
),
Expand Down
3 changes: 1 addition & 2 deletions app/lib/dialogs/elements.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:butterfly/cubits/settings.dart';
import 'package:butterfly/dialogs/area/context.dart';
import 'package:butterfly/handlers/handler.dart';
import 'package:butterfly/services/export.dart';
Expand All @@ -18,14 +17,14 @@ import '../services/import.dart';
ContextMenuBuilder buildElementsContextMenu(
DocumentBloc bloc,
DocumentLoadSuccess state,
SettingsCubit settingsCubit,
ImportService importService,
ExportService exportService,
ClipboardManager clipboardManager,
Offset position,
List<Renderer<PadElement>> renderers,
Rect? rect) {
final cubit = state.currentIndexCubit;
final settingsCubit = state.settingsCubit;
final operations = Map<Renderer<PadElement>,
Map<RendererOperation, RendererOperationCallback>>.fromIterable(
renderers,
Expand Down
1 change: 0 additions & 1 deletion app/lib/handlers/select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ class SelectHandler extends Handler<SelectTool> {
builder: buildElementsContextMenu(
bloc,
state,
context.getSettingsCubit(),
context.getImportService(),
context.getExportService(),
context.getClipboardManager(),
Expand Down
Loading

0 comments on commit da0fcc2

Please sign in to comment.