mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 23:41:40 +02:00
✨ Add a little improvent in recent fonts selector
This commit is contained in:
parent
7134bbf484
commit
38b7474f0b
4 changed files with 26 additions and 12 deletions
|
@ -1169,7 +1169,6 @@
|
||||||
|
|
||||||
header {
|
header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
@ -1225,9 +1224,15 @@
|
||||||
border-radius: $br-small;
|
border-radius: $br-small;
|
||||||
color: $color-gray-20;
|
color: $color-gray-20;
|
||||||
border: 1px solid $color-gray-30;
|
border: 1px solid $color-gray-30;
|
||||||
|
width: 88%;
|
||||||
margin: 15px 17px;
|
margin: 15px 17px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: $fs14;
|
||||||
|
margin: 9px 17px;
|
||||||
|
}
|
||||||
|
|
||||||
.options {
|
.options {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
@ -143,8 +143,7 @@
|
||||||
(mf/deps on-select on-close)
|
(mf/deps on-select on-close)
|
||||||
(fn [font]
|
(fn [font]
|
||||||
(on-select font)
|
(on-select font)
|
||||||
(on-close)))
|
(on-close)))]
|
||||||
]
|
|
||||||
|
|
||||||
(mf/use-effect
|
(mf/use-effect
|
||||||
(fn []
|
(fn []
|
||||||
|
@ -190,13 +189,16 @@
|
||||||
:ref input
|
:ref input
|
||||||
:spell-check false
|
:spell-check false
|
||||||
:on-change on-filter-change}]
|
:on-change on-filter-change}]
|
||||||
|
[:hr]
|
||||||
(when recent-fonts
|
(when recent-fonts
|
||||||
|
[*
|
||||||
|
[:p.title (tr "workspace.options.recent-fonts")]
|
||||||
(for [font recent-fonts]
|
(for [font recent-fonts]
|
||||||
[:& font-item {:key (:id font)
|
[:& font-item {:key (:id font)
|
||||||
:font font
|
:font font
|
||||||
:style {}
|
:style {}
|
||||||
:on-click on-select-and-close
|
:on-click on-select-and-close
|
||||||
:current? (= (:id font) (:id @selected))}]))
|
:current? (= (:id font) (:id @selected))}])])
|
||||||
|
|
||||||
#_[:div.options
|
#_[:div.options
|
||||||
{:on-click #(swap! state assoc :show-options true)
|
{:on-click #(swap! state assoc :show-options true)
|
||||||
|
@ -257,6 +259,7 @@
|
||||||
fonts (mf/deref fonts/fontsdb)
|
fonts (mf/deref fonts/fontsdb)
|
||||||
font (get fonts font-id)
|
font (get fonts font-id)
|
||||||
recent-fonts (mf/deref refs/workspace-recent-fonts)
|
recent-fonts (mf/deref refs/workspace-recent-fonts)
|
||||||
|
last-font (mf/use-ref nil)
|
||||||
|
|
||||||
open-selector? (mf/use-state false)
|
open-selector? (mf/use-state false)
|
||||||
|
|
||||||
|
@ -271,7 +274,7 @@
|
||||||
:font-variant-id (or id name)
|
:font-variant-id (or id name)
|
||||||
:font-weight weight
|
:font-weight weight
|
||||||
:font-style style})
|
:font-style style})
|
||||||
(st/emit! (fts/add-recent-font font)))))
|
(mf/set-ref-val! last-font font))))
|
||||||
|
|
||||||
on-font-size-change
|
on-font-size-change
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
|
@ -309,7 +312,7 @@
|
||||||
(reset! open-selector? false)
|
(reset! open-selector? false)
|
||||||
(when (some? on-blur)
|
(when (some? on-blur)
|
||||||
(on-blur))
|
(on-blur))
|
||||||
))]
|
(st/emit! (fts/add-recent-font (mf/ref-val last-font)))))]
|
||||||
|
|
||||||
[:*
|
[:*
|
||||||
(when @open-selector?
|
(when @open-selector?
|
||||||
|
|
|
@ -2815,6 +2815,9 @@ msgstr "Rotation"
|
||||||
msgid "workspace.options.search-font"
|
msgid "workspace.options.search-font"
|
||||||
msgstr "Search font"
|
msgstr "Search font"
|
||||||
|
|
||||||
|
msgid "workspace.options.recent-fonts"
|
||||||
|
msgstr "Recent"
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/sidebar/options/menus/interactions.cljs
|
#: src/app/main/ui/workspace/sidebar/options/menus/interactions.cljs
|
||||||
msgid "workspace.options.select-a-shape"
|
msgid "workspace.options.select-a-shape"
|
||||||
msgstr "Select a shape, artboard or group to drag a connection to other artboard."
|
msgstr "Select a shape, artboard or group to drag a connection to other artboard."
|
||||||
|
|
|
@ -2826,6 +2826,9 @@ msgstr "Rotación"
|
||||||
msgid "workspace.options.search-font"
|
msgid "workspace.options.search-font"
|
||||||
msgstr "Buscar fuente"
|
msgstr "Buscar fuente"
|
||||||
|
|
||||||
|
msgid "workspace.options.recent-fonts"
|
||||||
|
msgstr "Recientes"
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/sidebar/options/menus/interactions.cljs
|
#: src/app/main/ui/workspace/sidebar/options/menus/interactions.cljs
|
||||||
msgid "workspace.options.select-a-shape"
|
msgid "workspace.options.select-a-shape"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue