Fix label vertical alignment
This commit is contained in:
parent
72af1a8a3a
commit
85c7c74270
|
@ -83,6 +83,19 @@ namespace Ooui.Forms.Extensions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string ToOouiVerticalAlign (this TextAlignment align)
|
||||||
|
{
|
||||||
|
switch (align) {
|
||||||
|
case TextAlignment.Start:
|
||||||
|
default:
|
||||||
|
return "top";
|
||||||
|
case TextAlignment.Center:
|
||||||
|
return "middle";
|
||||||
|
case TextAlignment.End:
|
||||||
|
return "bottom";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static readonly double[] CharacterProportions = {
|
static readonly double[] CharacterProportions = {
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0.27799999713897705, 0.27799999713897705, 0.27799999713897705, 0.27799999713897705, 0.27799999713897705, 0, 0,
|
0, 0.27799999713897705, 0.27799999713897705, 0.27799999713897705, 0.27799999713897705, 0.27799999713897705, 0, 0,
|
||||||
|
|
|
@ -103,8 +103,10 @@ namespace Ooui.Forms.Renderers
|
||||||
|
|
||||||
void UpdateAlignment ()
|
void UpdateAlignment ()
|
||||||
{
|
{
|
||||||
|
this.Style.Display = "table";
|
||||||
|
Control.Style.Display = "table-cell";
|
||||||
this.Style.TextAlign = Element.HorizontalTextAlignment.ToOouiTextAlign ();
|
this.Style.TextAlign = Element.HorizontalTextAlignment.ToOouiTextAlign ();
|
||||||
this.Style.VerticalAlign = Element.VerticalTextAlignment.ToOouiTextAlign ();
|
Control.Style.VerticalAlign = Element.VerticalTextAlignment.ToOouiVerticalAlign ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateLineBreakMode ()
|
void UpdateLineBreakMode ()
|
||||||
|
|
Loading…
Reference in New Issue