mirror of
https://github.com/penpot/penpot.git
synced 2025-02-13 18:48:37 -05:00
✨ Add some enhancements to context menus
This commit is contained in:
parent
b547f1cd7e
commit
81a604dca2
8 changed files with 13 additions and 4 deletions
|
@ -41,6 +41,10 @@
|
|||
padding: 0px;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
&.min-width {
|
||||
min-width: 13rem;
|
||||
}
|
||||
}
|
||||
|
||||
.context-menu-action {
|
||||
|
@ -72,8 +76,9 @@
|
|||
}
|
||||
|
||||
&.submenu-back {
|
||||
color: $color-gray-30;
|
||||
color: $color-black;
|
||||
display: flex;
|
||||
font-weight: bold;
|
||||
align-items: center;
|
||||
|
||||
& svg {
|
||||
|
|
|
@ -167,6 +167,7 @@
|
|||
|
||||
.shortcut {
|
||||
color: $color-gray-20;
|
||||
font-size: $fs12;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
|
||||
span:last-child {
|
||||
color: $color-gray-20;
|
||||
font-size: $fs12;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
top (gobj/get props "top" 0)
|
||||
left (gobj/get props "left" 0)
|
||||
fixed? (gobj/get props "fixed?" false)
|
||||
min-width? (gobj/get props "min-width?" false)
|
||||
|
||||
local (mf/use-state {:offset 0
|
||||
:levels nil})
|
||||
|
@ -89,7 +90,8 @@
|
|||
:style {:top (+ top (:offset @local))
|
||||
:left left}}
|
||||
(let [level (-> @local :levels peek)]
|
||||
[:ul.context-menu-items {:ref check-menu-offscreen}
|
||||
[:ul.context-menu-items {:class (classnames :min-width min-width?)
|
||||
:ref check-menu-offscreen}
|
||||
(when-let [parent-option (:parent-option level)]
|
||||
[:*
|
||||
[:li.context-menu-item
|
||||
|
|
|
@ -156,6 +156,7 @@
|
|||
[:& context-menu {:on-close on-menu-close
|
||||
:show show?
|
||||
:fixed? (or (not= top 0) (not= left 0))
|
||||
:min-width? true
|
||||
:top top
|
||||
:left left
|
||||
:options [[(tr "dashboard.open-in-new-tab") on-new-tab]
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
[app.main.data.dashboard :as dd]
|
||||
[app.main.data.modal :as modal]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.components.context-menu :refer [context-menu]]
|
||||
[app.main.ui.dashboard.grid :refer [grid]]
|
||||
[app.main.ui.dashboard.inline-edition :refer [inline-edition]]
|
||||
[app.main.ui.dashboard.project-menu :refer [project-menu]]
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
[app.main.data.modal :as modal]
|
||||
[app.main.fonts :as fonts]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.components.context-menu :refer [context-menu]]
|
||||
[app.main.ui.dashboard.file-menu :refer [file-menu]]
|
||||
[app.main.ui.dashboard.inline-edition :refer [inline-edition]]
|
||||
[app.main.ui.icons :as i]
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
[:& context-menu {:on-close on-menu-close
|
||||
:show show?
|
||||
:fixed? (or (not= top 0) (not= left 0))
|
||||
:min-width? true
|
||||
:top top
|
||||
:left left
|
||||
:options [[(tr "labels.rename") on-edit]
|
||||
|
|
Loading…
Add table
Reference in a new issue