Skip to content

Commit 1248b27

Browse files
update window size for tags (#169)
* update window size for tags * bump vulnerable package * fix issue with pop ups opening too small on macos
1 parent 91edd7b commit 1248b27

5 files changed

Lines changed: 25 additions & 4 deletions

File tree

src/uno/AzureKeyVaultStudio/AzureKeyVaultStudio/AzureKeyVaultStudio.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
8989
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" />
9090
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlcipher" />
91+
<PackageReference Include="Tmds.DBus.Protocol" />
9192
<PackageReference Include="Uno.WinUI.MSAL" />
9293
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" />
9394
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" />

src/uno/AzureKeyVaultStudio/AzureKeyVaultStudio/Presentation/ViewModels/VaultViewModel.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Microsoft.UI.Dispatching;
1616
using Windows.ApplicationModel.DataTransfer;
1717
using Windows.Graphics;
18+
using Windows.Graphics.Display;
1819

1920
namespace AzureKeyVaultStudio.Presentation.ViewModels;
2021

@@ -215,7 +216,12 @@ private void NewSecret()
215216
(vm as IDisposable)?.Dispose();
216217
};
217218

218-
window.AppWindow.Resize(new SizeInt32 { Width = 640, Height = 680 });
219+
220+
if (OperatingSystem.IsMacOS())
221+
ResizeWindowScaled(window.AppWindow, 640, 680);
222+
else
223+
window.AppWindow.Resize(new SizeInt32 { Width = 640, Height = 680 });
224+
219225
window.AppWindow.Show();
220226
}
221227

@@ -778,6 +784,13 @@ private async Task Refresh(CancellationToken token)
778784
await FilterAndLoadVaultValueTypeCommand.ExecuteAsync(token);
779785
}
780786

787+
private static void ResizeWindowScaled(Microsoft.UI.Windowing.AppWindow appWindow, int logicalWidth, int logicalHeight)
788+
{
789+
//https://github.com/unoplatform/uno/issues/22217
790+
var scale = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
791+
appWindow.Resize(new SizeInt32 { Width = (int)(logicalWidth * scale), Height = (int)(logicalHeight * scale) });
792+
}
793+
781794
private void ShowInAppNotification(string subject, string message, InfoBarSeverity notificationType)
782795
{
783796
WeakReferenceMessenger.Default.Send(new SendInAppNotificationMessage(new Notification
@@ -846,7 +859,12 @@ private async Task ShowProperties(KeyVaultItemProperties model)
846859
{
847860
(itemVm as IDisposable)?.Dispose();
848861
};
849-
window.AppWindow.Resize(new SizeInt32 { Width = 620, Height = 580 });
862+
863+
if (OperatingSystem.IsMacOS())
864+
ResizeWindowScaled(window.AppWindow, 620, 680);
865+
else
866+
window.AppWindow.Resize(new SizeInt32 { Width = 640, Height = 680 });
867+
850868
if (Application.Current is App app && app.MainWindow is Window mainWindow)
851869
{
852870
var mainPos = mainWindow.AppWindow.Position;

src/uno/AzureKeyVaultStudio/AzureKeyVaultStudio/Properties/launchSettings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
},
77
"AzureKeyVaultStudio (WinAppSDK Packaged)": {
88
"commandName": "MsixPackage",
9-
"compatibleTargetFramework": "windows"
9+
"compatibleTargetFramework": "windows",
10+
"alwaysReinstallApp": true
1011
},
1112
"AzureKeyVaultStudio (Desktop)": {
1213
"commandName": "Project",

src/uno/AzureKeyVaultStudio/Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<ItemGroup>
99
<PackageVersion Include="FluentAssertions" Version="[7.0.0]" />
1010
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
11+
<PackageVersion Include="Tmds.DBus.Protocol" Version="0.92.0" />
1112
<PackageVersion Include="Uno.UITest.Helpers" Version="1.1.0-dev.70" />
1213
<PackageVersion Include="Azure.Core" Version="1.50.0" />
1314
<PackageVersion Include="Azure.ResourceManager" Version="1.13.2" />

src/uno/global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
// To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information.
33
"msbuild-sdks": {
4-
"Uno.Sdk": "6.6.0-dev.162"
4+
"Uno.Sdk": "6.6.0-dev.180"
55
},
66
"sdk": {
77
"allowPrerelease": false

0 commit comments

Comments
 (0)