Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Mar 19, 2020
1 parent 1cab1ff commit 3b5607c
Show file tree
Hide file tree
Showing 28 changed files with 100 additions and 73 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.0.100
dotnet-version: 3.1.102
- name: Build
run: dotnet build -c Release
- name: Test
Expand All @@ -46,38 +46,38 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.0.100
dotnet-version: 3.1.102
- name: Publish
if: github.event_name != 'pull_request'
run: |
dotnet publish -c Release -f netcoreapp3.0 -r win7-x64 -o ./artifacts/AvaloniaDemo-netcoreapp3.0-win7-x64 ./samples/AvaloniaDemo/AvaloniaDemo.csproj
dotnet publish -c Release -f netcoreapp3.0 -r win7-x64 -o ./artifacts/AvaloniaDemo.Experimental-netcoreapp3.0-win7-x64 ./samples/AvaloniaDemo.Experimental/AvaloniaDemo.Experimental.csproj
dotnet publish -c Release -f netcoreapp3.0 -r win7-x64 -o ./artifacts/AvaloniaDemo.Perspectives-netcoreapp3.0-win7-x64 ./samples/AvaloniaDemo.Perspectives/AvaloniaDemo.Perspectives.csproj
dotnet publish -c Release -f netcoreapp3.0 -r win7-x64 -o ./artifacts/Notepad-netcoreapp3.0-win7-x64 ./samples/Notepad/Notepad.csproj
dotnet publish -c Release -f netcoreapp3.1 -r win7-x64 -o ./artifacts/AvaloniaDemo-netcoreapp3.1-win7-x64 ./samples/AvaloniaDemo/AvaloniaDemo.csproj
dotnet publish -c Release -f netcoreapp3.1 -r win7-x64 -o ./artifacts/AvaloniaDemo.Experimental-netcoreapp3.1-win7-x64 ./samples/AvaloniaDemo.Experimental/AvaloniaDemo.Experimental.csproj
dotnet publish -c Release -f netcoreapp3.1 -r win7-x64 -o ./artifacts/AvaloniaDemo.Perspectives-netcoreapp3.1-win7-x64 ./samples/AvaloniaDemo.Perspectives/AvaloniaDemo.Perspectives.csproj
dotnet publish -c Release -f netcoreapp3.1 -r win7-x64 -o ./artifacts/Notepad-netcoreapp3.1-win7-x64 ./samples/Notepad/Notepad.csproj
- name: Artifacts
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@master
with:
name: AvaloniaDemo-netcoreapp3.0-win7-x64
path: ./artifacts/AvaloniaDemo-netcoreapp3.0-win7-x64
name: AvaloniaDemo-netcoreapp3.1-win7-x64
path: ./artifacts/AvaloniaDemo-netcoreapp3.1-win7-x64
- name: Artifacts
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@master
with:
name: AvaloniaDemo.Experimental-netcoreapp3.0-win7-x64
path: ./artifacts/AvaloniaDemo.Experimental-netcoreapp3.0-win7-x64
name: AvaloniaDemo.Experimental-netcoreapp3.1-win7-x64
path: ./artifacts/AvaloniaDemo.Experimental-netcoreapp3.1-win7-x64
- name: Artifacts
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@master
with:
name: AvaloniaDemo.Perspectives-netcoreapp3.0-win7-x64
path: ./artifacts/AvaloniaDemo.Perspectives-netcoreapp3.0-win7-x64
name: AvaloniaDemo.Perspectives-netcoreapp3.1-win7-x64
path: ./artifacts/AvaloniaDemo.Perspectives-netcoreapp3.1-win7-x64
- name: Artifacts
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@master
with:
name: Notepad-netcoreapp3.0-win7-x64
path: ./artifacts/Notepad-netcoreapp3.0-win7-x64
name: Notepad-netcoreapp3.1-win7-x64
path: ./artifacts/Notepad-netcoreapp3.1-win7-x64

publish-ubuntu:
name: Publish ubuntu-latest
Expand All @@ -87,24 +87,24 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.0.100
dotnet-version: 3.1.102
- name: Publish
if: github.event_name != 'pull_request'
run: |
dotnet publish -c Release -f netcoreapp3.0 -r debian.8-x64 -o ./artifacts/AvaloniaDemo-netcoreapp3.0-debian.8-x64 ./samples/AvaloniaDemo/AvaloniaDemo.csproj
dotnet publish -c Release -f netcoreapp3.0 -r ubuntu.14.04-x64 -o ./artifacts/AvaloniaDemo-netcoreapp3.0-ubuntu.14.04-x64 ./samples/AvaloniaDemo/AvaloniaDemo.csproj
dotnet publish -c Release -f netcoreapp3.1 -r debian.8-x64 -o ./artifacts/AvaloniaDemo-netcoreapp3.1-debian.8-x64 ./samples/AvaloniaDemo/AvaloniaDemo.csproj
dotnet publish -c Release -f netcoreapp3.1 -r ubuntu.14.04-x64 -o ./artifacts/AvaloniaDemo-netcoreapp3.1-ubuntu.14.04-x64 ./samples/AvaloniaDemo/AvaloniaDemo.csproj
- name: Artifacts
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@master
with:
name: AvaloniaDemo-netcoreapp3.0-debian.8-x64
path: ./artifacts/AvaloniaDemo-netcoreapp3.0-debian.8-x64
name: AvaloniaDemo-netcoreapp3.1-debian.8-x64
path: ./artifacts/AvaloniaDemo-netcoreapp3.1-debian.8-x64
- name: Artifacts
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@master
with:
name: AvaloniaDemo-netcoreapp3.0-ubuntu.14.04-x64
path: ./artifacts/AvaloniaDemo-netcoreapp3.0-ubuntu.14.04-x64
name: AvaloniaDemo-netcoreapp3.1-ubuntu.14.04-x64
path: ./artifacts/AvaloniaDemo-netcoreapp3.1-ubuntu.14.04-x64

publish-macOS:
name: Publish macOS-latest
Expand All @@ -114,13 +114,13 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.0.100
dotnet-version: 3.1.102
- name: Publish
if: github.event_name != 'pull_request'
run: dotnet publish -c Release -f netcoreapp3.0 -r osx.10.12-x64 -o ./artifacts/AvaloniaDemo-netcoreapp3.0-osx.10.12-x64 ./samples/AvaloniaDemo/AvaloniaDemo.csproj
run: dotnet publish -c Release -f netcoreapp3.1 -r osx.10.12-x64 -o ./artifacts/AvaloniaDemo-netcoreapp3.1-osx.10.12-x64 ./samples/AvaloniaDemo/AvaloniaDemo.csproj
- name: Artifacts
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@master
with:
name: AvaloniaDemo-netcoreapp3.0-osx.10.12-x64
path: ./artifacts/AvaloniaDemo-netcoreapp3.0-osx.10.12-x64
name: AvaloniaDemo-netcoreapp3.1-osx.10.12-x64
path: ./artifacts/AvaloniaDemo-netcoreapp3.1-osx.10.12-x64
1 change: 1 addition & 0 deletions Dock.sln
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "props", "props", "{A2F3E41E-D53C-49A1-9089-2FE2C3F0FE73}"
ProjectSection(SolutionItems) = preProject
build\Avalonia.Desktop.props = build\Avalonia.Desktop.props
build\Avalonia.Diagnostics.props = build\Avalonia.Diagnostics.props
build\Avalonia.props = build\Avalonia.props
build\Base.props = build\Base.props
build\EmbedXaml.props = build\EmbedXaml.props
Expand Down
2 changes: 1 addition & 1 deletion build/Avalonia.Desktop.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="0.9.4" />
<PackageReference Include="Avalonia.Desktop" Version="0.9.999-cibuild*" />
<PackageReference Include="Avalonia.Angle.Windows.Natives" Version="2.1.0.2019013001" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="1.68.1" />
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions build/Avalonia.Diagnostics.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Diagnostics" Version="0.9.999-cibuild*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.9.4" />
<PackageReference Include="Avalonia" Version="0.9.999-cibuild*" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Base.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>0.9.4.1</VersionPrefix>
<VersionPrefix>0.9.999</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>Wiesław Šoltés</Authors>
<Company>Wiesław Šoltés</Company>
Expand Down
1 change: 1 addition & 0 deletions build/build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Nuke.Common.ProjectModel;
using Nuke.Common.Tools.DotNet;
using static Nuke.Common.EnvironmentInfo;
using Nuke.Common.IO;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
Expand Down
2 changes: 1 addition & 1 deletion build/build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="0.23.4" />
<PackageReference Include="Nuke.Common" Version="0.24.4" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "3.0.100",
"version": "3.1.100",
"rollForward": "latestMajor"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;netcoreapp3.0;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net461</TargetFrameworks>
<OutputType>WinExe</OutputType>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
Expand All @@ -24,6 +24,7 @@
<Import Project="..\..\build\ReferenceAssemblies.props" />
<Import Project="..\..\build\Avalonia.props" />
<Import Project="..\..\build\Avalonia.Desktop.props" />
<Import Project="..\..\build\Avalonia.Diagnostics.props" />
<Import Project="..\..\build\Newtonsoft.Json.props" />

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;netcoreapp3.0;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net461</TargetFrameworks>
<OutputType>WinExe</OutputType>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
Expand All @@ -24,6 +24,7 @@
<Import Project="..\..\build\ReferenceAssemblies.props" />
<Import Project="..\..\build\Avalonia.props" />
<Import Project="..\..\build\Avalonia.Desktop.props" />
<Import Project="..\..\build\Avalonia.Diagnostics.props" />
<Import Project="..\..\build\Newtonsoft.Json.props" />

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion samples/AvaloniaDemo/AvaloniaDemo.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;netcoreapp3.0;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net461</TargetFrameworks>
<OutputType>WinExe</OutputType>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
Expand All @@ -20,6 +20,7 @@
<Import Project="..\..\build\ReferenceAssemblies.props" />
<Import Project="..\..\build\Avalonia.props" />
<Import Project="..\..\build\Avalonia.Desktop.props" />
<Import Project="..\..\build\Avalonia.Diagnostics.props" />
<Import Project="..\..\build\Newtonsoft.Json.props" />
<Import Project="..\..\build\ReactiveUI.props" />

Expand Down
3 changes: 2 additions & 1 deletion samples/Notepad/Notepad.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;netcoreapp3.0;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net461</TargetFrameworks>
<OutputType>WinExe</OutputType>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
Expand All @@ -20,6 +20,7 @@
<Import Project="..\..\build\ReferenceAssemblies.props" />
<Import Project="..\..\build\Avalonia.props" />
<Import Project="..\..\build\Avalonia.Desktop.props" />
<Import Project="..\..\build\Avalonia.Diagnostics.props" />
<Import Project="..\..\build\Newtonsoft.Json.props" />
<Import Project="..\..\build\ReactiveUI.props" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;netcoreapp3.0;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net461</TargetFrameworks>
<OutputType>WinExe</OutputType>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
Expand All @@ -20,6 +20,7 @@
<Import Project="..\..\build\ReferenceAssemblies.props" />
<Import Project="..\..\build\Avalonia.props" />
<Import Project="..\..\build\Avalonia.Desktop.props" />
<Import Project="..\..\build\Avalonia.Diagnostics.props" />

<ItemGroup>
<Compile Include="**\*.cs" Exclude="obj\**" />
Expand Down
10 changes: 5 additions & 5 deletions src/Dock.Avalonia.Themes.Default/DockTarget.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<Grid Background="Purple" ColumnSpan="2" RowSpan="2" Opacity="0" Name="PART_CenterIndicator" />
<Grid RowSpan="2" ColumnSpan="2">
<Grid MaxWidth="125" MaxHeight="125" RowDefinitions="*,*,*" ColumnDefinitions="*,*,*">
<Image Name="PART_TopSelector" Source="avares://Dock.Avalonia.Themes.Default/Assets/DockAnchorableTop.png" Height="40" Width="40" Grid.Column="1" />
<Image Name="PART_BottomSelector" Source="avares://Dock.Avalonia.Themes.Default/Assets/DockAnchorableBottom.png" Height="40" Width="40" Grid.Row="2" Grid.Column="1" />
<Image Name="PART_LeftSelector" Source="avares://Dock.Avalonia.Themes.Default/Assets/DockAnchorableLeft.png" Height="40" Width="40" Grid.Row="1" />
<Image Name="PART_RightSelector" Source="avares://Dock.Avalonia.Themes.Default/Assets/DockAnchorableRight.png" Height="40" Width="40" Grid.Row="1" Grid.Column="2" />
<Image Name="PART_CenterSelector" Source="avares://Dock.Avalonia.Themes.Default/Assets/DockDocumentInside.png" Height="40" Width="40" Grid.Row="1" Grid.Column="1" />
<Image Name="PART_TopSelector" Source="/Assets/DockAnchorableTop.png" Height="40" Width="40" Grid.Column="1" />
<Image Name="PART_BottomSelector" Source="/Assets/DockAnchorableBottom.png" Height="40" Width="40" Grid.Row="2" Grid.Column="1" />
<Image Name="PART_LeftSelector" Source="/Assets/DockAnchorableLeft.png" Height="40" Width="40" Grid.Row="1" />
<Image Name="PART_RightSelector" Source="/Assets/DockAnchorableRight.png" Height="40" Width="40" Grid.Row="1" Grid.Column="2" />
<Image Name="PART_CenterSelector" Source="/Assets/DockDocumentInside.png" Height="40" Width="40" Grid.Row="1" Grid.Column="1" />
</Grid>
</Grid>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/Dock.Avalonia.Themes.Default/DockToolChrome.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<Border Name="PART_Border" BorderBrush="{DynamicResource ThemeBorderLowBrush}">
<Grid Name="PART_Grip">
<DockPanel LastChildFill="True" Margin="8 0">
<TextBlock DockPanel.Dock="Left" Text="{Binding ActiveDockable.Title}" HorizontalAlignment="Left" TextAlignment="Center" VerticalAlignment="Center" Height="25" Margin="0 8 8 0" Background="{Binding #Part_Grip.Background}" />
<TextBlock DockPanel.Dock="Left" Text="{Binding ActiveDockable.Title}" HorizontalAlignment="Left" TextAlignment="Left" VerticalAlignment="Center" Height="25" Margin="0 8 8 0" Background="{Binding #Part_Grip.Background}" />
<Button Classes="chromeButton" DockPanel.Dock="Right" Name="PART_CloseButton" Command="{Binding Owner.Factory.CloseDockable}" CommandParameter="{Binding ActiveDockable}">
<Image Source="avares://Dock.Avalonia.Themes.Default/Assets/PinClose_Dark.png" Height="13" Width="13" Stretch="None" />
</Button>
Expand Down
43 changes: 32 additions & 11 deletions src/Dock.Avalonia/Controls/DockToolChrome.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Data;
using Avalonia.Input;
using Avalonia.Interactivity;
using Dock.Model;
Expand All @@ -17,23 +18,26 @@ namespace Dock.Avalonia.Controls
/// </summary>
public class DockToolChrome : ContentControl
{
static DockToolChrome()
{
PseudoClass<DockToolChrome>(IsActiveProperty, ":active");
}

/// <summary>
/// Define <see cref="Title"/> property.
/// </summary>
public static readonly AvaloniaProperty<string> TitleProprty =
public static readonly StyledProperty<string> TitleProprty =
AvaloniaProperty.Register<DockToolChrome, string>(nameof(Title));

/// <summary>
/// Define the <see cref="IsActive"/> property.
/// </summary>
public static readonly AvaloniaProperty<bool> IsActiveProperty =
public static readonly StyledProperty<bool> IsActiveProperty =
AvaloniaProperty.Register<DockToolChrome, bool>(nameof(IsActive));

/// <summary>
/// Initialize the new instance of the <see cref="DockToolChrome"/>.
/// </summary>
public DockToolChrome()
{
UpdatePseudoClasses(IsActive);
}

/// <summary>
/// Gets or sets chrome tool title.
/// </summary>
Expand All @@ -56,20 +60,17 @@ public bool IsActive

internal Button? CloseButton { get; private set; }

private IDisposable? _disposable;

/// <inheritdoc/>
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnAttachedToVisualTree(e);
_disposable = AddHandler(InputElement.PointerPressedEvent, Pressed, RoutingStrategies.Tunnel);
AddHandler(InputElement.PointerPressedEvent, Pressed, RoutingStrategies.Tunnel);
}

/// <inheritdoc/>
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnDetachedFromVisualTree(e);
_disposable?.Dispose();
}

private void Pressed(object sender, PointerPressedEventArgs e)
Expand Down Expand Up @@ -102,5 +103,25 @@ protected override void OnTemplateApplied(TemplateAppliedEventArgs e)
this.PseudoClasses.Set(":floating", true);
}
}

/// <inheritdoc/>
protected override void OnPropertyChanged<T>(
AvaloniaProperty<T> property,
Optional<T> oldValue,
BindingValue<T> newValue,
BindingPriority priority)
{
base.OnPropertyChanged(property, oldValue, newValue, priority);

if (property == IsActiveProperty)
{
UpdatePseudoClasses(newValue.GetValueOrDefault<bool>());
}
}

private void UpdatePseudoClasses(bool isActive)
{
PseudoClasses.Set(":active", isActive);
}
}
}
5 changes: 1 addition & 4 deletions src/Dock.Avalonia/Controls/DocumentControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,17 @@ namespace Dock.Avalonia.Controls
/// </summary>
public class DocumentControl : TemplatedControl
{
private IDisposable? _disposable;

/// <inheritdoc/>
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnAttachedToVisualTree(e);
_disposable = AddHandler(InputElement.PointerPressedEvent, Pressed, RoutingStrategies.Tunnel);
AddHandler(InputElement.PointerPressedEvent, Pressed, RoutingStrategies.Tunnel);
}

/// <inheritdoc/>
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnDetachedFromVisualTree(e);
_disposable?.Dispose();
}

private void Pressed(object sender, PointerPressedEventArgs e)
Expand Down
Loading

0 comments on commit 3b5607c

Please sign in to comment.