mirror of
https://github.com/cyanfish/naps2.git
synced 2024-09-11 15:26:55 +03:00
Gtk: Fix notification label wrapping
This commit is contained in:
parent
8587bd80c4
commit
c8cc584c82
@ -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);
|
||||
}
|
||||
|
@ -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).
|
||||
|
Loading…
Reference in New Issue
Block a user