Skip to content

Commit 1bd43e1

Browse files
authored
Merge pull request #273 from enisn/sizing-improvements
Standard sizes for CheckBox & ReadioButton
2 parents b483e88 + d636122 commit 1bd43e1

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/InputKit.Maui/Shared/Controls/CheckBox.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@ public partial class CheckBox : StatefulStackLayout, IValidatable
5353
MaximumWidthRequest = GlobalSetting.Size,
5454
Scale = 0,
5555
};
56-
internal Label lblOption = new Label { VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start, FontSize = GlobalSetting.FontSize, TextColor = GlobalSetting.TextColor, FontFamily = GlobalSetting.FontFamily, IsVisible = false };
56+
protected internal Label lblOption = new Label
57+
{
58+
VerticalOptions = LayoutOptions.Center,
59+
HorizontalOptions = LayoutOptions.Start,
60+
FontSize = GlobalSetting.FontSize,
61+
TextColor = GlobalSetting.TextColor,
62+
FontFamily = GlobalSetting.FontFamily,
63+
IsVisible = false
64+
};
5765
private CheckType _type = CheckType.Box;
5866
private bool _isEnabled;
5967
#endregion

src/InputKit.Maui/Shared/Controls/RadioButton.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public class RadioButton : StatefulStackLayout
2222
Color = InputKitOptions.GetAccentColor(),
2323
BorderColor = Colors.Black,
2424
TextColor = (Color)Label.TextColorProperty.DefaultValue,
25-
Size = Device.GetNamedSize(Device.RuntimePlatform == Device.iOS ? NamedSize.Large : NamedSize.Medium, typeof(Label)) * 1.2,
25+
Size = 25,
2626
CornerRadius = -1,
27-
FontSize = Device.GetNamedSize(Device.RuntimePlatform == Device.iOS ? NamedSize.Medium : NamedSize.Small, typeof(Label)),
27+
FontSize = 14,
2828
LabelPosition = LabelPosition.After
2929
};
3030
#endregion
@@ -76,8 +76,6 @@ public RadioButton()
7676
InitVisualStates();
7777

7878
Orientation = StackOrientation.Horizontal;
79-
if (Device.RuntimePlatform != Device.iOS)
80-
lblText.FontSize = lblText.FontSize *= 1.5;
8179

8280
ApplyIsCheckedAction = ApplyIsChecked;
8381
ApplyIsPressedAction = ApplyIsPressed;

0 commit comments

Comments
 (0)