Skip to content

Commit 84433f3

Browse files
committed
formated Settings -- Appearance to fit in a page without overflow
1 parent 52b1f4a commit 84433f3

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

internal/ui/settings.go

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,6 @@ func (u *UIManager) ShowSettings(cfg *config.Config, onSave func(*config.Config)
140140
} else {
141141
positionRadio.SetSelected("Bottom-Right")
142142
}
143-
customPosLabel := widget.NewLabel("")
144-
if cfg.CustomX != nil && cfg.CustomY != nil {
145-
customPosLabel.SetText(fmt.Sprintf("Custom: (%d, %d) — picking a corner clears it.", *cfg.CustomX, *cfg.CustomY))
146-
}
147-
positionRadio.OnChanged = func(_ string) { customPosLabel.SetText("") }
148-
149143
// ── Monitor selector ─────────────────────────────────────────────────
150144
monitorCount := u.GetMonitorCount()
151145
var monitorOptions []string
@@ -160,7 +154,7 @@ func (u *UIManager) ShowSettings(cfg *config.Config, onSave func(*config.Config)
160154
}
161155
// Build the position card contents — include monitor selector only
162156
// when multiple monitors are detected.
163-
positionItems := []fyne.CanvasObject{positionRadio, customPosLabel}
157+
positionItems := []fyne.CanvasObject{positionRadio}
164158
if monitorCount > 1 {
165159
monitorLabel := widget.NewLabel("Display Monitor")
166160
monitorLabel.TextStyle = fyne.TextStyle{Bold: true}
@@ -538,17 +532,28 @@ func (u *UIManager) ShowSettings(cfg *config.Config, onSave func(*config.Config)
538532
}
539533

540534
// ── Tabs Assembly ─────────────────────────────────────────────────────
535+
536+
// sectionBlock builds a consistent section with a bold title, a muted
537+
// subtitle, and the content below — matching the "Display Monitor" label style.
538+
sectionBlock := func(title, subtitle string, content fyne.CanvasObject) *fyne.Container {
539+
titleLabel := widget.NewLabel(title)
540+
titleLabel.TextStyle = fyne.TextStyle{Bold: true}
541+
subtitleLabel := widget.NewLabel(subtitle)
542+
subtitleLabel.TextStyle = fyne.TextStyle{Italic: true}
543+
return container.NewVBox(titleLabel, subtitleLabel, content, widget.NewSeparator())
544+
}
545+
541546
appearanceContent := container.NewPadded(container.NewVScroll(container.NewVBox(
542-
widget.NewCard("Widget Position", "Where should the widget appear?",
547+
sectionBlock("Widget Position", "Where should the widget appear?",
543548
container.NewVBox(positionItems...),
544549
),
545-
widget.NewCard("Background Transparency", "Adjust how see-through the widget is.",
550+
sectionBlock("Background Transparency", "Adjust how see-through the widget is.",
546551
opacityRadio,
547552
),
548-
widget.NewCard("Refresh Interval", "How often to fetch new data.",
553+
sectionBlock("Refresh Interval", "How often to fetch new data.",
549554
container.NewHBox(intervalSlider, intervalLabel),
550555
),
551-
widget.NewCard("Startup", "Start automatically when you log in.",
556+
sectionBlock("Startup", "Start automatically when you log in.",
552557
autoStartCheck,
553558
),
554559
)))

0 commit comments

Comments
 (0)