Skip to content

Commit

Permalink
Merge pull request #130 from XanatosX/feature/add-build-with-avalonia…
Browse files Browse the repository at this point in the history
…-logo

Add "build for avalonia logo"
  • Loading branch information
XanatosX authored Jan 7, 2024
2 parents e2965e5 + 334f8db commit 2f35955
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.ico filter=lfs diff=lfs merge=lfs -text
**/Assets/*.png filter=lfs diff=lfs merge=lfs -text
1 change: 1 addition & 0 deletions src/ModularToolManager/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<FluentTheme/>
<StyleInclude Source="avares://ModularToolManager/Resources/Icons.axaml"/>
<StyleInclude Source="avares://ModularToolManager/Resources/LinkButtonStyle.axaml"/>
<StyleInclude Source="avares://ModularToolManager/Resources/ImageButtonStyle.axaml"/>
</Application.Styles>

<!-- Custom control styles -->
Expand Down
3 changes: 3 additions & 0 deletions src/ModularToolManager/Assets/built-with-avalonia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/ModularToolManager/ModularToolManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
<AvaloniaResource Include="Assets\**" />
<None Remove=".gitignore" />
<None Remove="Assets\application-logo.ico" />
<None Remove="Assets\built-with-avalonia.png" />
<None Remove="Resources\buildInStyles.json" />
<None Remove="Resources\dependencies.json" />
<None Remove="Resources\hotkeys.json" />
<None Remove="Resources\LICENSE" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\application-logo.ico" />
<Content Include="Assets\built-with-avalonia.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\buildInStyles.json" />
Expand Down
9 changes: 9 additions & 0 deletions src/ModularToolManager/Properties/Properties.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/ModularToolManager/Properties/Properties.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<data name="ApplicationName" xml:space="preserve">
<value>Modular Tool Manager</value>
</data>
<data name="AvaloniaProjectUrl" xml:space="preserve">
<value>https://avaloniaui.net/</value>
</data>
<data name="FallbackLanguage" xml:space="preserve">
<value>eng</value>
</data>
Expand Down
30 changes: 30 additions & 0 deletions src/ModularToolManager/Resources/ImageButtonStyle.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith>
<Border Padding="50">
<Button Classes="image">
<Image Source="/Assets/built-with-avalonia.png"/>
</Button>
</Border>
</Design.PreviewWith>

<Style Selector="Button.image">
<!-- @Note: Look at https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Themes.Fluent/Accents/FluentControlResources.xaml -->
<Setter Property="Foreground" Value="Transparent"/>
<Setter Property="Padding" Value="0" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Cursor" Value="Hand" />
</Style>

<Style Selector="Button.image:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="Transparent"/>
</Style>


<Style Selector="Button.image:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="Transparent"/>
</Style>
</Styles>
4 changes: 4 additions & 0 deletions src/ModularToolManager/Resources/LinkButtonStyle.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@
</ControlTemplate>
</Setter>
</Style>

<Style Selector="Button.link:pointerover /template/ ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAccentBrush2}"/>
</Style>
</Styles>
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,11 @@ public IEnumerable<HotkeyModel> GetHotkeys()

return returnHotkeys;
}

/// <summary>
/// Get the url for the avalonia UI project
/// </summary>
/// <returns>The avalonia ui project url</returns>
public string GetAvaloniaProjectUrl() => Properties.Properties.AvaloniaProjectUrl;

}
7 changes: 7 additions & 0 deletions src/ModularToolManager/ViewModels/AboutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ internal partial class AboutViewModel : ObservableObject
[ObservableProperty]
private string? gitHubUserManualUrl;

/// <summary>
/// The url to open for the avalonia project
/// </summary>
[ObservableProperty]
private string? avaloniaProjectUrl;

/// <summary>
/// Service used to open url
/// </summary>
Expand All @@ -66,6 +72,7 @@ public AboutViewModel(GetApplicationInformationService applicationInformationSer
Version = applicationInformationService.GetVersion()?.ToString();
GitHubUrl = applicationInformationService.GetGithubUrl();
GitHubUserManualUrl = applicationInformationService.GetGithubUserManualUrl();
AvaloniaProjectUrl = applicationInformationService.GetAvaloniaProjectUrl();
Dependencies = applicationInformationService.GetDependencies()
.OrderBy(d => d.Name)
.Select(dep => dependencyResolverService.GetDependency(provider =>
Expand Down
7 changes: 4 additions & 3 deletions src/ModularToolManager/Views/AboutView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
<Expander Margin="0,10,0,0" Header="{x:Static p:Resources.About_License}">
<TextBlock TextWrapping="Wrap" Text="{Binding License}"/>
</Expander>
<StackPanel Spacing="10" HorizontalAlignment="Center" Orientation="Horizontal" MaxHeight="50" Margin="0,20,0,10">
<TextBlock VerticalAlignment="Center" Text="{x:Static p:Resources.RunningWith}"/>
<Image Source="/Assets/avalonia-logo.ico"/>
<StackPanel Spacing="10" HorizontalAlignment="Center" Orientation="Horizontal" MaxHeight="75" Margin="0,20,0,10">
<Button Classes="image" Command="{Binding OpenUrlCommand}" CommandParameter="{Binding AvaloniaProjectUrl}">
<Image Source="/Assets/built-with-avalonia.png"/>
</Button>
</StackPanel>
<Button IsVisible="false" Command="{Binding AbortCommand}" HotKey="Escape"/>
</StackPanel>
Expand Down
2 changes: 1 addition & 1 deletion src/ModularToolManager/Views/HotkeysView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
x:Class="ModularToolManager.Views.HotkeysView">
<StackPanel>
<ItemsControl ItemsSource="{Binding Hotkeys}"/>
<Button Command="{Binding AbortCommand}" HotKey="Escape"/>
<Button IsVisible="false" Command="{Binding AbortCommand}" HotKey="Escape"/>
</StackPanel>
</UserControl>
2 changes: 1 addition & 1 deletion src/ModularToolManager/Views/PluginSettingsView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Grid RowDefinitions="*, Auto">
<ItemsControl ItemsSource="{Binding PluginSettings}"/>
<StackPanel Grid.Row="1">
<Button Content="{x:Static p:Resources.DefaultButton_Save}" Command="{Binding SaveSettingsCommand}"/>
<Button IsVisible="false" Content="{x:Static p:Resources.DefaultButton_Save}" Command="{Binding SaveSettingsCommand}"/>
</StackPanel>
</Grid>
</UserControl>

0 comments on commit 2f35955

Please sign in to comment.