FB-09: size default HUD widgets by title, not a fixed uniform cell
Adds minColSpanForLabel as a character-count proxy for how many grid columns a metric's title needs, reworks HudWidgetLayout.defaultFor into a left-to-right row-packing layout using it, enforces the same minimum as a floor on manual resize, and splits _HudMetricValue's FittedBox so the title renders at a fixed reference size while only the value shrinks/grows to fill the remaining space. Confirms a real, documented interaction with FB-08's _reflowRow: its even column split has no awareness of a member's title-driven minimum and can push one below it. Left unfixed per this ticket's own Out-of-scope section -- _reflowRow's algorithm is FB-08's, not this ticket's, to change. Test count 426 -> 434, all green. flutter analyze unchanged (same 4 pre-existing, unrelated info-level issues).
This commit is contained in:
@@ -146,9 +146,18 @@ class _DraggableResizableHudWidgetState extends State<DraggableResizableHudWidge
|
||||
});
|
||||
},
|
||||
onPanEnd: (_) {
|
||||
// FB-09: a rider can still make a widget larger than its title
|
||||
// needs (for a bigger value reading), but never smaller than the
|
||||
// title's own minimum -- clamped here rather than left to the
|
||||
// generic hudMinSpan floor in HudLayoutController.
|
||||
final snappedColSpan =
|
||||
((layout.colSpan * _cellWidth + _resizeDelta.width) / _cellWidth)
|
||||
.round();
|
||||
(((layout.colSpan * _cellWidth + _resizeDelta.width) /
|
||||
_cellWidth)
|
||||
.round())
|
||||
.clamp(
|
||||
minColSpanForLabel(layout.metric.label),
|
||||
hudMaxColSpan,
|
||||
);
|
||||
final snappedRowSpan =
|
||||
((layout.rowSpan * _cellHeight + _resizeDelta.height) /
|
||||
_cellHeight)
|
||||
|
||||
Reference in New Issue
Block a user