mirror of
https://github.com/penpot/penpot.git
synced 2025-08-06 13:08:28 +02:00
♻️ Improve file menu usage
This commit is contained in:
parent
46bfb2aacd
commit
70def21153
3 changed files with 41 additions and 7 deletions
|
@ -5,6 +5,8 @@
|
||||||
### :boom: Breaking changes
|
### :boom: Breaking changes
|
||||||
|
|
||||||
### :sparkles: New features
|
### :sparkles: New features
|
||||||
|
|
||||||
|
- Improve usage of file menu [Taiga #2853](https://tree.taiga.io/project/penpot/us/2853)
|
||||||
- Rotation to snap to 15º intervals with shift [Taiga #2437](https://tree.taiga.io/project/penpot/issue/2437)
|
- Rotation to snap to 15º intervals with shift [Taiga #2437](https://tree.taiga.io/project/penpot/issue/2437)
|
||||||
- Support border radius and stroke properties for images [Taiga #497](https://tree.taiga.io/project/penpot/us/497)
|
- Support border radius and stroke properties for images [Taiga #497](https://tree.taiga.io/project/penpot/us/497)
|
||||||
- Disallow using same password as user email [Taiga #2454](https://tree.taiga.io/project/penpot/us/2454)
|
- Disallow using same password as user email [Taiga #2454](https://tree.taiga.io/project/penpot/us/2454)
|
||||||
|
|
|
@ -154,12 +154,22 @@
|
||||||
left: 40px;
|
left: 40px;
|
||||||
width: 183px;
|
width: 183px;
|
||||||
z-index: 12;
|
z-index: 12;
|
||||||
@include animation(0, 0.2s, fadeInDown);
|
|
||||||
|
|
||||||
background-color: $color-white;
|
background-color: $color-white;
|
||||||
border-radius: $br-small;
|
border-radius: $br-small;
|
||||||
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.25);
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.25);
|
||||||
|
|
||||||
|
:first-child {
|
||||||
|
&:hover {
|
||||||
|
border-radius: $br-small $br-small 0px 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:last-child {
|
||||||
|
&:hover {
|
||||||
|
border-radius: 0px 0px $br-small $br-small;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: $fs14;
|
font-size: $fs14;
|
||||||
|
@ -193,11 +203,21 @@
|
||||||
left: 230px;
|
left: 230px;
|
||||||
width: 270px;
|
width: 270px;
|
||||||
z-index: 12;
|
z-index: 12;
|
||||||
@include animation(0, 0.2s, fadeInDown);
|
|
||||||
background-color: $color-white;
|
background-color: $color-white;
|
||||||
border-radius: $br-small;
|
border-radius: $br-small;
|
||||||
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.25);
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.25);
|
||||||
|
|
||||||
|
:first-child {
|
||||||
|
&:hover {
|
||||||
|
border-radius: $br-small $br-small 0px 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:last-child {
|
||||||
|
&:hover {
|
||||||
|
border-radius: 0px 0px $br-small $br-small;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.file {
|
&.file {
|
||||||
top: 40px;
|
top: 40px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,6 +194,13 @@
|
||||||
(st/emit! (dm/error (tr "errors.unexpected-error"))))
|
(st/emit! (dm/error (tr "errors.unexpected-error"))))
|
||||||
(st/emitf dm/hide)))))))
|
(st/emitf dm/hide)))))))
|
||||||
|
|
||||||
|
on-item-hover
|
||||||
|
(mf/use-callback
|
||||||
|
(fn [item]
|
||||||
|
(fn [event]
|
||||||
|
(dom/stop-propagation event)
|
||||||
|
(reset! show-sub-menu? item))))
|
||||||
|
|
||||||
on-item-click
|
on-item-click
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
(fn [item]
|
(fn [item]
|
||||||
|
@ -230,18 +237,23 @@
|
||||||
[:& dropdown {:show @show-menu?
|
[:& dropdown {:show @show-menu?
|
||||||
:on-close #(reset! show-menu? false)}
|
:on-close #(reset! show-menu? false)}
|
||||||
[:ul.menu
|
[:ul.menu
|
||||||
[:li {:on-click (on-item-click :file)}
|
[:li {:on-click (on-item-click :file)
|
||||||
|
:on-pointer-enter (on-item-hover :file)}
|
||||||
[:span (tr "workspace.header.menu.option.file")]
|
[:span (tr "workspace.header.menu.option.file")]
|
||||||
[:span i/arrow-slide]]
|
[:span i/arrow-slide]]
|
||||||
[:li {:on-click (on-item-click :edit)}
|
[:li {:on-click (on-item-click :edit)
|
||||||
|
:on-pointer-enter (on-item-hover :edit)}
|
||||||
[:span (tr "workspace.header.menu.option.edit")] [:span i/arrow-slide]]
|
[:span (tr "workspace.header.menu.option.edit")] [:span i/arrow-slide]]
|
||||||
[:li {:on-click (on-item-click :view)}
|
[:li {:on-click (on-item-click :view)
|
||||||
|
:on-pointer-enter (on-item-hover :view)}
|
||||||
[:span (tr "workspace.header.menu.option.view")] [:span i/arrow-slide]]
|
[:span (tr "workspace.header.menu.option.view")] [:span i/arrow-slide]]
|
||||||
[:li {:on-click (on-item-click :preferences)}
|
[:li {:on-click (on-item-click :preferences)
|
||||||
|
:on-pointer-enter (on-item-hover :preferences)}
|
||||||
[:span (tr "workspace.header.menu.option.preferences")] [:span i/arrow-slide]]
|
[:span (tr "workspace.header.menu.option.preferences")] [:span i/arrow-slide]]
|
||||||
(when (contains? @cf/flags :user-feedback)
|
(when (contains? @cf/flags :user-feedback)
|
||||||
[:*
|
[:*
|
||||||
[:li.feedback {:on-click (st/emitf (rt/nav :settings-feedback))}
|
[:li.feedback {:on-click (st/emitf (rt/nav :settings-feedback))
|
||||||
|
:on-pointer-enter (st/emitf (rt/nav :settings-feedback))}
|
||||||
[:span (tr "labels.give-feedback")]]])]]
|
[:span (tr "labels.give-feedback")]]])]]
|
||||||
|
|
||||||
[:& dropdown {:show (= @show-sub-menu? :file)
|
[:& dropdown {:show (= @show-sub-menu? :file)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue