Add heading in plugin settings

This commit is contained in:
yoyurec
2022-07-07 17:36:16 +03:00
committed by Junyi Du
parent df127fa519
commit 3b383a918b
3 changed files with 15 additions and 2 deletions

View File

@@ -465,6 +465,12 @@
right: 8px;
}
.heading-item {
margin: 12px 12px 6px;
font-weight: bold;
border-bottom: 1px solid var(--ls-border-color, #738694);
}
.desc-item {
padding: 12px 12px 6px;
@@ -783,7 +789,7 @@
max-height: 80vh;
overflow-y: auto;
}
.menu-link {
padding: 3px 5px;
}

View File

@@ -74,6 +74,12 @@
[:small.pl-1.flex-1 description]
[:div.pl-1 (edit-settings-file pid nil)]]])
(rum/defc render-item-heading
[{:keys [title]}]
[:div.heading-item
[:h2 title]])
(rum/defc settings-container
[schema ^js pl]
(let [^js _settings (.-settings pl)
@@ -107,6 +113,7 @@
#{:boolean} (render-item-toggle val desc update-setting!)
#{:enum} (render-item-enum val desc update-setting!)
#{:object} (render-item-object val desc pid)
#{:heading} (render-item-heading desc)
[:p (str "#Not Handled#" key)]))]