diff --git a/App.xaml.cs b/App.xaml.cs index 9956f6a..b03e783 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -1,5 +1,8 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; +#if DEBUG +using LeXtudio.DevFlow.Agent.Uno; +#endif // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. @@ -11,6 +14,9 @@ namespace WinIconFinder; /// public partial class App : Application { +#if DEBUG + private UnoAgentService? _devFlowAgent; +#endif /// /// The main application window. Use App.Window from any class that needs /// the window reference (for dialogs, pickers, interop, etc.). @@ -46,6 +52,10 @@ public App() /// Details about the launch request and process. protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) { +#if DEBUG + _devFlowAgent = new UnoAgentService(); + _devFlowAgent.Start(); +#endif Window = new MainWindow(); DispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread(); Window.Activate(); diff --git a/MainPage.xaml.cs b/MainPage.xaml.cs index 621b451..6bb1183 100644 --- a/MainPage.xaml.cs +++ b/MainPage.xaml.cs @@ -659,9 +659,12 @@ private void MapCanvas_Draw(CanvasControl sender, CanvasDrawEventArgs args) VerticalAlignment = Microsoft.Graphics.Canvas.Text.CanvasVerticalAlignment.Top }; - float lx = Math.Clamp(hx, 60, W - 60); + float textWidth = label.Length * labelFmt.FontSize * 0.62f; + float boxWidth = Math.Clamp(textWidth + 16f, 120f, Math.Max(120f, W - 16f)); + float halfBox = boxWidth / 2f; + float lx = Math.Clamp(hx, halfBox + 4f, W - halfBox - 4f); float ly = Math.Min(hy + halfCell + 3f, H - 18); - ds.FillRoundedRectangle(lx - 60, ly - 1, 120, 16, 3, 3, + ds.FillRoundedRectangle(lx - halfBox, ly - 1, boxWidth, 16, 3, 3, Windows.UI.Color.FromArgb(160, 20, 20, 20)); ds.DrawText(label, lx, ly, Windows.UI.Color.FromArgb(230, 240, 240, 240), labelFmt); diff --git a/Platforms/Desktop/Program.cs b/Platforms/Desktop/Program.cs new file mode 100644 index 0000000..a7bcf48 --- /dev/null +++ b/Platforms/Desktop/Program.cs @@ -0,0 +1,20 @@ +using System.Threading.Tasks; +using Uno.UI.Hosting; + +namespace WinIconFinder; + +internal class Program +{ + [STAThread] + public static async Task Main(string[] args) + { + var host = UnoPlatformHostBuilder.Create() + .App(() => new App()) + .UseWin32() + .UseX11() + .UseMacOS() + .Build(); + + await host.RunAsync(); + } +} diff --git a/WinIconFinder.csproj b/WinIconFinder.csproj index d7ffa6a..23eac03 100644 --- a/WinIconFinder.csproj +++ b/WinIconFinder.csproj @@ -1,19 +1,28 @@ - + WinExe - net10.0-windows10.0.26100.0 + net10.0-desktop;net10.0-windows10.0.19041.0 10.0.17763.0 WinIconFinder app.manifest x86;x64;ARM64 - win-x86;win-x64;win-arm64 - win-$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) win-$(Platform).pubxml + true + enable + enable + SkiaRenderer; + + + + + + + true false + true true - enable - enable + $(DefineConstants);WINDOWS_APP_SDK @@ -60,17 +69,24 @@ Set false in a above to opt out. --> - + - runtime; build; native; contentfiles; analyzers; buildtransitive all + + + + + + + +