diff --git a/src/components/common/FormItem.vue b/src/components/common/FormItem.vue index c3c76afe84..854dab3db9 100644 --- a/src/components/common/FormItem.vue +++ b/src/components/common/FormItem.vue @@ -68,19 +68,19 @@ function getFormAttrs(item: FormItem) { } switch (item.type) { case 'combo': - case 'radio': - attrs['options'] = + case 'radio': { + const resolvedOptions = typeof item.options === 'function' - ? // @ts-expect-error: Audit and deprecate usage of legacy options type: - // (value) => [string | {text: string, value: string}] - item.options(formValue.value) + ? item.options(formValue.value) : item.options + attrs['options'] = resolvedOptions - if (typeof item.options?.[0] !== 'string') { + if (typeof resolvedOptions?.[0] !== 'string') { attrs['optionLabel'] = 'text' attrs['optionValue'] = 'value' } break + } } return attrs } diff --git a/src/components/rightSidePanel/settings/TabGlobalSettings.vue b/src/components/rightSidePanel/settings/TabGlobalSettings.vue index 49422821c7..1e92bc12ba 100644 --- a/src/components/rightSidePanel/settings/TabGlobalSettings.vue +++ b/src/components/rightSidePanel/settings/TabGlobalSettings.vue @@ -9,6 +9,7 @@ import Slider from '@/components/ui/slider/Slider.vue' import { LiteGraph } from '@/lib/litegraph/src/litegraph' import type { LinkRenderType } from '@/lib/litegraph/src/types/globalEnums' import { LinkMarkerShape } from '@/lib/litegraph/src/types/globalEnums' +import { useInputDeviceDetection } from '@/platform/settings/composables/useInputDeviceDetection' import { useSettingStore } from '@/platform/settings/settingStore' import { WidgetInputBaseClass } from '@/renderer/extensions/vueNodes/widgets/components/layout' import { useSettingsDialog } from '@/platform/settings/composables/useSettingsDialog' @@ -40,6 +41,33 @@ const nodes2Enabled = computed({ }) // CANVAS settings +const inputDevice = computed({ + get: () => settingStore.get('Comfy.Graph.WheelInputMode'), + set: (value) => settingStore.set('Comfy.Graph.WheelInputMode', value) +}) + +const { detectedInputDevice } = useInputDeviceDetection() + +const inputDeviceOptions = computed(() => [ + { + value: 'auto', + label: + detectedInputDevice.value === 'trackpad' + ? t( + 'settings.Comfy_Graph_WheelInputMode.options.Auto-detect (Trackpad)' + ) + : t('settings.Comfy_Graph_WheelInputMode.options.Auto-detect (Mouse)') + }, + { + value: 'mouse', + label: t('settings.Comfy_Graph_WheelInputMode.options.Mouse') + }, + { + value: 'trackpad', + label: t('settings.Comfy_Graph_WheelInputMode.options.Trackpad') + } +]) + const gridSpacing = computed({ get: () => settingStore.get('Comfy.SnapToGrid.GridSize'), set: (value) => settingStore.set('Comfy.SnapToGrid.GridSize', value) @@ -128,6 +156,24 @@ function openFullSettings() { {{ t('rightSidePanel.globalSettings.canvas') }}
+ +