Line data Source code
1 : import { computed } from 'vue'
2 :
3 : import { useSettingStore } from '@/platform/settings/settingStore'
4 :
5 : /**
6 : * Composable for minimap configuration options that are set by the user in the
7 : * settings. Provides reactive computed properties for the settings.
8 : */
9 2102 : export function useMinimapSettings() {
10 2102 : const settingStore = useSettingStore()
11 :
12 2102 : const nodeColors = computed(() =>
13 : settingStore.get('Comfy.Minimap.NodeColors')
14 : )
15 2102 : const showLinks = computed(() => settingStore.get('Comfy.Minimap.ShowLinks'))
16 2102 : const showGroups = computed(() =>
17 : settingStore.get('Comfy.Minimap.ShowGroups')
18 : )
19 2102 : const renderBypass = computed(() =>
20 : settingStore.get('Comfy.Minimap.RenderBypassState')
21 : )
22 2102 : const renderError = computed(() =>
23 : settingStore.get('Comfy.Minimap.RenderErrorState')
24 : )
25 :
26 2102 : const width = 253
27 2102 : const height = 200
28 :
29 : const containerStyles = computed(() => ({
30 : width: `${width}px`,
31 : height: `${height}px`,
32 : border: '1px solid var(--border)',
33 : borderRadius: '8px'
34 : }))
35 :
36 : const panelStyles = computed(() => ({
37 : width: `210px`,
38 : height: `${height}px`,
39 : border: '1px solid var(--border)',
40 : borderRadius: '8px'
41 : }))
42 :
43 2102 : return {
44 : nodeColors,
45 : showLinks,
46 : showGroups,
47 : renderBypass,
48 : renderError,
49 : containerStyles,
50 : panelStyles
51 : }
52 : }
|