mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-23 18:04:26 +08:00
Compare commits
4 Commits
69bcf2c6eb
...
cc85638a37
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc85638a37 | ||
|
|
791e38d55e | ||
|
|
75aed3f6ad | ||
|
|
01cf32a610 |
42
.github/workflows/release.yml
vendored
42
.github/workflows/release.yml
vendored
@@ -209,48 +209,6 @@ jobs:
|
|||||||
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
|
-p:InformationalVersion=${{ needs.prepare.outputs.informational_version }}
|
||||||
shell: pwsh
|
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
|
- name: Restructure for Launcher
|
||||||
run: |
|
run: |
|
||||||
$version = "${{ needs.prepare.outputs.version }}"
|
$version = "${{ needs.prepare.outputs.version }}"
|
||||||
|
|||||||
@@ -107,4 +107,18 @@ public sealed class ComponentCategoryIconResolverTests
|
|||||||
var result = ComponentCategoryIconResolver.ResolveCategoryIcon("File", components);
|
var result = ComponentCategoryIconResolver.ResolveCategoryIcon("File", components);
|
||||||
Assert.Equal(Icon.Folder, result);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,15 +14,34 @@ public static class ComponentCategoryIconResolver
|
|||||||
return Icon.Apps;
|
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();
|
var firstComponent = categoryComponents.FirstOrDefault();
|
||||||
if (firstComponent is null || string.IsNullOrWhiteSpace(firstComponent.IconKey))
|
if (firstComponent is null || string.IsNullOrWhiteSpace(firstComponent.IconKey))
|
||||||
{
|
{
|
||||||
return Icon.Apps;
|
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;
|
return Icon.Apps;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
Background="{DynamicResource AdaptiveNavItemBackgroundBrush}">
|
Background="{DynamicResource AdaptiveNavItemBackgroundBrush}">
|
||||||
<Grid ColumnDefinitions="Auto,*"
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
ColumnSpacing="8">
|
ColumnSpacing="8">
|
||||||
<fi:SymbolIcon Symbol="{Binding Icon}"
|
<fi:FluentIcon Icon="{Binding Icon}"
|
||||||
IconVariant="Regular"
|
IconVariant="Regular"
|
||||||
FontSize="16" />
|
FontSize="16" />
|
||||||
<TextBlock Grid.Column="1"
|
<TextBlock Grid.Column="1"
|
||||||
|
|||||||
@@ -108,7 +108,7 @@
|
|||||||
Click="OnFindMoreComponentsClick">
|
Click="OnFindMoreComponentsClick">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
<fi:FluentIcon Icon="Globe" IconVariant="Regular" FontSize="14"/>
|
<fi:FluentIcon Icon="Globe" IconVariant="Regular" FontSize="14"/>
|
||||||
<TextBlock Text="查找更多组件" FontSize="12"/>
|
<TextBlock Text="查找更多小组件" FontSize="12"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -132,6 +132,7 @@
|
|||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
|
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
|
||||||
Text="{Binding SelectedComponent.DisplayName}"
|
Text="{Binding SelectedComponent.DisplayName}"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
TextTrimming="CharacterEllipsis"/>
|
TextTrimming="CharacterEllipsis"/>
|
||||||
|
|
||||||
<TextBlock Grid.Row="1"
|
<TextBlock Grid.Row="1"
|
||||||
@@ -141,6 +142,7 @@
|
|||||||
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
|
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
|
||||||
Opacity="0.82"
|
Opacity="0.82"
|
||||||
Text="{Binding SelectedComponent.Description}"
|
Text="{Binding SelectedComponent.Description}"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
TextTrimming="CharacterEllipsis"/>
|
TextTrimming="CharacterEllipsis"/>
|
||||||
|
|
||||||
@@ -176,7 +178,7 @@
|
|||||||
Click="OnAddComponentClick">
|
Click="OnAddComponentClick">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
<fi:FluentIcon Icon="Add" IconVariant="Regular" FontSize="16"/>
|
<fi:FluentIcon Icon="Add" IconVariant="Regular" FontSize="16"/>
|
||||||
<TextBlock Text="添加" FontWeight="SemiBold"/>
|
<TextBlock Text="添加小组件" FontWeight="SemiBold"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<Window xmlns="https://github.com/avaloniaui"
|
<Window xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="using:LanMountainDesktop.Views"
|
xmlns:controls="using:LanMountainDesktop.Views"
|
||||||
|
xmlns:fi="using:FluentIcons.Avalonia"
|
||||||
x:Class="LanMountainDesktop.Views.FusedDesktopComponentLibraryWindow"
|
x:Class="LanMountainDesktop.Views.FusedDesktopComponentLibraryWindow"
|
||||||
Width="740"
|
Width="740"
|
||||||
Height="500"
|
Height="500"
|
||||||
@@ -23,39 +24,37 @@
|
|||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
|
CornerRadius="{DynamicResource DesignCornerRadiusLg}"
|
||||||
ClipToBounds="True">
|
ClipToBounds="True">
|
||||||
<Grid RowDefinitions="Auto,*,Auto">
|
<Grid RowDefinitions="Auto,*">
|
||||||
<Border Height="64"
|
<Border Height="64"
|
||||||
Padding="24,0,24,0"
|
Padding="24,0,24,0"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
PointerPressed="OnWindowTitleBarPointerPressed">
|
PointerPressed="OnWindowTitleBarPointerPressed">
|
||||||
|
<Grid ColumnDefinitions="*,Auto">
|
||||||
<TextBlock VerticalAlignment="Center"
|
<TextBlock VerticalAlignment="Center"
|
||||||
FontSize="22"
|
FontSize="22"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
|
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
|
||||||
Text="添加小组件" />
|
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>
|
</Border>
|
||||||
|
|
||||||
<controls:FusedDesktopComponentLibraryControl x:Name="LibraryControl"
|
<controls:FusedDesktopComponentLibraryControl x:Name="LibraryControl"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="22,0,22,8" />
|
Margin="22,0,22,22" />
|
||||||
|
|
||||||
<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>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ using Avalonia.Controls;
|
|||||||
using Avalonia.Controls.ApplicationLifetimes;
|
using Avalonia.Controls.ApplicationLifetimes;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
|
using LanMountainDesktop.Appearance;
|
||||||
using LanMountainDesktop.Services;
|
using LanMountainDesktop.Services;
|
||||||
|
using LanMountainDesktop.Settings.Core;
|
||||||
|
|
||||||
namespace LanMountainDesktop.Views;
|
namespace LanMountainDesktop.Views;
|
||||||
|
|
||||||
@@ -15,6 +17,7 @@ public partial class FusedDesktopComponentLibraryWindow : Window
|
|||||||
public FusedDesktopComponentLibraryWindow()
|
public FusedDesktopComponentLibraryWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
ApplyFluentCornerRadius();
|
||||||
|
|
||||||
LibraryControl.AddComponentRequested += OnAddComponentRequested;
|
LibraryControl.AddComponentRequested += OnAddComponentRequested;
|
||||||
KeyDown += OnWindowKeyDown;
|
KeyDown += OnWindowKeyDown;
|
||||||
@@ -23,6 +26,25 @@ public partial class FusedDesktopComponentLibraryWindow : Window
|
|||||||
mainWindow?.RegisterFusedLibraryWindow(this);
|
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 bool PreserveEditModeOnClose { get; private set; }
|
||||||
|
|
||||||
public void SetOverlayWindow(TransparentOverlayWindow overlayWindow)
|
public void SetOverlayWindow(TransparentOverlayWindow overlayWindow)
|
||||||
|
|||||||
@@ -557,7 +557,7 @@ begin
|
|||||||
if '{#MyAppArch}' = 'x64' then
|
if '{#MyAppArch}' = 'x64' then
|
||||||
begin
|
begin
|
||||||
Result := ExpandConstant('{commonpf64}\dotnet\shared\Microsoft.WindowsDesktop.App');
|
Result := ExpandConstant('{commonpf64}\dotnet\shared\Microsoft.WindowsDesktop.App');
|
||||||
end;
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Result := ExpandConstant('{commonpf}\dotnet\shared\Microsoft.WindowsDesktop.App');
|
Result := ExpandConstant('{commonpf}\dotnet\shared\Microsoft.WindowsDesktop.App');
|
||||||
@@ -574,7 +574,7 @@ begin
|
|||||||
if '{#MyAppArch}' = 'x64' then
|
if '{#MyAppArch}' = 'x64' then
|
||||||
begin
|
begin
|
||||||
Result := DotNetRuntimeDownloadUrlX64;
|
Result := DotNetRuntimeDownloadUrlX64;
|
||||||
end;
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Result := DotNetRuntimeDownloadUrlX86;
|
Result := DotNetRuntimeDownloadUrlX86;
|
||||||
|
|||||||
Reference in New Issue
Block a user