diff --git a/app/lib/api/close_io.dart b/app/lib/api/close_io.dart index a5b1becd1bae..bdd65c8b842a 100644 --- a/app/lib/api/close_io.dart +++ b/app/lib/api/close_io.dart @@ -44,7 +44,7 @@ class IOCloseSubscription extends CloseSubscription with WindowListener { onPressed: () => Navigator.of(context).pop(false), child: Text(AppLocalizations.of(context).cancel), ), - TextButton( + ElevatedButton( onPressed: () => Navigator.of(context).pop(true), child: Text(AppLocalizations.of(context).close), ), diff --git a/app/lib/views/edit.dart b/app/lib/views/edit.dart index 90da4508977f..e6e99a8ce0a1 100644 --- a/app/lib/views/edit.dart +++ b/app/lib/views/edit.dart @@ -224,6 +224,7 @@ class _EditToolbarState extends State { if (widget.direction == Axis.horizontal) { return Row( mainAxisSize: MainAxisSize.min, + key: const Key('add-horizontal'), children: [ const VerticalDivider(), add, @@ -232,6 +233,7 @@ class _EditToolbarState extends State { } else { return Column( mainAxisSize: MainAxisSize.min, + key: const Key('add-vertical'), children: [ const Divider(), add, diff --git a/app/lib/views/property.dart b/app/lib/views/property.dart index 1880379199fc..ed85d14daf1a 100644 --- a/app/lib/views/property.dart +++ b/app/lib/views/property.dart @@ -82,133 +82,141 @@ class _PropertyViewState extends State elevation: 6, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(20))), - child: Row(children: [ - if (!isMobile) - MouseRegion( - cursor: SystemMouseCursors.resizeLeftRight, - child: GestureDetector( - child: const PhosphorIcon( - PhosphorIconsLight.dotsSixVertical), - onPanUpdate: (details) { - final delta = details.delta.dx; - setState(() { - _size -= delta; - _size = max(_size, minSize); - }); - }, + child: AnimatedSize( + alignment: Alignment.topCenter, + curve: Curves.easeInOut, + duration: const Duration(milliseconds: 200), + child: Row(children: [ + if (!isMobile) + MouseRegion( + cursor: SystemMouseCursors.resizeLeftRight, + child: GestureDetector( + child: const PhosphorIcon( + PhosphorIconsLight.dotsSixVertical), + onPanUpdate: (details) { + final delta = details.delta.dx; + setState(() { + _size -= delta; + _size = max(_size, minSize); + }); + }, + ), ), - ), - Expanded(child: Builder(builder: (context) { - final help = selection!.help; - final multi = selection.selected.length != 1; - final selected = selection.selected.first; - final controller = MenuController(); - final menuChildren = multi - ? [] - : DisplayIcons.recommended(selected) - .map((e) => IconButton( + Expanded(child: Builder(builder: (context) { + final help = selection!.help; + final multi = selection.selected.length != 1; + final selected = selection.selected.first; + final controller = MenuController(); + final menuChildren = multi + ? [] + : DisplayIcons.recommended(selected) + .map((e) => IconButton( + icon: PhosphorIcon( + e.icon(PhosphorIconsStyle.light)), + onPressed: selected is! Tool + ? null + : () { + final bloc = + context.read(); + final state = bloc.state; + if (state + is! DocumentLoadSuccess) { + return; + } + final painters = state.info.tools; + bloc.add(ToolsChanged({ + painters.indexOf(selected): + selected.copyWith( + displayIcon: e.name), + })); + controller.close(); + })) + .toList(); + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Header( + title: + Text(selection.getLocalizedName(context)), + leading: MenuAnchor( + controller: controller, + builder: (context, controller, child) => + IconButton( icon: PhosphorIcon( - e.icon(PhosphorIconsStyle.light)), - onPressed: selected is! Tool + selection!.icon(multi + ? PhosphorIconsStyle.fill + : PhosphorIconsStyle.light), + color: Theme.of(context).iconTheme.color, + ), + onPressed: menuChildren.isEmpty ? null - : () { - final bloc = - context.read(); - final state = bloc.state; - if (state is! DocumentLoadSuccess) { - return; - } - final painters = state.info.tools; - bloc.add(ToolsChanged({ - painters.indexOf(selected): - selected.copyWith( - displayIcon: e.name), - })); - controller.close(); - })) - .toList(); - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Header( - title: Text(selection.getLocalizedName(context)), - leading: MenuAnchor( - controller: controller, - builder: (context, controller, child) => - IconButton( - icon: PhosphorIcon( - selection!.icon(multi - ? PhosphorIconsStyle.fill - : PhosphorIconsStyle.light), - color: Theme.of(context).iconTheme.color, + : () => controller.isOpen + ? controller.close() + : controller.open(), ), - onPressed: menuChildren.isEmpty - ? null - : () => controller.isOpen - ? controller.close() - : controller.open(), + menuChildren: menuChildren, ), - menuChildren: menuChildren, - ), - actions: [ - if (selection.showDeleteButton) - IconButton( + actions: [ + if (selection.showDeleteButton) + IconButton( + icon: const PhosphorIcon( + PhosphorIconsLight.trash), + onPressed: () { + selection?.onDelete(context); + context + .read() + .resetSelection(); + }), + if (help.isNotEmpty) + IconButton( + tooltip: + AppLocalizations.of(context).help, icon: const PhosphorIcon( - PhosphorIconsLight.trash), - onPressed: () { - selection?.onDelete(context); - context - .read() - .resetSelection(); - }), - if (help.isNotEmpty) - IconButton( - tooltip: AppLocalizations.of(context).help, + PhosphorIconsLight.sealQuestion), + onPressed: () => openHelp(help), + ), + const SizedBox( + height: 16, child: VerticalDivider()), + if (!isMobile) + IconButton( + tooltip: state.pinned + ? AppLocalizations.of(context).unpin + : AppLocalizations.of(context).pin, + icon: state.pinned + ? const PhosphorIcon( + PhosphorIconsFill.mapPin) + : const PhosphorIcon( + PhosphorIconsLight.mapPin), + onPressed: () => context + .read() + .togglePin(), + ), + const SizedBox(width: 8), + IconButton.outlined( + tooltip: AppLocalizations.of(context).close, icon: const PhosphorIcon( - PhosphorIconsLight.sealQuestion), - onPressed: () => openHelp(help), - ), - const SizedBox( - height: 16, child: VerticalDivider()), - if (!isMobile) - IconButton( - tooltip: state.pinned - ? AppLocalizations.of(context).unpin - : AppLocalizations.of(context).pin, - icon: state.pinned - ? const PhosphorIcon( - PhosphorIconsFill.mapPin) - : const PhosphorIcon( - PhosphorIconsLight.mapPin), - onPressed: () => context - .read() - .togglePin(), + PhosphorIconsLight.x), + onPressed: _closeView, ), - const SizedBox(width: 8), - IconButton.outlined( - tooltip: AppLocalizations.of(context).close, - icon: - const PhosphorIcon(PhosphorIconsLight.x), - onPressed: _closeView, + ], + ), + Flexible( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16, vertical: 16), + child: ListView( + shrinkWrap: true, + primary: true, + children: + selection.buildProperties(context)), ), - ], - ), - Flexible( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16, vertical: 16), - child: ListView( - shrinkWrap: true, - primary: true, - children: - selection.buildProperties(context)), ), - ), - ], - ); - })), - ]), + ], + ); + })), + ]), + ), ), ), ); diff --git a/fastlane/metadata/android/en-US/changelogs/72.txt b/fastlane/metadata/android/en-US/changelogs/72.txt index 053ffb479129..0398d1b23f7b 100644 --- a/fastlane/metadata/android/en-US/changelogs/72.txt +++ b/fastlane/metadata/android/en-US/changelogs/72.txt @@ -23,6 +23,7 @@ * Add scale property to label tool * Add alpha slider to shape element * Add delete buttons in pack dialog +* Add size transition to property view * Move export button from selection view to context menu * Improve performance on home page ([#459](https://github.com/LinwoodDev/Butterfly/issues/459)) * Improve clipboard system to include image and svg source as data uri