Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Controls/src/Core/TitleBar/TitleBar.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Graphics;

Expand Down Expand Up @@ -348,7 +349,9 @@ static View BuildDefaultTemplate()
var contentGrid = new Grid()
{
#if MACCATALYST
Margin = new Thickness(80, 0, 0, 0),
Margin = OperatingSystem.IsMacCatalystVersionAtLeast(26)
? new Thickness(90, 0, 0, 0)
: new Thickness(80, 0, 0, 0),
#endif
HorizontalOptions = LayoutOptions.Fill,
ColumnDefinitions =
Expand Down
46 changes: 46 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue33136.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 33136, "TitleBar Content Overlapping with Traffic Light Buttons on Latest macOS Version", PlatformAffected.macOS)]
public class Issue33136 : ContentPage
{
public Issue33136()
{
// Create TitleBar
var titleBar = new TitleBar
{
Title = "Maui App",
Subtitle = "Hello, World!",
ForegroundColor = Colors.Red,
HeightRequest = 48
};

titleBar.LeadingContent = new Image { Source = "dotnet_bot.png", HeightRequest = 24 };

// Set the TitleBar on the current Window when this page appears
this.Loaded += (sender, e) =>
{
if (Window != null)
{
Window.TitleBar = titleBar;
}
};

// Create the page content with a Label
Content = new VerticalStackLayout
{
Spacing = 25,
Padding = new Thickness(30),
VerticalOptions = LayoutOptions.Center,
Children =
{
new Label
{
Text = "TitleBar should be aligned properly",
AutomationId = "TitleBarAlignmentLabel",
FontSize = 32,
HorizontalOptions = LayoutOptions.Center
},
}
};
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_IOS // TitleBar is only applicable for Windows and macOS
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue33136 : _IssuesUITest
{
public Issue33136(TestDevice device) : base(device) { }

public override string Issue => "TitleBar Content Overlapping with Traffic Light Buttons on Latest macOS Version";

[Test]
[Category(UITestCategories.Window)]
public void VerifyTitleBarAlignment()
{
App.WaitForElement("TitleBarAlignmentLabel");
VerifyScreenshot(includeTitleBar: true);
}
}
#endif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading