mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
Add setting to control tree explorer item padding (#700)
This commit is contained in:
14
src/App.vue
14
src/App.vue
@@ -60,6 +60,14 @@ watchEffect(() => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watchEffect(() => {
|
||||||
|
const padding = useSettingStore().get('Comfy.TreeExplorer.ItemPadding')
|
||||||
|
document.documentElement.style.setProperty(
|
||||||
|
'--comfy-tree-explorer-item-padding',
|
||||||
|
`${padding}px`
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const init = () => {
|
const init = () => {
|
||||||
useSettingStore().addSettings(app.ui.settings)
|
useSettingStore().addSettings(app.ui.settings)
|
||||||
@@ -126,6 +134,12 @@ onUnmounted(() => {
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.p-tree-node-content {
|
||||||
|
padding: var(--comfy-tree-explorer-item-padding) !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.spinner {
|
.spinner {
|
||||||
@apply absolute inset-0 flex justify-center items-center h-screen;
|
@apply absolute inset-0 flex justify-center items-center h-screen;
|
||||||
|
|||||||
@@ -267,6 +267,18 @@ export const useSettingStore = defineStore('setting', {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
defaultValue: false
|
defaultValue: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.ui.settings.addSetting({
|
||||||
|
id: 'Comfy.TreeExplorer.ItemPadding',
|
||||||
|
name: 'Tree explorer item padding',
|
||||||
|
type: 'slider',
|
||||||
|
defaultValue: 2,
|
||||||
|
attrs: {
|
||||||
|
min: 0,
|
||||||
|
max: 8,
|
||||||
|
step: 1
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
set<K extends keyof Settings>(key: K, value: Settings[K]) {
|
set<K extends keyof Settings>(key: K, value: Settings[K]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user