feat(ui): condense panels and let the window shrink to 720p
Make the job details and settings views more compact and remove the tall minimum that prevented resizing the window shorter: - Lay job metadata out in two columns and stack rows with a negative-gap compactVBoxLayout, roughly halving the block height. - Wrap the settings form in a vertical scroll so it no longer dictates the window minimum (AppTabs sizes to the tallest tab), and tighten its rows with the same compact layout. - Shrink the command-output scroll minimum height so the details pane can get shorter; long output still scrolls. - Size the "Selected job activity" panel to exactly maxJobActivityRows using widget.List's own content-height formula, so all three rows show without a scrollbar regardless of theme or DPI. Together these drop the minimum window height from ~891px to ~570px. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,48 @@ func (l minWidthLayout) Layout(objects []fyne.CanvasObject, size fyne.Size) {
|
||||
}
|
||||
}
|
||||
|
||||
// compactVBoxLayout stacks children vertically with a configurable gap between
|
||||
// them, producing tighter rows than container.NewVBox (which inserts
|
||||
// theme.Padding() between every child). A negative spacing pulls neighbouring
|
||||
// rows together so they overlap the labels' built-in vertical padding, which is
|
||||
// how the details metadata is condensed to fit 720p screens.
|
||||
type compactVBoxLayout struct {
|
||||
spacing float32
|
||||
}
|
||||
|
||||
func (l compactVBoxLayout) MinSize(objects []fyne.CanvasObject) fyne.Size {
|
||||
var w, h float32
|
||||
var visible int
|
||||
for _, o := range objects {
|
||||
if !o.Visible() {
|
||||
continue
|
||||
}
|
||||
min := o.MinSize()
|
||||
if min.Width > w {
|
||||
w = min.Width
|
||||
}
|
||||
h += min.Height
|
||||
visible++
|
||||
}
|
||||
if visible > 1 {
|
||||
h += l.spacing * float32(visible-1)
|
||||
}
|
||||
return fyne.NewSize(w, h)
|
||||
}
|
||||
|
||||
func (l compactVBoxLayout) Layout(objects []fyne.CanvasObject, size fyne.Size) {
|
||||
var y float32
|
||||
for _, o := range objects {
|
||||
if !o.Visible() {
|
||||
continue
|
||||
}
|
||||
h := o.MinSize().Height
|
||||
o.Move(fyne.NewPos(0, y))
|
||||
o.Resize(fyne.NewSize(size.Width, h))
|
||||
y += h + l.spacing
|
||||
}
|
||||
}
|
||||
|
||||
// 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.
|
||||
|
||||
Reference in New Issue
Block a user