MCPcopy
hub / github.com/SurgeDM/Surge / updateSettingsInputWidthForViewport

Method updateSettingsInputWidthForViewport

internal/tui/view_settings.go:557–575  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

555}
556
557func (m *RootModel) updateSettingsInputWidthForViewport() {
558 modalWidth, _ := GetSettingsDimensions(m.width, m.height)
559 var targetWidth int
560 if modalWidth >= 72 {
561 _, rightWidth := CalculateTwoColumnWidths(modalWidth, 32, 22)
562 targetWidth = rightWidth - 10 // Fixed offset for labels
563 } else {
564 targetWidth = modalWidth - 16 // Fixed offset for labels
565 }
566
567 if targetWidth < MinSettingsInputW {
568 targetWidth = MinSettingsInputW
569 }
570 if targetWidth > MaxSettingsInputW {
571 targetWidth = MaxSettingsInputW
572 }
573
574 m.SettingsInput.SetWidth(targetWidth)
575}
576
577// getSettingsValues returns a map of setting key -> value for a category
578func (m RootModel) getSettingsValues(category string) map[string]interface{} {

Callers 5

renderSettingsCompactMethod · 0.95
UpdateMethod · 0.95
updateSettingsMethod · 0.95

Calls 2

GetSettingsDimensionsFunction · 0.85
CalculateTwoColumnWidthsFunction · 0.85