From 8701c253c3753ed5fef38d076a3888a663a8b629 Mon Sep 17 00:00:00 2001 From: Walter Werner SCHNEIDER Date: Wed, 1 Sep 2021 11:47:38 +0300 Subject: [PATCH] material: update label type scales to match the MD spec Signed-off-by: Walter Werner SCHNEIDER --- widget/material/label.go | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/widget/material/label.go b/widget/material/label.go index 89bbc538..a0ece845 100644 --- a/widget/material/label.go +++ b/widget/material/label.go @@ -28,11 +28,15 @@ type LabelStyle struct { } func H1(th *Theme, txt string) LabelStyle { - return Label(th, th.TextSize.Scale(96.0/16.0), txt) + label := Label(th, th.TextSize.Scale(96.0/16.0), txt) + label.Font.Weight = text.Light + return label } func H2(th *Theme, txt string) LabelStyle { - return Label(th, th.TextSize.Scale(60.0/16.0), txt) + label := Label(th, th.TextSize.Scale(60.0/16.0), txt) + label.Font.Weight = text.Light + return label } func H3(th *Theme, txt string) LabelStyle { @@ -48,7 +52,19 @@ func H5(th *Theme, txt string) LabelStyle { } func H6(th *Theme, txt string) LabelStyle { - return Label(th, th.TextSize.Scale(20.0/16.0), txt) + label := Label(th, th.TextSize.Scale(20.0/16.0), txt) + label.Font.Weight = text.Medium + return label +} + +func Subtitle1(th *Theme, txt string) LabelStyle { + return Label(th, th.TextSize.Scale(16.0/16.0), txt) +} + +func Subtitle2(th *Theme, txt string) LabelStyle { + label := Label(th, th.TextSize.Scale(14.0/16.0), txt) + label.Font.Weight = text.Medium + return label } func Body1(th *Theme, txt string) LabelStyle { @@ -63,6 +79,10 @@ func Caption(th *Theme, txt string) LabelStyle { return Label(th, th.TextSize.Scale(12.0/16.0), txt) } +func Overline(th *Theme, txt string) LabelStyle { + return Label(th, th.TextSize.Scale(10.0/16.0), txt) +} + func Label(th *Theme, size unit.Value, txt string) LabelStyle { return LabelStyle{ Text: txt,