Skip to content

Commit

Permalink
Fix default font size issue (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
rookiejava committed Sep 2, 2021
1 parent e8867ee commit c864e95
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
Expand Up @@ -80,6 +80,7 @@ void UpdateFormattedText()
Control.FormattedText = ConvertFormattedText(Element.FormattedText);
}

[PortHandler]
void UpdateText()
{
Control.Text = Element.Text ?? "";
Expand Down
22 changes: 0 additions & 22 deletions src/Controls/src/Core/HandlerImpl/Label/Label.Tizen.cs
Expand Up @@ -16,8 +16,6 @@ public static void RemapForControls()
[nameof(TextType)] = MapTextType,
[nameof(Text)] = MapText,
[nameof(TextDecorations)] = MapTextDecorations,
[nameof(CharacterSpacing)] = MapCharacterSpacing,
[nameof(LineHeight)] = MapLineHeight,
[nameof(ILabel.Font)] = MapFont,
[nameof(TextColor)] = MapTextColor
};
Expand Down Expand Up @@ -45,26 +43,6 @@ public static void MapTextDecorations(LabelHandler handler, Label label)
LabelHandler.MapTextDecorations(handler, label);
}

public static void MapCharacterSpacing(LabelHandler handler, Label label)
{
if (label?.TextType == TextType.Html)
{
return;
}

LabelHandler.MapCharacterSpacing(handler, label);
}

public static void MapLineHeight(LabelHandler handler, Label label)
{
if (label?.TextType == TextType.Html)
{
return;
}

LabelHandler.MapLineHeight(handler, label);
}

public static void MapFont(LabelHandler handler, Label label)
{
if (label?.TextType == TextType.Html)
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Platform/Tizen/EntryExtensions.cs
Expand Up @@ -61,7 +61,7 @@ public static void UpdateClearButtonVisibility(this Entry nativeEntry, IEntry en
public static void UpdateFont(this Entry nativeEntry, ITextStyle textStyle, IFontManager fontManager)
{
nativeEntry.BatchBegin();
nativeEntry.FontSize = textStyle.Font.Size;
nativeEntry.FontSize = textStyle.Font.Size > 0 ? textStyle.Font.Size : 25.ToDPFont();
nativeEntry.FontAttributes = textStyle.Font.GetFontAttributes();
nativeEntry.FontFamily = fontManager.GetFontFamily(textStyle.Font.Family) ?? "";
nativeEntry.BatchCommit();
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Platform/Tizen/LabelExtensions.cs
Expand Up @@ -20,7 +20,7 @@ public static void UpdateTextColor(this Label nativeLabel, ILabel label)
public static void UpdateFont(this Label nativeLabel, ILabel label, IFontManager fontManager)
{
nativeLabel.BatchBegin();
nativeLabel.FontSize = label.Font.Size;
nativeLabel.FontSize = label.Font.Size > 0 ? label.Font.Size : 25.ToDPFont();
nativeLabel.FontAttributes = label.Font.GetFontAttributes();
nativeLabel.FontFamily = fontManager.GetFontFamily(label.Font.Family)??"";
nativeLabel.BatchCommit();
Expand Down

0 comments on commit c864e95

Please sign in to comment.