mirror of
https://github.com/penpot/penpot.git
synced 2025-04-05 03:21:26 -05:00
🐛 Fix toolbar not centered in workspace
This commit is contained in:
parent
e6fcb418b1
commit
1991b44c00
3 changed files with 17 additions and 14 deletions
|
@ -29,7 +29,6 @@
|
|||
[app.main.ui.workspace.sidebar :refer [left-sidebar right-sidebar]]
|
||||
[app.main.ui.workspace.sidebar.collapsable-button :refer [collapsed-button]]
|
||||
[app.main.ui.workspace.sidebar.history :refer [history-toolbox]]
|
||||
[app.main.ui.workspace.top-toolbar :refer [top-toolbar]]
|
||||
[app.main.ui.workspace.viewport :refer [viewport]]
|
||||
[app.util.debug :as dbg]
|
||||
[app.util.dom :as dom]
|
||||
|
@ -110,7 +109,6 @@
|
|||
|
||||
(when-not hide-ui?
|
||||
[:*
|
||||
[:& top-toolbar {:layout layout}]
|
||||
(if (:collapse-left-sidebar layout)
|
||||
[:& collapsed-button]
|
||||
[:& left-sidebar {:layout layout
|
||||
|
|
|
@ -274,6 +274,7 @@
|
|||
(hooks/setup-active-frames base-objects hover-ids selected active-frames zoom transform vbox)
|
||||
|
||||
[:div.viewport {:style #js {"--zoom" zoom}}
|
||||
[:& top-bar/top-bar {:layout layout}]
|
||||
[:div.viewport-overlays
|
||||
;; The behaviour inside a foreign object is a bit different that in plain HTML so we wrap
|
||||
;; inside a foreign object "dummy" so this awkward behaviour is take into account
|
||||
|
@ -302,9 +303,7 @@
|
|||
:vbox vbox
|
||||
:options options
|
||||
:layout layout
|
||||
:viewport-ref viewport-ref}])
|
||||
|
||||
[:& top-bar/top-bar]]
|
||||
:viewport-ref viewport-ref}])]
|
||||
|
||||
[:svg.render-shapes
|
||||
{:id "render"
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
[app.main.refs :as refs]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.context :as ctx]
|
||||
[app.main.ui.workspace.top-toolbar :refer [top-toolbar]]
|
||||
[app.main.ui.workspace.viewport.grid-layout-editor :refer [grid-edition-actions]]
|
||||
[app.main.ui.workspace.viewport.path-actions :refer [path-actions]]
|
||||
[app.util.i18n :as i18n :refer [tr]]
|
||||
|
@ -36,7 +37,7 @@
|
|||
|
||||
(mf/defc top-bar
|
||||
{::mf/wrap [mf/memo]}
|
||||
[]
|
||||
[{:keys [layout]}]
|
||||
(let [edition (mf/deref refs/selected-edition)
|
||||
selected (mf/deref refs/selected-objects)
|
||||
drawing (mf/deref refs/workspace-drawing)
|
||||
|
@ -50,6 +51,7 @@
|
|||
(not= :curve (:tool drawing)))
|
||||
|
||||
workspace-read-only? (mf/use-ctx ctx/workspace-read-only?)
|
||||
hide-ui? (:hide-ui layout)
|
||||
|
||||
path-edition? (or (and single? editing?
|
||||
(and (not (cfh/text-shape? shape))
|
||||
|
@ -58,13 +60,17 @@
|
|||
|
||||
grid-edition? (and single? editing? (ctl/grid-layout? shape))]
|
||||
|
||||
(cond
|
||||
workspace-read-only?
|
||||
[:& view-only-actions]
|
||||
[:*
|
||||
(when-not hide-ui?
|
||||
[:& top-toolbar {:layout layout}])
|
||||
|
||||
path-edition?
|
||||
[:div.viewport-actions
|
||||
[:& path-actions {:shape shape}]]
|
||||
(cond
|
||||
workspace-read-only?
|
||||
[:& view-only-actions]
|
||||
|
||||
grid-edition?
|
||||
[:& grid-edition-actions {:shape shape}])))
|
||||
path-edition?
|
||||
[:div.viewport-actions
|
||||
[:& path-actions {:shape shape}]]
|
||||
|
||||
grid-edition?
|
||||
[:& grid-edition-actions {:shape shape}])]))
|
||||
|
|
Loading…
Add table
Reference in a new issue