Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows FlowDirection #4936

Merged
merged 19 commits into from Mar 1, 2022
Merged

Windows FlowDirection #4936

merged 19 commits into from Mar 1, 2022

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Feb 25, 2022

Description of Change

Move the static checks for FlowDirection into Essentials and then shift the MAUI implementation over to using FlowDirection.

Add FlowDirection to IWindow which let's users indicate the flow direction of the Window. This is mainly relevant on desktop where the close, open, and minimize buttons have to be modified so that they are RTL.

If the user sets the FlowDirection on the root page to RTL that will percolate up to the Window

Fixes #3943

Additions made

  • Adds
public interface IWindow : ITitledElement
{
	FlowDirection FlowDirection { get; }
namespace Microsoft.Maui.Essentials
{
	public interface IAppInfo
	{
		LayoutDirection RequestedLayoutDirection { get; }
namespace Microsoft.Maui.Essentials
{
	public enum LayoutDirection
	{
		Unknown,
		LeftToRight,
		RightToLeft
	}
}

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.

@PureWeen PureWeen linked an issue Feb 25, 2022 that may be closed by this pull request
@mattleibow mattleibow changed the title Flowdirection window Windows FlowDirection Feb 28, 2022
@mattleibow mattleibow added the area/a11y Relates to accessibility label Feb 28, 2022
@mattleibow mattleibow added this to the 6.0.300-preview.14 milestone Feb 28, 2022
@PureWeen PureWeen requested a review from mattleibow March 1, 2022 19:05
@PureWeen PureWeen marked this pull request as ready for review March 1, 2022 19:08
Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking pretty neat tbh.

@PureWeen PureWeen requested a review from mattleibow March 1, 2022 20:31
@PureWeen PureWeen enabled auto-merge (squash) March 1, 2022 20:31
@PureWeen PureWeen merged commit 439b52c into main Mar 1, 2022
@PureWeen PureWeen deleted the flowdirection_window branch March 1, 2022 23:11
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/a11y Relates to accessibility
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Device.FlowDirection/SetFlowDirection() - move to window
2 participants