changed.调整融合桌面组库的相关圆角

This commit is contained in:
lincube
2026-05-25 09:32:58 +08:00
parent 69bcf2c6eb
commit 01cf32a610
5 changed files with 59 additions and 3 deletions

View File

@@ -4,7 +4,9 @@ using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Input;
using Avalonia.Interactivity;
using LanMountainDesktop.Appearance;
using LanMountainDesktop.Services;
using LanMountainDesktop.Settings.Core;
namespace LanMountainDesktop.Views;
@@ -15,6 +17,7 @@ public partial class FusedDesktopComponentLibraryWindow : Window
public FusedDesktopComponentLibraryWindow()
{
InitializeComponent();
ApplyFluentCornerRadius();
LibraryControl.AddComponentRequested += OnAddComponentRequested;
KeyDown += OnWindowKeyDown;
@@ -23,6 +26,25 @@ public partial class FusedDesktopComponentLibraryWindow : Window
mainWindow?.RegisterFusedLibraryWindow(this);
}
private void ApplyFluentCornerRadius()
{
if (RootGrid is null)
{
return;
}
var tokens = AppearanceCornerRadiusTokenFactory.Create(
GlobalAppearanceSettings.CornerRadiusStyleFluent);
RootGrid.Resources["DesignCornerRadiusMicro"] = tokens.Micro;
RootGrid.Resources["DesignCornerRadiusXs"] = tokens.Xs;
RootGrid.Resources["DesignCornerRadiusSm"] = tokens.Sm;
RootGrid.Resources["DesignCornerRadiusMd"] = tokens.Md;
RootGrid.Resources["DesignCornerRadiusLg"] = tokens.Lg;
RootGrid.Resources["DesignCornerRadiusXl"] = tokens.Xl;
RootGrid.Resources["DesignCornerRadiusIsland"] = tokens.Island;
RootGrid.Resources["DesignCornerRadiusComponent"] = tokens.Component;
}
public bool PreserveEditModeOnClose { get; private set; }
public void SetOverlayWindow(TransparentOverlayWindow overlayWindow)