| 555 | } |
| 556 | |
| 557 | func (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 |
| 578 | func (m RootModel) getSettingsValues(category string) map[string]interface{} { |