0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 16:21:57 -05:00

Allow ungroup groups in bulk and unmask mask in group

This commit is contained in:
eva 2021-11-23 17:45:59 +01:00 committed by Andrés Moya
parent 591d66564d
commit 723916d930
3 changed files with 73 additions and 62 deletions

View file

@ -33,6 +33,7 @@
### :sparkles: New features
- Allow ungroup groups in bulk [Taiga #2211](https://tree.taiga.io/project/penpot/us/2211).
- Enhance corner radius behavior [Taiga #2190](https://tree.taiga.io/project/penpot/issue/2190).
- Allow preserve scroll position in interactions [Taiga #2250](https://tree.taiga.io/project/penpot/us/2250).
- Add new onboarding modals.
@ -361,7 +362,7 @@
- Transform shapes to path on double click
- Translate automatic names of new files and projects.
- Use shift instead of ctrl/cmd to keep aspect ratio [Taiga 1697](https://tree.taiga.io/project/penpot/issue/1697).
- New translations: Portuguese (Brazil) and Romanias.
- New translations: Portuguese (Brazil) and Romanias.
### :bug: Bugs fixed

File diff suppressed because one or more lines are too long

View file

@ -98,8 +98,13 @@
is-bool? (and (some? shape) (= :bool type))
options (mf/deref refs/workspace-page-options)
selected-objects (mf/deref refs/selected-objects)
flows (:flows options)
has-group? (some #(= :group (:type %)) selected-objects)
has-bool? (some #(= :bool (:type %)) selected-objects)
has-mask-group? (some #(:masked-group? %) selected-objects)
options-mode (mf/deref refs/options-mode)
set-bool
@ -196,6 +201,13 @@
:shortcut (sc/get-tooltip :bring-back)
:on-click do-send-to-back}]
[:& menu-separator]
[:& menu-entry {:title (tr "workspace.shape.menu.flip-vertical")
:shortcut (sc/get-tooltip :flip-vertical)
:on-click do-flip-vertical}]
[:& menu-entry {:title (tr "workspace.shape.menu.flip-horizontal")
:shortcut (sc/get-tooltip :flip-horizontal)
:on-click do-flip-horizontal}]
[:& menu-separator]
(when multiple?
[:*
@ -204,31 +216,26 @@
:on-click do-create-group}]
[:& menu-entry {:title (tr "workspace.shape.menu.mask")
:shortcut (sc/get-tooltip :mask)
:on-click do-mask-group}]
[:& menu-separator]])
:on-click do-mask-group}]])
(when (or single? multiple?)
[:*
[:& menu-entry {:title (tr "workspace.shape.menu.flip-vertical")
:shortcut (sc/get-tooltip :flip-vertical)
:on-click do-flip-vertical}]
[:& menu-entry {:title (tr "workspace.shape.menu.flip-horizontal")
:shortcut (sc/get-tooltip :flip-horizontal)
:on-click do-flip-horizontal}]
[:& menu-separator]])
(when (and single? (and (not has-mask-group?) (or has-bool? has-group?)))
[:& menu-entry {:title (tr "workspace.shape.menu.mask")
:shortcut (sc/get-tooltip :mask)
:on-click do-mask-group}])
(when (and single? (or is-bool? is-group?))
[:*
[:& menu-entry {:title (tr "workspace.shape.menu.ungroup")
:shortcut (sc/get-tooltip :ungroup)
:on-click do-remove-group}]
(if (:masked-group? shape)
[:& menu-entry {:title (tr "workspace.shape.menu.unmask")
:shortcut (sc/get-tooltip :unmask)
:on-click do-unmask-group}]
[:& menu-entry {:title (tr "workspace.shape.menu.mask")
:shortcut (sc/get-tooltip :group)
:on-click do-mask-group}])])
(when (or has-bool? has-group?)
[:& menu-entry {:title (tr "workspace.shape.menu.ungroup")
:shortcut (sc/get-tooltip :ungroup)
:on-click do-remove-group}])
(when has-mask-group?
[:& menu-entry {:title (tr "workspace.shape.menu.unmask")
:shortcut (sc/get-tooltip :unmask)
:on-click do-unmask-group}]
)
(when (or multiple? has-mask-group? (or is-bool? has-group?) (and single? (or has-bool? has-group?)) )
[:& menu-separator])
(when (and single? editable-shape?)
[:& menu-entry {:title (tr "workspace.shape.menu.edit")