From eef463066691a1f60c40f79b1e668a92135907ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9=20LARIVIERE?= Date: Wed, 1 Feb 2023 09:41:07 +0100 Subject: [PATCH] Format code --- samples/Gallery/Samples/Label.fs | 9 +++------ src/Fabulous.Maui/Core/Views/Controls/Label.fs | 11 +++++++---- .../Core/Views/Controls/Partials/_TextAlignment.fs | 4 ++-- .../Core/Views/Controls/Partials/_TextStyle.fs | 2 +- src/Fabulous.Maui/Core/Views/Layouts/Border.fs | 10 +++------- .../Core/Views/Layouts/Partials/_BorderStroke.fs | 1 - .../Core/Views/Layouts/Partials/_Stroke.fs | 10 +++++----- 7 files changed, 21 insertions(+), 26 deletions(-) diff --git a/samples/Gallery/Samples/Label.fs b/samples/Gallery/Samples/Label.fs index f86d6df..58404f1 100644 --- a/samples/Gallery/Samples/Label.fs +++ b/samples/Gallery/Samples/Label.fs @@ -20,14 +20,11 @@ module Label = Border( VStack(8.) { - Label("Custom font regular") - .font(Font.OfSize(Fonts.SourceSansProRegular, 20.)) + Label("Custom font regular").font(Font.OfSize(Fonts.SourceSansProRegular, 20.)) - Label("Custom font bold") - .font(Font.OfSize(Fonts.SourceSansProBold, 20.)) + Label("Custom font bold").font(Font.OfSize(Fonts.SourceSansProBold, 20.)) - Label("Custom font italic") - .font(Font.OfSize(Fonts.SourceSansProItalic, 20.)) + Label("Custom font italic").font(Font.OfSize(Fonts.SourceSansProItalic, 20.)) Label("Custom font italic bold") .font(Font.OfSize(Fonts.SourceSansProBoldItalic, 20.)) diff --git a/src/Fabulous.Maui/Core/Views/Controls/Label.fs b/src/Fabulous.Maui/Core/Views/Controls/Label.fs index 490a059..6948ed8 100644 --- a/src/Fabulous.Maui/Core/Views/Controls/Label.fs +++ b/src/Fabulous.Maui/Core/Views/Controls/Label.fs @@ -10,18 +10,21 @@ open Microsoft.Maui.Handlers.Defaults module Label = let WidgetKey = Widgets.register() - let LineHeight = Attributes.defineMauiProperty "LineHeight" LabelDefaults.LineHeight (fun (target: IFabLabel) -> target.SetLineHeight) + let LineHeight = + Attributes.defineMauiProperty "LineHeight" LabelDefaults.LineHeight (fun (target: IFabLabel) -> target.SetLineHeight) - let TextDecorations = Attributes.defineMauiProperty "TextDecorations" LabelDefaults.TextDecorations (fun (target: IFabLabel) -> target.SetTextDecorations) + let TextDecorations = + Attributes.defineMauiProperty "TextDecorations" LabelDefaults.TextDecorations (fun (target: IFabLabel) -> target.SetTextDecorations) [] module LabelBuilders = type Fabulous.Maui.View with + static member inline Label<'msg>(text: string) = WidgetBuilder<'msg, IFabLabel>(Label.WidgetKey, Text.Text.WithValue(text)) - + [] type LabelModifiers = [] static member inline textDecorations(this: WidgetBuilder<'msg, #IFabLabel>, value: TextDecorations) = - this.AddScalar(Label.TextDecorations.WithValue(value)) \ No newline at end of file + this.AddScalar(Label.TextDecorations.WithValue(value)) diff --git a/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextAlignment.fs b/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextAlignment.fs index c1c4b93..ce360b4 100644 --- a/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextAlignment.fs +++ b/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextAlignment.fs @@ -34,7 +34,7 @@ type TextAlignmentExtraModifiers = [] static member inline centerTextVertical(this: WidgetBuilder<'msg, #IFabTextAlignment>) = this.verticalTextAlignment(TextAlignment.Center) - + [] static member inline alignTextStartHorizontal(this: WidgetBuilder<'msg, #IFabTextAlignment>) = this.horizontalTextAlignment(TextAlignment.Start) @@ -42,7 +42,7 @@ type TextAlignmentExtraModifiers = [] static member inline alignTextStartVertical(this: WidgetBuilder<'msg, #IFabTextAlignment>) = this.verticalTextAlignment(TextAlignment.Start) - + [] static member inline alignTextEndHorizontal(this: WidgetBuilder<'msg, #IFabTextAlignment>) = this.horizontalTextAlignment(TextAlignment.End) diff --git a/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextStyle.fs b/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextStyle.fs index b7dbf00..d4f58a6 100644 --- a/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextStyle.fs +++ b/src/Fabulous.Maui/Core/Views/Controls/Partials/_TextStyle.fs @@ -8,7 +8,7 @@ open Fabulous module TextStyle = let CharacterSpacing = Attributes.defineMauiProperty "CharacterSpacing" TextStyleDefaults.CharacterSpacing (fun (target: IFabTextStyle) -> target.SetCharacterSpacing) - + let Font = Attributes.defineMauiProperty' "Font" TextStyleDefaults.CreateDefaultFont (fun (target: IFabTextStyle) -> target.SetFont) diff --git a/src/Fabulous.Maui/Core/Views/Layouts/Border.fs b/src/Fabulous.Maui/Core/Views/Layouts/Border.fs index b3551f7..98a7ed9 100644 --- a/src/Fabulous.Maui/Core/Views/Layouts/Border.fs +++ b/src/Fabulous.Maui/Core/Views/Layouts/Border.fs @@ -7,17 +7,13 @@ open Microsoft.Maui module Border = let WidgetKey = Widgets.register() - + [] module BorderBuilders = type Fabulous.Maui.View with + static member inline Border(content: WidgetBuilder<'msg, #IView>) = WidgetBuilder<'msg, IFabBorderView>( Border.WidgetKey, - AttributesBundle( - StackList.empty(), - ValueSome [| ContentView.PresentedContent.WithValue(content.Compile()) |], - ValueNone - ) + AttributesBundle(StackList.empty(), ValueSome [| ContentView.PresentedContent.WithValue(content.Compile()) |], ValueNone) ) - diff --git a/src/Fabulous.Maui/Core/Views/Layouts/Partials/_BorderStroke.fs b/src/Fabulous.Maui/Core/Views/Layouts/Partials/_BorderStroke.fs index 18c5a35..86628a7 100644 --- a/src/Fabulous.Maui/Core/Views/Layouts/Partials/_BorderStroke.fs +++ b/src/Fabulous.Maui/Core/Views/Layouts/Partials/_BorderStroke.fs @@ -5,4 +5,3 @@ open Microsoft.Maui.Handlers.Defaults module BorderStroke = let Shape = Attributes.defineMauiProperty "Shape" BorderStrokeDefaults.Shape (fun (target: IFabBorderStroke) -> target.SetShape) - diff --git a/src/Fabulous.Maui/Core/Views/Layouts/Partials/_Stroke.fs b/src/Fabulous.Maui/Core/Views/Layouts/Partials/_Stroke.fs index dde6d14..fec0093 100644 --- a/src/Fabulous.Maui/Core/Views/Layouts/Partials/_Stroke.fs +++ b/src/Fabulous.Maui/Core/Views/Layouts/Partials/_Stroke.fs @@ -11,15 +11,15 @@ module Stroke = let StrokeLineCap = Attributes.defineMauiProperty "StrokeLineCap" StrokeDefaults.StrokeLineCap (fun (target: IFabStroke) -> target.SetStrokeLineCap) - + let StrokeLineJoin = Attributes.defineMauiProperty "StrokeLineJoin" StrokeDefaults.StrokeLineJoin (fun (target: IFabStroke) -> target.SetStrokeLineJoin) - + let StrokeDashPattern = Attributes.defineMauiProperty "StrokeDashPattern" StrokeDefaults.StrokeDashPattern (fun (target: IFabStroke) -> target.SetStrokeDashPattern) - + let StrokeDashOffset = Attributes.defineMauiProperty "StrokeDashOffset" StrokeDefaults.StrokeDashOffset (fun (target: IFabStroke) -> target.SetStrokeDashOffset) - + let StrokeMiterLimit = - Attributes.defineMauiProperty "StrokeMiterLimit" StrokeDefaults.StrokeMiterLimit (fun (target: IFabStroke) -> target.SetStrokeMiterLimit) \ No newline at end of file + Attributes.defineMauiProperty "StrokeMiterLimit" StrokeDefaults.StrokeMiterLimit (fun (target: IFabStroke) -> target.SetStrokeMiterLimit)