ui/jobs_view: cap Selected job activity to 3 recent rows, anchor at bottom
Show only the latest 3 activity entries for the selected job instead of the full in-memory list, and pin the panel to the bottom of the details pane via a Border so the command output absorbs the remaining vertical space. Adds fixedHeightLayout (mirroring minWidthLayout) to reserve a stable height for the activity list. The full per-job history (maxJobLogs) is untouched and still available in the History view. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -35,3 +35,33 @@ func (l minWidthLayout) Layout(objects []fyne.CanvasObject, size fyne.Size) {
|
||||
object.Resize(size)
|
||||
}
|
||||
}
|
||||
|
||||
// fixedHeightLayout forces its contents to a fixed height while leaving the
|
||||
// width to the parent container. It is used to reserve a stable amount of space
|
||||
// for the activity panel so a neighbouring widget can absorb the rest.
|
||||
type fixedHeightLayout struct {
|
||||
height float32
|
||||
}
|
||||
|
||||
func (l fixedHeightLayout) MinSize(objects []fyne.CanvasObject) fyne.Size {
|
||||
var width float32
|
||||
for _, object := range objects {
|
||||
if !object.Visible() {
|
||||
continue
|
||||
}
|
||||
if min := object.MinSize(); min.Width > width {
|
||||
width = min.Width
|
||||
}
|
||||
}
|
||||
return fyne.NewSize(width, l.height)
|
||||
}
|
||||
|
||||
func (l fixedHeightLayout) Layout(objects []fyne.CanvasObject, size fyne.Size) {
|
||||
for _, object := range objects {
|
||||
if !object.Visible() {
|
||||
continue
|
||||
}
|
||||
object.Move(fyne.NewPos(0, 0))
|
||||
object.Resize(fyne.NewSize(size.Width, l.height))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user