Stabilize Jobs details panel width

Wrap dynamic job detail labels so long names, schedules, commands, and status values no longer change the right panel minimum width when the selected job changes.

Point embedded and Windows resource icons at the current asset filenames so tests and Windows builds continue to work after the asset cleanup.
This commit is contained in:
mixeme
2026-06-16 21:24:03 +03:00
parent 079961e735
commit 0bc9e91d1e
4 changed files with 19 additions and 9 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ import (
// The blank import enables the compiler directive below; no runtime package
// initialization from embed is required.
//
//go:embed pysentry-icon.png
//go:embed pysentry-icon-big.png
var iconBytes []byte
func Icon() fyne.Resource {
@@ -22,7 +22,7 @@ func Icon() fyne.Resource {
// for the window icon and tray icon. The Windows Explorer icon is still added
// by the build script through the .ico resource, because Explorer reads PE
// resources rather than Fyne runtime state.
return fyne.NewStaticResource("pysentry-icon.png", iconBytes)
return fyne.NewStaticResource("pysentry-icon-big.png", iconBytes)
}
func IconBytes() []byte {
Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

+1 -1
View File
@@ -1 +1 @@
IDI_ICON1 ICON "assets/pysentry.ico"
IDI_ICON1 ICON "assets/gosentry.ico"
+16 -6
View File
@@ -157,12 +157,13 @@ func newMainView(w fyne.Window, started time.Time) fyne.CanvasObject {
schedulerPaused := false
filteredJobs := filteredJobIndexes(jobs, selectedFolder)
title := widget.NewLabelWithStyle(jobs[selected].Name, fyne.TextAlignLeading, fyne.TextStyle{Bold: true})
folder := widget.NewLabel(jobs[selected].Folder)
schedule := widget.NewLabel(jobs[selected].Schedule)
command := widget.NewLabel(jobs[selected].Command)
lastRun := widget.NewLabel(jobs[selected].LastRun)
nextRun := widget.NewLabel(jobs[selected].NextRun)
state := widget.NewLabel(jobs[selected].LastState)
title.Wrapping = fyne.TextWrapBreak
folder := newJobDetailLabel(jobs[selected].Folder)
schedule := newJobDetailLabel(jobs[selected].Schedule)
command := newJobDetailLabel(jobs[selected].Command)
lastRun := newJobDetailLabel(jobs[selected].LastRun)
nextRun := newJobDetailLabel(jobs[selected].NextRun)
state := newJobDetailLabel(jobs[selected].LastState)
schedulerState := widget.NewLabel("Scheduler running")
commandOutput := widget.NewTextGrid()
commandOutput.SetText(jobs[selected].Output)
@@ -569,6 +570,15 @@ func detailRow(label string, value fyne.CanvasObject) fyne.CanvasObject {
return container.NewGridWithColumns(2, caption, value)
}
func newJobDetailLabel(text string) *widget.Label {
label := widget.NewLabel(text)
// Job names, commands, and paths can be much wider than the details panel.
// Breaking long runs of text keeps Label.MinSize stable when the selection
// changes, so the right panel does not force the whole window to resize.
label.Wrapping = fyne.TextWrapBreak
return label
}
func settingsRow(label string, value fyne.CanvasObject) fyne.CanvasObject {
caption := widget.NewLabelWithStyle(label, fyne.TextAlignLeading, fyne.TextStyle{Bold: true})
caption.Wrapping = fyne.TextTruncate