Skip to content

Commit b483e88

Browse files
authored
Merge pull request #272 from enisn/windows-visual-improvements
Remove Plainer and AdvancedEntry improvements
2 parents 4f405a8 + 530f62b commit b483e88

File tree

5 files changed

+16
-27
lines changed

5 files changed

+16
-27
lines changed

sandbox/SandboxMAUI/Pages/AdvancedEntryPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<StackLayout Padding="30" MaximumWidthRequest="400">
1414
<Label Text="You can see FormView Below:" />
1515
<BoxView HeightRequest="1" Color="LightGray" />
16-
<input:FormView IsValidated="{Binding IsValidated}">
16+
<input:FormView IsValidated="{Binding IsValidated}" Spacing="15">
1717

1818
<input:AdvancedEntry
1919
Title="Place your email below:"

src/InputKit.Maui/Handlers/InputKitHandlersCollectionExtension.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using InputKit.Shared.Layouts;
2-
using Plainer.Maui;
32

43
namespace InputKit.Handlers
54
{
@@ -8,7 +7,6 @@ public static class InputKitHandlersCollectionExtension
87
public static IMauiHandlersCollection AddInputKitHandlers(this IMauiHandlersCollection collection)
98
{
109
return collection
11-
.AddPlainer()
1210
.AddHandler(typeof(Shared.Controls.IconView), typeof(InputKit.Handlers.IconView.IconViewHandler))
1311
.AddHandler(typeof(StatefulStackLayout), typeof(InputKit.Handlers.StatefulStackLayoutHandler));
1412
}

src/InputKit.Maui/InputKit.Maui.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,4 @@
4545
<ItemGroup>
4646
<None Include="icon512.png" Pack="true" PackagePath="" />
4747
</ItemGroup>
48-
49-
<ItemGroup>
50-
<PackageReference Include="Plainer.Maui" Version="1.4.0" />
51-
</ItemGroup>
5248
</Project>

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using InputKit.Shared.Abstraction;
22
using InputKit.Shared.Configuration;
3-
using Plainer.Maui.Controls;
43
using System.Text.RegularExpressions;
54
using System.Windows.Input;
65

@@ -43,7 +42,7 @@ public partial class AdvancedEntry : StackLayout, IValidatable
4342
readonly Label lblAnnotation = new Label { Margin = new Thickness(6, 0, 0, 0), IsVisible = false, FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)), Opacity = 0.8, TextColor = GlobalSetting.TextColor, FontFamily = GlobalSetting.FontFamily };
4443
readonly Frame frmBackground = new Frame { BackgroundColor = GlobalSetting.BackgroundColor, CornerRadius = (float)GlobalSetting.CornerRadius, BorderColor = GlobalSetting.BorderColor, Padding = new Thickness(5, 0, 0, 0), HasShadow = false };
4544
readonly Image imgWarning = new Image { Margin = 10, HorizontalOptions = LayoutOptions.End, VerticalOptions = LayoutOptions.Center, InputTransparent = true, Source = "alert.png" };
46-
readonly IconView imgIcon = new IconView { InputTransparent = true, IsVisible = false, Margin = new Thickness(5, 10, 10, 10), VerticalOptions = LayoutOptions.CenterAndExpand, HeightRequest = 30, FillColor = GlobalSetting.Color };
45+
readonly IconView imgIcon = new IconView { InputTransparent = true, Margin = 5, IsVisible = false, VerticalOptions = LayoutOptions.CenterAndExpand, HeightRequest = 30, FillColor = GlobalSetting.Color };
4746
readonly Entry txtInput;
4847
#endregion
4948

@@ -57,23 +56,20 @@ public AdvancedEntry()
5756
Children.Add(lblTitle);
5857
Children.Add(frmBackground);
5958

59+
var inputGrid = new Grid();
60+
inputGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = 30 });
61+
inputGrid.ColumnDefinitions.Add(new ColumnDefinition(GridLength.Star));
62+
inputGrid.Add(imgIcon, column: 0);
63+
inputGrid.Add(txtInput, column: 1);
64+
6065
ApplyValidationPosition(GlobalSetting.LabelPosition);
6166

6267
frmBackground.Content = new Grid
6368
{
6469
BackgroundColor = Colors.Transparent,
6570
Children =
6671
{
67-
new StackLayout
68-
{
69-
Orientation = StackOrientation.Horizontal,
70-
BackgroundColor = Colors.Transparent,
71-
Children =
72-
{
73-
imgIcon,
74-
txtInput
75-
}
76-
},
72+
inputGrid,
7773
imgWarning
7874
}
7975
};
@@ -601,7 +597,7 @@ private void ApplyValidationPosition(LabelPosition position)
601597

602598
private protected virtual Entry GetInputEntry()
603599
{
604-
return new EntryView
600+
return new Entry
605601
{
606602
TextColor = GlobalSetting.TextColor,
607603
PlaceholderColor = Colors.LightGray,

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Microsoft.Maui;
66
using Microsoft.Maui.Controls;
77
using Microsoft.Maui.Graphics;
8-
using Plainer.Maui.Controls;
98
using System;
109
using System.Collections;
1110
using System.Collections.Specialized;
@@ -37,7 +36,7 @@ public partial class Dropdown : StatefulStackLayout, IValidatable
3736
protected Label lblTitle = new Label { Margin = new Thickness(6, 0, 0, 0), IsVisible = false, TextColor = GlobalSetting.TextColor, LineBreakMode = LineBreakMode.TailTruncation, FontFamily = GlobalSetting.FontFamily };
3837
protected Label lblAnnotation = new Label { Margin = new Thickness(6, 0, 0, 0), IsVisible = false, FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)), Opacity = 0.8, TextColor = GlobalSetting.TextColor, FontFamily = GlobalSetting.FontFamily };
3938
protected Frame frmBackground = new Frame { Padding = 0, BackgroundColor = GlobalSetting.BackgroundColor, HasShadow = false, CornerRadius = (int)GlobalSetting.CornerRadius, BorderColor = GlobalSetting.BorderColor };
40-
protected Entry txtInput = new EntryView { TextColor = Colors.Blue, PlaceholderColor = Colors.Blue, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Center, FontFamily = GlobalSetting.FontFamily, IsEnabled = false };
39+
protected Entry txtInput = new Entry { TextColor = Colors.Blue, PlaceholderColor = Colors.Blue, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Center, FontFamily = GlobalSetting.FontFamily, IsEnabled = false };
4140

4241
private protected PopupMenu pMenu = new PopupMenu();
4342
private string _placeholder;
@@ -52,11 +51,11 @@ public Dropdown()
5251
{
5352
Orientation = StackOrientation.Horizontal,
5453
Children =
55-
{
56-
imgIcon,
57-
txtInput,
58-
imgArrow
59-
}
54+
{
55+
imgIcon,
56+
txtInput,
57+
imgArrow
58+
}
6059
};
6160
Children.Add(frmBackground);
6261
frmBackground.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(Menu_Requested), CommandParameter = frmBackground });

0 commit comments

Comments
 (0)