Gtk: Fix notification label wrapping

This commit is contained in:
Ben Olden-Cooligan 2023-04-22 15:25:04 -07:00
parent 8587bd80c4
commit c8cc584c82
2 changed files with 2 additions and 2 deletions

View File

@ -166,7 +166,7 @@ public class GtkEtoPlatform : EtoPlatform
label.MaxWidthChars = EstimateCharactersWide(defaultWidth, label);
label.GetPreferredSize(out var minSize, out var naturalSize);
label.GetPreferredHeightForWidth(defaultWidth, out var minHeight, out var naturalHeight);
return new SizeF(Math.Min(naturalSize.Width, defaultWidth), naturalHeight);
return new SizeF(Math.Min(naturalSize.Width + 10, defaultWidth), naturalHeight);
}
return base.GetWrappedSize(control, defaultWidth);
}

View File

@ -132,7 +132,7 @@ public class LayoutControl : LayoutElement
// usually what we want.
return new SizeF(
EtoPlatform.Current.GetWrappedSize(Control, (int) parentBounds.Width).Width,
EtoPlatform.Current.GetWrappedSize(Control, wrapDefaultWidth).Height);
EtoPlatform.Current.GetWrappedSize(Control, Math.Min((int) parentBounds.Width, wrapDefaultWidth)).Height);
}
// Now that we've handled the special cases, this measures the real dimensions of the label given
// the parent bounds. In a layout cell, this ensures we align correctly (e.g. centered vertically).