mirror of
https://github.com/penpot/penpot.git
synced 2025-01-25 07:58:49 -05:00
🎉 Add full screen to view menu
This commit is contained in:
parent
370b6bb2f2
commit
cb5e300534
1 changed files with 21 additions and 9 deletions
|
@ -34,7 +34,8 @@
|
||||||
on-decrease
|
on-decrease
|
||||||
on-zoom-to-50
|
on-zoom-to-50
|
||||||
on-zoom-to-100
|
on-zoom-to-100
|
||||||
on-zoom-to-200]
|
on-zoom-to-200
|
||||||
|
on-fullscreen]
|
||||||
:as props}]
|
:as props}]
|
||||||
(let [show-dropdown? (mf/use-state false)]
|
(let [show-dropdown? (mf/use-state false)]
|
||||||
[:div.zoom-widget {:on-click #(reset! show-dropdown? true)}
|
[:div.zoom-widget {:on-click #(reset! show-dropdown? true)}
|
||||||
|
@ -52,7 +53,10 @@
|
||||||
[:li {:on-click on-zoom-to-100}
|
[:li {:on-click on-zoom-to-100}
|
||||||
"Zoom to 100%" [:span (sc/get-tooltip :reset-zoom)]]
|
"Zoom to 100%" [:span (sc/get-tooltip :reset-zoom)]]
|
||||||
[:li {:on-click on-zoom-to-200}
|
[:li {:on-click on-zoom-to-200}
|
||||||
"Zoom to 200%" [:span (sc/get-tooltip :zoom-200)]]]]]))
|
"Zoom to 200%" [:span (sc/get-tooltip :zoom-200)]]
|
||||||
|
[:li {:on-click on-fullscreen}
|
||||||
|
"Full screen"]]]]))
|
||||||
|
;; "Full screen" [:span (sc/get-tooltip :full-screen)]]]]]))
|
||||||
|
|
||||||
(mf/defc share-link
|
(mf/defc share-link
|
||||||
[{:keys [page token] :as props}]
|
[{:keys [page token] :as props}]
|
||||||
|
@ -234,7 +238,13 @@
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
(mf/deps file-id page-id)
|
(mf/deps file-id page-id)
|
||||||
(fn [section]
|
(fn [section]
|
||||||
(st/emit! (dv/go-to-section section))))]
|
(st/emit! (dv/go-to-section section))))
|
||||||
|
|
||||||
|
toggle-fullscreen
|
||||||
|
(mf/use-callback
|
||||||
|
(mf/deps fullscreen)
|
||||||
|
(fn []
|
||||||
|
(if @fullscreen (fullscreen false) (fullscreen true))))]
|
||||||
|
|
||||||
[:header.viewer-header
|
[:header.viewer-header
|
||||||
[:div.main-icon
|
[:div.main-icon
|
||||||
|
@ -288,17 +298,19 @@
|
||||||
:on-decrease (st/emitf dv/decrease-zoom)
|
:on-decrease (st/emitf dv/decrease-zoom)
|
||||||
:on-zoom-to-50 (st/emitf dv/zoom-to-50)
|
:on-zoom-to-50 (st/emitf dv/zoom-to-50)
|
||||||
:on-zoom-to-100 (st/emitf dv/reset-zoom)
|
:on-zoom-to-100 (st/emitf dv/reset-zoom)
|
||||||
:on-zoom-to-200 (st/emitf dv/zoom-to-200)}]
|
:on-zoom-to-200 (st/emitf dv/zoom-to-200)
|
||||||
|
:on-fullscreen toggle-fullscreen}]
|
||||||
|
|
||||||
[:span.btn-icon-basic.btn-small.tooltip.tooltip-bottom-left
|
[:span.btn-icon-basic.btn-small.tooltip.tooltip-bottom-left
|
||||||
{:alt (t locale "viewer.header.fullscreen")
|
{:alt (t locale "viewer.header.fullscreen")
|
||||||
:on-click #(if @fullscreen (fullscreen false) (fullscreen true))}
|
:on-click toggle-fullscreen}
|
||||||
(if @fullscreen
|
(if @fullscreen
|
||||||
i/full-screen-off
|
i/full-screen-off
|
||||||
i/full-screen)]
|
i/full-screen)]
|
||||||
|
|
||||||
[:& file-menu {:locale locale
|
(when has-permission?
|
||||||
:project-id project-id
|
[:& file-menu {:locale locale
|
||||||
:file-id file-id
|
:project-id project-id
|
||||||
:page-id page-id}]]]))
|
:file-id file-id
|
||||||
|
:page-id page-id}])]]))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue