Compare commits

...

4 Commits

Author SHA1 Message Date
lincube
cc85638a37 Update LanMountainDesktop.iss 2026-05-25 11:54:04 +08:00
lincube
791e38d55e fix.修复了错误的AirAppHost打包流程 2026-05-25 11:12:15 +08:00
lincube
75aed3f6ad changed.调整了桌面组件库的UI 2026-05-25 10:16:00 +08:00
lincube
01cf32a610 changed.调整融合桌面组库的相关圆角 2026-05-25 09:32:58 +08:00
8 changed files with 87 additions and 73 deletions

View File

@@ -209,48 +209,6 @@ jobs:
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
shell: pwsh
- name: Publish AirAppHost
run: |
$arch = "${{ matrix.arch }}"
$selfContained = "${{ matrix.self_contained }}" -eq "true"
$publishDir = if ($selfContained) { "publish/windows-$arch" } else { "publish/windows-$arch-lite" }
if ($selfContained) {
dotnet publish LanMountainDesktop.AirAppHost/LanMountainDesktop.AirAppHost.csproj `
-c Release `
-o ./$publishDir `
--self-contained:false `
-r win-$arch `
-p:PublishSingleFile=false `
-p:DebugType=none `
-p:DebugSymbols=false `
-p:PublishTrimmed=false `
-p:PublishReadyToRun=false `
-p:BuildingAirAppHost=true `
-p:SkipAirAppHostBuild=true `
-p:Version=${{ needs.prepare.outputs.version }} `
-p:AssemblyVersion=${{ needs.prepare.outputs.assembly_version }} `
-p:FileVersion=${{ needs.prepare.outputs.assembly_version }} `
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
} else {
dotnet publish LanMountainDesktop.AirAppHost/LanMountainDesktop.AirAppHost.csproj `
-c Release `
-o ./$publishDir `
--self-contained:false `
-p:PublishSingleFile=false `
-p:DebugType=none `
-p:DebugSymbols=false `
-p:PublishTrimmed=false `
-p:PublishReadyToRun=false `
-p:BuildingAirAppHost=true `
-p:SkipAirAppHostBuild=true `
-p:Version=${{ needs.prepare.outputs.version }} `
-p:AssemblyVersion=${{ needs.prepare.outputs.assembly_version }} `
-p:FileVersion=${{ needs.prepare.outputs.assembly_version }} `
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
}
shell: pwsh
- name: Restructure for Launcher
run: |
$version = "${{ needs.prepare.outputs.version }}"

View File

@@ -107,4 +107,18 @@ public sealed class ComponentCategoryIconResolverTests
var result = ComponentCategoryIconResolver.ResolveCategoryIcon("File", components);
Assert.Equal(Icon.Folder, result);
}
[Fact]
public void ResolveCategoryIcon_Date_ResolvesCorrectly()
{
var result = ComponentCategoryIconResolver.ResolveCategoryIcon("Date", []);
Assert.Equal(Icon.Calendar, result);
}
[Fact]
public void ResolveCategoryIcon_Study_ResolvesCorrectly()
{
var result = ComponentCategoryIconResolver.ResolveCategoryIcon("Study", []);
Assert.Equal(Icon.Book, result);
}
}

View File

@@ -14,15 +14,34 @@ public static class ComponentCategoryIconResolver
return Icon.Apps;
}
var icon = categoryId.ToLowerInvariant() switch
{
"clock" => Icon.Clock,
"date" => Icon.Calendar,
"weather" => Icon.WeatherSunny,
"board" => Icon.Edit,
"media" => Icon.Play,
"info" => Icon.News,
"calculator" => Icon.Calculator,
"study" => Icon.Book,
"file" => Icon.Folder,
_ => (Icon?)null
};
if (icon.HasValue)
{
return icon.Value;
}
var firstComponent = categoryComponents.FirstOrDefault();
if (firstComponent is null || string.IsNullOrWhiteSpace(firstComponent.IconKey))
{
return Icon.Apps;
}
if (Enum.TryParse<Icon>(firstComponent.IconKey, ignoreCase: true, out var icon))
if (Enum.TryParse<Icon>(firstComponent.IconKey, ignoreCase: true, out var resolvedIcon))
{
return icon;
return resolvedIcon;
}
return Icon.Apps;

View File

@@ -54,7 +54,7 @@
Background="{DynamicResource AdaptiveNavItemBackgroundBrush}">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="8">
<fi:SymbolIcon Symbol="{Binding Icon}"
<fi:FluentIcon Icon="{Binding Icon}"
IconVariant="Regular"
FontSize="16" />
<TextBlock Grid.Column="1"

View File

@@ -108,7 +108,7 @@
Click="OnFindMoreComponentsClick">
<StackPanel Orientation="Horizontal" Spacing="6">
<fi:FluentIcon Icon="Globe" IconVariant="Regular" FontSize="14"/>
<TextBlock Text="查找更多组件" FontSize="12"/>
<TextBlock Text="查找更多组件" FontSize="12"/>
</StackPanel>
</Button>
</StackPanel>
@@ -132,6 +132,7 @@
FontWeight="SemiBold"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Text="{Binding SelectedComponent.DisplayName}"
HorizontalAlignment="Center"
TextTrimming="CharacterEllipsis"/>
<TextBlock Grid.Row="1"
@@ -141,6 +142,7 @@
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
Opacity="0.82"
Text="{Binding SelectedComponent.Description}"
HorizontalAlignment="Center"
TextWrapping="Wrap"
TextTrimming="CharacterEllipsis"/>
@@ -176,7 +178,7 @@
Click="OnAddComponentClick">
<StackPanel Orientation="Horizontal" Spacing="8">
<fi:FluentIcon Icon="Add" IconVariant="Regular" FontSize="16"/>
<TextBlock Text="添加" FontWeight="SemiBold"/>
<TextBlock Text="添加小组件" FontWeight="SemiBold"/>
</StackPanel>
</Button>
</Grid>

View File

@@ -1,6 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:LanMountainDesktop.Views"
xmlns:fi="using:FluentIcons.Avalonia"
x:Class="LanMountainDesktop.Views.FusedDesktopComponentLibraryWindow"
Width="740"
Height="500"
@@ -23,39 +24,37 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Padding="0"
CornerRadius="{DynamicResource DesignCornerRadiusLg}"
ClipToBounds="True">
<Grid RowDefinitions="Auto,*,Auto">
<Grid RowDefinitions="Auto,*">
<Border Height="64"
Padding="24,0,24,0"
Background="Transparent"
PointerPressed="OnWindowTitleBarPointerPressed">
<TextBlock VerticalAlignment="Center"
FontSize="22"
FontWeight="SemiBold"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Text="添加小组件" />
<Grid ColumnDefinitions="*,Auto">
<TextBlock VerticalAlignment="Center"
FontSize="22"
FontWeight="SemiBold"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Text="添加小组件" />
<Button Grid.Column="1"
Width="32"
Height="32"
Padding="0"
Background="Transparent"
BorderThickness="0"
Click="OnCloseClick"
VerticalAlignment="Center">
<fi:FluentIcon Icon="Dismiss"
IconVariant="Regular"
FontSize="16" />
</Button>
</Grid>
</Border>
<controls:FusedDesktopComponentLibraryControl x:Name="LibraryControl"
Grid.Row="1"
Margin="22,0,22,8" />
<Border Grid.Row="2"
Padding="24,16,24,22"
BorderBrush="{DynamicResource AdaptiveGlassPanelBorderBrush}"
BorderThickness="0,1,0,0">
<Button x:Name="CloseWindowButton"
HorizontalAlignment="Stretch"
MinHeight="32"
Padding="16,7"
Background="{DynamicResource AdaptiveButtonBackgroundBrush}"
BorderThickness="0"
Click="OnCloseClick">
<TextBlock HorizontalAlignment="Center"
FontSize="14"
Text="关闭" />
</Button>
</Border>
Margin="22,0,22,22" />
</Grid>
</Border>
</Grid>

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)

View File

@@ -557,7 +557,7 @@ begin
if '{#MyAppArch}' = 'x64' then
begin
Result := ExpandConstant('{commonpf64}\dotnet\shared\Microsoft.WindowsDesktop.App');
end;
end
else
begin
Result := ExpandConstant('{commonpf}\dotnet\shared\Microsoft.WindowsDesktop.App');
@@ -574,7 +574,7 @@ begin
if '{#MyAppArch}' = 'x64' then
begin
Result := DotNetRuntimeDownloadUrlX64;
end;
end
else
begin
Result := DotNetRuntimeDownloadUrlX86;