Skip to content

Commit

Permalink
v2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
davidxuang committed Feb 24, 2024
1 parent a708492 commit fb4fe1e
Show file tree
Hide file tree
Showing 17 changed files with 540 additions and 203 deletions.
11 changes: 11 additions & 0 deletions Directory.build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>2.3.1</Version>
<Authors>davidxuang</Authors>
<RepositoryUrl>https://github.com/davidxuang/MusicDecrypto</RepositoryUrl>
</PropertyGroup>

</Project>
4 changes: 2 additions & 2 deletions MusicDecrypto.Avalonia/App.axaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Application x:Class="MusicDecrypto.Avalonia.App"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ic="using:FluentIcons.FluentAvalonia"
xmlns:ic="using:FluentIcons.Avalonia.Fluent"
xmlns:sty="using:FluentAvalonia.Styling">

<Application.Resources>
<ResourceDictionary>
<ic:SymbolIconSource x:Key="BoxMultipleIcon" Symbol="BoxMultiple" />
<ic:SymbolIconSource x:Key="BoxIcon" Symbol="Box" />
<ic:SymbolIconSource x:Key="CodeIcon" Symbol="Code" />
<ic:SymbolIconSource x:Key="DocumentBulletListIcon" Symbol="DocumentBulletList" />
<ic:SymbolIconSource x:Key="OpenIcon" Symbol="Open" />
Expand Down
13 changes: 9 additions & 4 deletions MusicDecrypto.Avalonia/Controls/UrlTextBlock.axaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ic="using:FluentIcons.FluentAvalonia"
xmlns:ic="using:FluentIcons.Avalonia.Fluent"
xmlns:local="using:MusicDecrypto.Avalonia.Controls">

<Design.PreviewWith>
Expand All @@ -14,9 +14,14 @@
<Setter Property="Foreground" Value="{DynamicResource AccentTextFillColorPrimaryBrush}" />
<Setter Property="Template">
<ControlTemplate>
<StackPanel Name="LayoutRoot" Orientation="Horizontal" Spacing="2">
<TextBlock Theme="{StaticResource FluentBodyStrongTextBlockStyle}" Text="{TemplateBinding Text}" />
<ic:SymbolIcon VerticalAlignment="Center" FontSize="14" Symbol="Open" />
<StackPanel Name="LayoutRoot"
Orientation="Horizontal" Spacing="2">
<TextBlock Name="UrlText"
Theme="{StaticResource FluentBodyStrongTextBlockStyle}"
Text="{TemplateBinding Text}" />
<ic:SymbolIcon VerticalAlignment="Center"
FontSize="{Binding FontSize, ElementName=UrlText}"
Symbol="Open" />
</StackPanel>
</ControlTemplate>
</Setter>
Expand Down
5 changes: 1 addition & 4 deletions MusicDecrypto.Avalonia/MusicDecrypto.Avalonia.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>musicdecrypto-avalonia</AssemblyName>
<OutputType>WinExe</OutputType>
<VersionPrefix>2.3.0</VersionPrefix>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
</PropertyGroup>

Expand All @@ -19,7 +16,7 @@
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.*" Condition=" '$(Configuration)' == 'Debug' " />
<PackageReference Include="ByteSize" Version="2.1.*" />
<PackageReference Include="FluentAvaloniaUI" Version="2.0.*" />
<PackageReference Include="FluentIcons.FluentAvalonia" Version="1.1.*" />
<PackageReference Include="FluentIcons.Avalonia.Fluent" Version="1.1.*" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion MusicDecrypto.Avalonia/Pages/HomePage.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace MusicDecrypto.Avalonia.Pages;

Expand Down
6 changes: 3 additions & 3 deletions MusicDecrypto.Avalonia/Pages/SettingsPage.axaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<UserControl x:Class="MusicDecrypto.Avalonia.Pages.SettingsPage"
<UserControl x:Class="MusicDecrypto.Avalonia.Pages.SettingsPage"
xmlns="https://github.com/avaloniaui"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ctrl="using:MusicDecrypto.Avalonia.Controls"
xmlns:ic="using:FluentIcons.FluentAvalonia"
xmlns:ic="using:FluentIcons.Avalonia.Fluent"
xmlns:ui="using:FluentAvalonia.UI.Controls"
xmlns:vm="using:MusicDecrypto.Avalonia.ViewModels"
d:DesignWidth="800" d:DesignHeight="450"
Expand Down Expand Up @@ -100,7 +100,7 @@
Text="About" />

<ui:SettingsExpander Description="Third party open-source projects." Header="Credits"
IconSource="{StaticResource BoxMultipleIcon}">
IconSource="{StaticResource BoxIcon}">
<ui:SettingsExpanderItem>
<ItemsControl ItemsSource="{Binding Credits}">
<ItemsControl.Styles>
Expand Down
1 change: 0 additions & 1 deletion MusicDecrypto.Avalonia/Pages/SettingsPage.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using MusicDecrypto.Avalonia.Helpers;
using MusicDecrypto.Avalonia.ViewModels;

Expand Down
2 changes: 2 additions & 0 deletions MusicDecrypto.Avalonia/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Avalonia;
using FluentIcons.Avalonia.Fluent;

namespace MusicDecrypto.Avalonia;

Expand All @@ -12,5 +13,6 @@ public static void Main(string[] args) => BuildAvaloniaApp()
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.UseSegoeMetrics()
.LogToTrace();
}
2 changes: 2 additions & 0 deletions MusicDecrypto.Avalonia/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public partial class MainViewModel : ViewModelBase

public bool IsEmpty => Items.Count == 0;

public MainViewModel() : this(1) { }

public MainViewModel(double scaling)
{
_imageSize = (int)MathHelper.RoundToEven(_imageWidth * 2 * scaling);
Expand Down
16 changes: 9 additions & 7 deletions MusicDecrypto.Avalonia/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,22 @@ private static bool TryGetThemeVariant(string? value, [NotNullWhen(true)] out Th
{
theme = value switch
{
FluentAvaloniaTheme.LightModeString => ThemeVariant.Light,
FluentAvaloniaTheme.DarkModeString => ThemeVariant.Dark,
_ => null,
FluentAvaloniaTheme.LightModeString => ThemeVariant.Light,
FluentAvaloniaTheme.DarkModeString => ThemeVariant.Dark,
FluentAvaloniaTheme.HighContrastModeString => FluentAvaloniaTheme.HighContrastTheme,
_ => null,
};
return theme is not null;
}

private static readonly string _systemModeString = "System";
public static string[] AppThemes => new[]
{
public static string[] AppThemes =>
[
_systemModeString,
FluentAvaloniaTheme.LightModeString,
FluentAvaloniaTheme.DarkModeString,
// FluentAvaloniaTheme.HighContrastModeString
};
FluentAvaloniaTheme.HighContrastModeString
];

public static string Version => typeof(Program).Assembly.GetName().Version!.ToString();

Expand All @@ -70,6 +71,7 @@ public record class CreditItem(
new CreditItem("AvaloniaUI", "MIT", "https://avaloniaui.net/"),
new CreditItem("FluentAvalonia", "MIT", "https://github.com/amwx/FluentAvalonia"),
new CreditItem("fluentui-system-icons", "MIT", "https://github.com/microsoft/fluentui-system-icons"),
new CreditItem("FluentIcons", "MIT", "https://github.com/davidxuang/FluentIcons"),
new CreditItem("NativeMemoryArray", "MIT", "https://github.com/Cysharp/NativeMemoryArray"),
new CreditItem("TagLibSharp", "LGPL-2.1", "https://github.com/mono/taglib-sharp"),
new CreditItem("ByteSize", "MIT", "https://github.com/omar/ByteSize"),
Expand Down
5 changes: 2 additions & 3 deletions MusicDecrypto.Avalonia/Views/MainView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ic="using:FluentIcons.FluentAvalonia"
xmlns:ic="using:FluentIcons.Avalonia.Fluent"
xmlns:ui="using:FluentAvalonia.UI.Controls"
d:DesignWidth="800" d:DesignHeight="450"
mc:Ignorable="d">
Expand All @@ -15,7 +15,6 @@
<Grid.Styles>
<Style Selector="Button.AppBarButton">
<Setter Property="Padding" Value="8" />
<Setter Property="FontSize" Value="20" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Theme" Value="{StaticResource TransparentButton}" />
</Style>
Expand All @@ -31,7 +30,7 @@
IsEnabled="{Binding #FrameView.CanGoBack}"
IsVisible="{Binding #FrameView.CanGoBack}">
<Button.Content>
<ic:SymbolIcon FontSize="20" Symbol="ArrowLeft" />
<ic:SymbolIcon Symbol="ArrowLeft" />
</Button.Content>
<ToolTip.Tip>Back</ToolTip.Tip>
</Button>
Expand Down
3 changes: 0 additions & 3 deletions MusicDecrypto.Commandline/MusicDecrypto.Commandline.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>musicdecrypto</AssemblyName>
<OutputType>Exe</OutputType>
<Version>2.3.0</Version>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Loading

0 comments on commit fb4fe1e

Please sign in to comment.