Skip to content

Commit

Permalink
Merge pull request #35 from kevkov/main
Browse files Browse the repository at this point in the history
Add support for float32 properties which fixes corner radius for Frame
  • Loading branch information
TimLariviere authored Mar 19, 2023
2 parents 1c6ca19 + b4a807b commit 0514a6b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

_No unreleased changes_
### Fixed

- Add support for float32 properties which fixes corner radius for Frame (https://github.com/fabulous-dev/Fabulous.XamarinForms/pull/35)

## [2.2.0] - 2023-01-24

Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Fabulous" Version="2.2.1" />
<PackageVersion Include="Fabulous" Version="2.3.0" />
<PackageVersion Include="FsCheck.NUnit" Version="2.16.4" />
<PackageVersion Include="FSharp.Android.Resource" Version="1.0.4" />
<PackageVersion Include="FSharp.Core" Version="7.0.0" />
Expand Down
4 changes: 4 additions & 0 deletions src/Fabulous.XamarinForms/Attributes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ module Attributes =
let inline defineBindableFloat (bindableProperty: BindableProperty) =
defineSmallBindable bindableProperty SmallScalars.Float.decode

/// Define a float32 attribute for a BindableProperty and encode it as a small scalar (8 bytes)
let inline defineBindableFloat32 (bindableProperty: BindableProperty) =
defineSmallBindable bindableProperty SmallScalars.Float32.decode

/// Define a boolean attribute for a BindableProperty and encode it as a small scalar (8 bytes)
let inline defineBindableBool (bindableProperty: BindableProperty) =
defineSmallBindable bindableProperty SmallScalars.Bool.decode
Expand Down
2 changes: 1 addition & 1 deletion src/Fabulous.XamarinForms/Fabulous.XamarinForms.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
-->
<PackageReference Include="FSharp.Core" VersionOverride="7.0.0" PrivateAssets="All" />
<PackageReference Include="Xamarin.Forms" VersionOverride="5.0.0.1874" />
<PackageReference Include="Fabulous" VersionOverride="[2.2.0, 2.3.0)" />
<PackageReference Include="Fabulous" VersionOverride="[2.3.0, 2.4.0)" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/Fabulous.XamarinForms/Views/Layouts/Frame.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Frame =

let BorderColor = Attributes.defineBindableAppThemeColor Frame.BorderColorProperty

let CornerRadius = Attributes.defineBindableFloat Frame.CornerRadiusProperty
let CornerRadius = Attributes.defineBindableFloat32 Frame.CornerRadiusProperty

let HasShadow = Attributes.defineBindableBool Frame.HasShadowProperty

Expand All @@ -36,7 +36,7 @@ type FrameModifiers =
/// <param name="value">The corner radius of the frame</param>
[<Extension>]
static member inline cornerRadius(this: WidgetBuilder<'msg, #IFrame>, value: float) =
this.AddScalar(Frame.CornerRadius.WithValue(value))
this.AddScalar(Frame.CornerRadius.WithValue(float32 value))

// <summary>Set the shadow of the frame</summary>
// <param name="value">Whether the frame has a shadow</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"type": "parameter",
"dataType": "string",
"replaces": "FabulousPkgVersion",
"defaultValue": "2.2.0"
"defaultValue": "2.3.0"
},
"FabulousXFPkgVersion": {
"type": "parameter",
Expand Down

0 comments on commit 0514a6b

Please sign in to comment.