if (hasField(title) && child == title) {
continue;
// Layout title last, separately
}
layoutChild(child, availableWidth, height);
XYRect childExtent = child.getExtent();
availableWidth -= childExtent.width;
if (hasField(icon) && child == icon) {
// skip the interior padding loss.
} else {
availableWidth -= interiorPadding;
}
maxHeight = Math.max(maxHeight, childExtent.height);
}
// Layout Title with remaining space
if (hasField(title)) {
child = title;
layoutChild(child, availableWidth, height);
XYRect childExtent = child.getExtent();
availableWidth -= childExtent.width + interiorPadding;
maxHeight = Math.max(maxHeight, childExtent.height);
}
// Set Positions
if (hasField(icon)) {