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 ### :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). - 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). - Allow preserve scroll position in interactions [Taiga #2250](https://tree.taiga.io/project/penpot/us/2250).
- Add new onboarding modals. - Add new onboarding modals.
@ -361,7 +362,7 @@
- Transform shapes to path on double click - Transform shapes to path on double click
- Translate automatic names of new files and projects. - 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). - 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 ### :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)) is-bool? (and (some? shape) (= :bool type))
options (mf/deref refs/workspace-page-options) options (mf/deref refs/workspace-page-options)
selected-objects (mf/deref refs/selected-objects)
flows (:flows options) 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) options-mode (mf/deref refs/options-mode)
set-bool set-bool
@ -196,6 +201,13 @@
:shortcut (sc/get-tooltip :bring-back) :shortcut (sc/get-tooltip :bring-back)
:on-click do-send-to-back}] :on-click do-send-to-back}]
[:& menu-separator] [:& 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? (when multiple?
[:* [:*
@ -204,31 +216,26 @@
:on-click do-create-group}] :on-click do-create-group}]
[:& menu-entry {:title (tr "workspace.shape.menu.mask") [:& menu-entry {:title (tr "workspace.shape.menu.mask")
:shortcut (sc/get-tooltip :mask) :shortcut (sc/get-tooltip :mask)
:on-click do-mask-group}] :on-click do-mask-group}]])
[:& menu-separator]])
(when (or single? multiple?) (when (and single? (and (not has-mask-group?) (or has-bool? has-group?)))
[:* [:& menu-entry {:title (tr "workspace.shape.menu.mask")
[:& menu-entry {:title (tr "workspace.shape.menu.flip-vertical") :shortcut (sc/get-tooltip :mask)
:shortcut (sc/get-tooltip :flip-vertical) :on-click do-mask-group}])
: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? (or is-bool? is-group?)) (when (or has-bool? has-group?)
[:* [:& menu-entry {:title (tr "workspace.shape.menu.ungroup")
[:& menu-entry {:title (tr "workspace.shape.menu.ungroup") :shortcut (sc/get-tooltip :ungroup)
:shortcut (sc/get-tooltip :ungroup) :on-click do-remove-group}])
:on-click do-remove-group}]
(if (:masked-group? shape) (when has-mask-group?
[:& menu-entry {:title (tr "workspace.shape.menu.unmask") [:& menu-entry {:title (tr "workspace.shape.menu.unmask")
:shortcut (sc/get-tooltip :unmask) :shortcut (sc/get-tooltip :unmask)
:on-click do-unmask-group}] :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 multiple? has-mask-group? (or is-bool? has-group?) (and single? (or has-bool? has-group?)) )
[:& menu-separator])
(when (and single? editable-shape?) (when (and single? editable-shape?)
[:& menu-entry {:title (tr "workspace.shape.menu.edit") [:& menu-entry {:title (tr "workspace.shape.menu.edit")