This commit is contained in:
lincube
2026-03-05 14:34:33 +08:00
parent d182925b58
commit f3e7f88a39
15 changed files with 205 additions and 23 deletions

View File

@@ -11,6 +11,7 @@ using Avalonia.Media;
using Avalonia.Threading;
using LanMountainDesktop.Models;
using LanMountainDesktop.Services;
using LanMountainDesktop.Theme;
namespace LanMountainDesktop.Views.Components;
@@ -19,7 +20,7 @@ public partial class ExtendedWeatherWidget : UserControl, IDesktopComponentWidge
private static readonly IWeatherInfoService DefaultWeatherInfoService = new XiaomiWeatherService();
private readonly DispatcherTimer _refreshTimer = new() { Interval = TimeSpan.FromMinutes(12) };
private readonly DispatcherTimer _animationTimer = new() { Interval = TimeSpan.FromMilliseconds(48) };
private readonly DispatcherTimer _animationTimer = new() { Interval = UiMotionTokens.WeatherAnimationFrameInterval };
private readonly ScaleTransform _backgroundMotionScaleTransform = new(1, 1);
private readonly TranslateTransform _backgroundMotionTranslateTransform = new();
private readonly AppSettingsService _settingsService = new();

View File

@@ -13,6 +13,7 @@ using Avalonia.Platform;
using Avalonia.Threading;
using LanMountainDesktop.Models;
using LanMountainDesktop.Services;
using LanMountainDesktop.Theme;
namespace LanMountainDesktop.Views.Components;
@@ -89,7 +90,7 @@ public partial class HourlyWeatherWidget : UserControl, IDesktopComponentWidget,
private readonly DispatcherTimer _backgroundAnimationTimer = new()
{
Interval = TimeSpan.FromMilliseconds(48)
Interval = UiMotionTokens.WeatherAnimationFrameInterval
};
private readonly AppSettingsService _settingsService = new();

View File

@@ -11,6 +11,7 @@ using Avalonia.Media;
using Avalonia.Threading;
using LanMountainDesktop.Models;
using LanMountainDesktop.Services;
using LanMountainDesktop.Theme;
namespace LanMountainDesktop.Views.Components;
@@ -87,7 +88,7 @@ public partial class MultiDayWeatherWidget : UserControl, IDesktopComponentWidge
private readonly DispatcherTimer _backgroundAnimationTimer = new()
{
Interval = TimeSpan.FromMilliseconds(48)
Interval = UiMotionTokens.WeatherAnimationFrameInterval
};
private readonly AppSettingsService _settingsService = new();

View File

@@ -86,7 +86,7 @@
Opacity="0.62"
Stretch="UniformToFill">
<Image.Effect>
<BlurEffect Radius="42" />
<BlurEffect Radius="{DynamicResource MotionBackdropBlurRadiusStrong}" />
</Image.Effect>
</Image>
</Border>

View File

@@ -13,6 +13,7 @@ using Avalonia.Platform;
using Avalonia.Threading;
using LanMountainDesktop.Models;
using LanMountainDesktop.Services;
using LanMountainDesktop.Theme;
namespace LanMountainDesktop.Views.Components;
@@ -83,7 +84,7 @@ public partial class WeatherWidget : UserControl, IDesktopComponentWidget, IDesk
private readonly DispatcherTimer _backgroundAnimationTimer = new()
{
Interval = TimeSpan.FromMilliseconds(48)
Interval = UiMotionTokens.WeatherAnimationFrameInterval
};
private readonly AppSettingsService _settingsService = new();

View File

@@ -14,6 +14,7 @@ using FluentIcons.Avalonia;
using FluentIcons.Common;
using LanMountainDesktop.ComponentSystem;
using LanMountainDesktop.Models;
using LanMountainDesktop.Theme;
using LanMountainDesktop.Views.Components;
namespace LanMountainDesktop.Views;
@@ -408,7 +409,7 @@ public partial class MainWindow
{
OpenSettingsPage();
}
}, TimeSpan.FromMilliseconds(200));
}, UiMotionTokens.Slow);
}
private void InitializeDesktopComponentDragHandlers()
@@ -872,7 +873,7 @@ public partial class MainWindow
{
ComponentSettingsContentHost.Content = null;
}
}, TimeSpan.FromMilliseconds(200));
}, UiMotionTokens.Slow);
}
private void AddDesktopPage()

View File

@@ -58,7 +58,7 @@ public partial class MainWindow : Window
private const int MinEdgeInsetPercent = 0;
private const int MaxEdgeInsetPercent = 30;
private const int DefaultEdgeInsetPercent = 18;
private const int SettingsTransitionDurationMs = 240;
private static readonly int SettingsTransitionDurationMs = (int)UiMotionTokens.Page.TotalMilliseconds;
private const double WallpaperPreviewMaxWidth = 520;
private const double LightBackgroundLuminanceThreshold = 0.57;
private const string TaskbarLayoutBottomFullRowMacStyle = "BottomFullRowMacStyle";