From ec419a2306a0782cbbfabb65000fdde707b4a3fb Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sun, 3 Jul 2016 00:27:10 -0400 Subject: [PATCH] padding option for form entry cell. increased padding on login and register forms. reduced large font size on iOS --- src/App/Controls/FormEntryCell.cs | 5 +++-- src/App/Pages/HomePage.cs | 6 ++---- src/App/Pages/LoginPage.cs | 7 +++++-- src/App/Pages/RegisterPage.cs | 17 ++++++++++++----- src/iOS/Controls/CustomButtonRenderer.cs | 2 +- src/iOS/Controls/CustomLabelRenderer.cs | 2 +- 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/App/Controls/FormEntryCell.cs b/src/App/Controls/FormEntryCell.cs index fd6bb8df9..c656d3b16 100644 --- a/src/App/Controls/FormEntryCell.cs +++ b/src/App/Controls/FormEntryCell.cs @@ -11,7 +11,8 @@ namespace Bit.App.Controls bool IsPassword = false, VisualElement nextElement = null, bool useLabelAsPlaceholder = false, - string imageSource = null) + string imageSource = null, + Thickness? containerPadding = null) { if(!useLabelAsPlaceholder) { @@ -48,7 +49,7 @@ namespace Bit.App.Controls var imageStackLayout = new StackLayout { - Padding = new Thickness(15, 10), + Padding = containerPadding ?? new Thickness(15, 10), Orientation = StackOrientation.Horizontal, Spacing = 10, HorizontalOptions = LayoutOptions.FillAndExpand, diff --git a/src/App/Pages/HomePage.cs b/src/App/Pages/HomePage.cs index 728ae0dff..1753d7db8 100644 --- a/src/App/Pages/HomePage.cs +++ b/src/App/Pages/HomePage.cs @@ -51,8 +51,7 @@ namespace Bit.App.Pages Command = new Command(async () => await RegisterAsync()), VerticalOptions = LayoutOptions.End, HorizontalOptions = LayoutOptions.Fill, - Style = (Style)Application.Current.Resources["btn-primary"], - FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)) + Style = (Style)Application.Current.Resources["btn-primary"] }; var loginButton = new Button @@ -61,8 +60,7 @@ namespace Bit.App.Pages Command = new Command(async () => await LoginAsync()), VerticalOptions = LayoutOptions.End, Style = (Style)Application.Current.Resources["btn-primaryAccent"], - HorizontalOptions = LayoutOptions.Fill, - FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)) + HorizontalOptions = LayoutOptions.Fill }; var buttonStackLayout = new StackLayout diff --git a/src/App/Pages/LoginPage.cs b/src/App/Pages/LoginPage.cs index 2ebd88b36..41e0cb315 100644 --- a/src/App/Pages/LoginPage.cs +++ b/src/App/Pages/LoginPage.cs @@ -38,10 +38,13 @@ namespace Bit.App.Pages private void Init() { + var padding = new Thickness(15, 20); + PasswordCell = new FormEntryCell(AppResources.MasterPassword, IsPassword: true, - useLabelAsPlaceholder: true, imageSource: "lock"); + useLabelAsPlaceholder: true, imageSource: "lock", containerPadding: padding); EmailCell = new FormEntryCell(AppResources.EmailAddress, nextElement: PasswordCell.Entry, - entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope"); + entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope", + containerPadding: padding); PasswordCell.Entry.ReturnType = Enums.ReturnType.Go; PasswordCell.Entry.Completed += Entry_Completed; diff --git a/src/App/Pages/RegisterPage.cs b/src/App/Pages/RegisterPage.cs index 4be1bdab1..26e73e471 100644 --- a/src/App/Pages/RegisterPage.cs +++ b/src/App/Pages/RegisterPage.cs @@ -34,11 +34,18 @@ namespace Bit.App.Pages private void Init() { - PasswordHintCell = new FormEntryCell("Master Password Hint (optional)", useLabelAsPlaceholder: true, imageSource: "lightbulb-o"); - ConfirmPasswordCell = new FormEntryCell("Re-type Master Password", IsPassword: true, nextElement: PasswordHintCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock"); - PasswordCell = new FormEntryCell(AppResources.MasterPassword, IsPassword: true, nextElement: ConfirmPasswordCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock"); - NameCell = new FormEntryCell("Your Name", nextElement: PasswordCell.Entry, useLabelAsPlaceholder: true, imageSource: "user"); - EmailCell = new FormEntryCell(AppResources.EmailAddress, nextElement: NameCell.Entry, entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope"); + var padding = new Thickness(15, 20); + + PasswordHintCell = new FormEntryCell("Master Password Hint (optional)", useLabelAsPlaceholder: true, + imageSource: "lightbulb-o", containerPadding: padding); + ConfirmPasswordCell = new FormEntryCell("Re-type Master Password", IsPassword: true, + nextElement: PasswordHintCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock", containerPadding: padding); + PasswordCell = new FormEntryCell(AppResources.MasterPassword, IsPassword: true, + nextElement: ConfirmPasswordCell.Entry, useLabelAsPlaceholder: true, imageSource: "lock", containerPadding: padding); + NameCell = new FormEntryCell("Your Name", nextElement: PasswordCell.Entry, + useLabelAsPlaceholder: true, imageSource: "user", containerPadding: padding); + EmailCell = new FormEntryCell(AppResources.EmailAddress, nextElement: NameCell.Entry, + entryKeyboard: Keyboard.Email, useLabelAsPlaceholder: true, imageSource: "envelope", containerPadding: padding); PasswordHintCell.Entry.ReturnType = Enums.ReturnType.Done; PasswordHintCell.Entry.Completed += Entry_Completed; diff --git a/src/iOS/Controls/CustomButtonRenderer.cs b/src/iOS/Controls/CustomButtonRenderer.cs index ce71a878c..c3529d8fd 100644 --- a/src/iOS/Controls/CustomButtonRenderer.cs +++ b/src/iOS/Controls/CustomButtonRenderer.cs @@ -22,7 +22,7 @@ namespace Bit.iOS.Controls var size = view.FontSize; if(size == Device.GetNamedSize(NamedSize.Large, typeof(Button))) { - pointSize *= 1.4f; + pointSize *= 1.3f; } else if(size == Device.GetNamedSize(NamedSize.Small, typeof(Button))) { diff --git a/src/iOS/Controls/CustomLabelRenderer.cs b/src/iOS/Controls/CustomLabelRenderer.cs index 8c99ecc3a..7781b454e 100644 --- a/src/iOS/Controls/CustomLabelRenderer.cs +++ b/src/iOS/Controls/CustomLabelRenderer.cs @@ -22,7 +22,7 @@ namespace Bit.iOS.Controls var size = view.FontSize; if(size == Device.GetNamedSize(NamedSize.Large, typeof(Label))) { - pointSize *= 1.4f; + pointSize *= 1.3f; } else if(size == Device.GetNamedSize(NamedSize.Small, typeof(Label))) {