Skip to content

Update Entry and Editor to use Windows 11 styles#3444

Merged
Redth merged 13 commits into
mainfrom
dev/win11-entry-editor
Nov 22, 2021
Merged

Update Entry and Editor to use Windows 11 styles#3444
Redth merged 13 commits into
mainfrom
dev/win11-entry-editor

Conversation

@mattleibow

@mattleibow mattleibow commented Nov 18, 2021

Copy link
Copy Markdown
Member

Description of Change

Just like with #3363, this PR updates the Entry and Editor to be fully Windows 11 styled!

I moved all the properties that affect the TextBox into the extension methods and implemented all the functionality from the outside. This will allow us to reuse basically all the logic with PasswordBox.

The MauiTextBox has been renamed to MauiSearchTextBox and I have created a smaller MauiPasswordTextBox with just the IsPassword and Password. The EntryHandler by default uses the MauiPasswordTextBox, and in a new PR I will make a new PasswordEntry control and use the OS PasswordBox.

Entry & PasswordEntry

On most platforms (ie: iOS and ANdroid) the "password-ness" of the control is just some flag that can be set or unset. On Windows (and potentially other platforms), the password control is an entirely new control and independent. It may even have fewer features.

As a result, we need to split the controls in the cross-platform layer to not only gain the OS features, but also make implementation easier. For platforms that use the same control, this is really easy as they can use all the same extension methods.

Additions made

  • Adds the new Windows 11 styles to Maui entries and editors
  • Renamed MauiTextBox to MauiSearchTextBox for temporary use in SearchBar
  • Removes the old maui text box styles
  • Added a new MauiPasswordTextBox that emulates the old functionality of IsPassword.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)
  • Targets a single property for a single control (or intertwined few properties)
  • Adds the property to the appropriate interface
  • Avoids any changes not essential to the handler property
  • Adds the mapping to the PropertyMapper in the handler
  • Adds the mapping method to the WinUI, Android, iOS, and Standard aspects of the handler
  • Implements the actual property updates (usually in extension methods in the Platform section of Core)
  • Tags ported renderer methods with [PortHandler]
  • Adds an example of the property to the sample project (MainPage)
  • Adds the property to the stub class
  • Implements basic property tests in DeviceTests

Does this PR touch anything that might affect accessibility?

  • Does this PR introduce a new control? (If yes, add an example using SemanticProperties to the SemanticsPage)
  • APIs that modify focusability?
  • APIs that modify any text property on a control?
  • Does this PR modify view nesting or view arrangement in anyway?
  • Is there the smallest possibility that your PR will change accessibility?
  • I'm not sure, please help me

If any of the above checkboxes apply to your PR, then the PR will need to provide testing to demonstrate that accessibility still works.

Pictures

Before After
image image

# Conflicts:
#	src/Controls/samples/Controls.Sample/Pages/Controls/EditorPage.xaml
#	src/Core/src/Platform/Windows/TextBoxExtensions.cs
This is because some controls cannot be inherited - ie: PasswordBox
@mattleibow mattleibow marked this pull request as ready for review November 21, 2021 09:37
@mattleibow mattleibow marked this pull request as draft November 21, 2021 11:49
@mattleibow mattleibow marked this pull request as ready for review November 21, 2021 21:02
@mattleibow mattleibow added this to the 6.0.200-preview.11 milestone Nov 22, 2021
@Redth Redth merged commit 5861a9a into main Nov 22, 2021
@Redth Redth deleted the dev/win11-entry-editor branch November 22, 2021 20:10
@mattleibow mattleibow mentioned this pull request Mar 7, 2022
9 tasks
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jul 11, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 22, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@samhouts samhouts added the fixed-in-6.0.101-preview.11.3 Look for this fix in 6.0.101-preview.11.3! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants