Skip to content

Commit

Permalink
Merge branch 'Dirkster99:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
X39 authored Mar 10, 2022
2 parents 319bb05 + 22b9bb9 commit 7c661f1
Show file tree
Hide file tree
Showing 29 changed files with 439 additions and 137 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@ to also theme standard elements, such as, button and textblock etc.

# Mile Stone History

## Fixes Added in Version 4.70.1

- [#336 Keep ActiveContent when switching RootPanel](https://github.com/Dirkster99/AvalonDock/pull/336) (thanx to [Khaos66](https://github.com/Khaos66))
- [#334 fix #333 x64-issue: x86-specific functions are used when project is compiled for x64-architecture](https://github.com/Dirkster99/AvalonDock/pull/334) (thanx to [Jan cuellius](https://github.com/cuellius))

## Features and Fixes Added in Version 4.70.0

- [#331 FixDockAsDocument fix bug with CanExecute and Execute for DockAsDocument](https://github.com/Dirkster99/AvalonDock/pull/331) (thanx to [askgthb](https://github.com/askgthb))
- [#328 NullCheck for currentActiveContent ](https://github.com/Dirkster99/AvalonDock/pull/328) (thanx to [Ben bbuerger](https://github.com/bbuerger))
- [#327 Add default width and height of LayoutAnchorable](https://github.com/Dirkster99/AvalonDock/pull/327) (thanx to [Anders Chen](https://github.com/AndersChen123))
- [#326 A more complete fix to per-monitor DPI issues](https://github.com/Dirkster99/AvalonDock/pull/326) (thanx to [Robin rwg0](https://github.com/rwg0))
- [#324 Navigator Window Accessibility fixes](https://github.com/Dirkster99/AvalonDock/pull/324) (thanx to [Siegfried Pammer](https://github.com/siegfriedpammer))

## Features and Fixes Added in Version 4.60.1

- [#314 Fix NavigatorWindow not working if there is only one document](https://github.com/Dirkster99/AvalonDock/pull/314) (thanx to [Siegfried Pammer](https://github.com/siegfriedpammer))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.60.1</Version>
<AssemblyVersion>4.60.1</AssemblyVersion>
<FileVersion>4.60.1</FileVersion>
<PackageVersion>4.60.1</PackageVersion>
<Version>4.70.1</Version>
<AssemblyVersion>4.70.1</AssemblyVersion>
<FileVersion>4.70.1</FileVersion>
<PackageVersion>4.70.1</PackageVersion>
<Company>Open Source</Company>
<Product>Dirkster.AvalonDock</Product>
<Copyright>2017-2021</Copyright>
<Copyright>2017-2022</Copyright>
<Description>This assembly implements a docking layout system for WPF.</Description>
<PackageProjectUrl>https://github.com/Dirkster99/AvalonDock</PackageProjectUrl>
<RepositoryUrl>https://github.com/Dirkster99/AvalonDock</RepositoryUrl>
Expand Down
3 changes: 3 additions & 0 deletions source/Components/AvalonDock.Themes.Aero/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,7 @@
<Setter Property="Padding" Value="5,0,5,0" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="AutomationProperties.Name" Value="{Binding LayoutElement.Title}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
Expand Down Expand Up @@ -1645,6 +1646,7 @@
Text="{x:Static avalonDockProperties:Resources.Active_ToolWindows}" />
<ListBox
x:Name="PART_AnchorableListBox"
AutomationProperties.Name="{x:Static avalonDockProperties:Resources.Active_ToolWindows}"
Grid.Row="1"
MaxHeight="400"
Background="Transparent"
Expand Down Expand Up @@ -1681,6 +1683,7 @@
Text="{x:Static avalonDockProperties:Resources.Active_Files}" />
<ListBox
x:Name="PART_DocumentListBox"
AutomationProperties.Name="{x:Static avalonDockProperties:Resources.Active_Files}"
Grid.Row="1"
MaxHeight="400"
Background="Transparent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.60.1</Version>
<AssemblyVersion>4.60.1</AssemblyVersion>
<FileVersion>4.60.1</FileVersion>
<PackageVersion>4.60.1</PackageVersion>
<Version>4.70.1</Version>
<AssemblyVersion>4.70.1</AssemblyVersion>
<FileVersion>4.70.1</FileVersion>
<PackageVersion>4.70.1</PackageVersion>
<Company>Open Source</Company>
<Product>Dirkster.AvalonDock</Product>
<Copyright>2017-2021</Copyright>
<Copyright>2017-2022</Copyright>
<Description>This assembly implements a docking layout system for WPF.</Description>
<PackageProjectUrl>https://github.com/Dirkster99/AvalonDock</PackageProjectUrl>
<RepositoryUrl>https://github.com/Dirkster99/AvalonDock</RepositoryUrl>
Expand Down
3 changes: 3 additions & 0 deletions source/Components/AvalonDock.Themes.Expression/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,7 @@
<Setter Property="Padding" Value="5,0,5,0" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="AutomationProperties.Name" Value="{Binding LayoutElement.Title}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
Expand Down Expand Up @@ -1547,6 +1548,7 @@
Text="{x:Static avalonDockProperties:Resources.Active_ToolWindows}" />
<ListBox
x:Name="PART_AnchorableListBox"
AutomationProperties.Name="{x:Static avalonDockProperties:Resources.Active_ToolWindows}"
Grid.Row="1"
MaxHeight="400"
Background="Transparent"
Expand Down Expand Up @@ -1583,6 +1585,7 @@
Text="{x:Static avalonDockProperties:Resources.Active_Files}" />
<ListBox
x:Name="PART_DocumentListBox"
AutomationProperties.Name="{x:Static avalonDockProperties:Resources.Active_Files}"
Grid.Row="1"
MaxHeight="400"
Background="Transparent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.60.1</Version>
<AssemblyVersion>4.60.1</AssemblyVersion>
<FileVersion>4.60.1</FileVersion>
<PackageVersion>4.60.1</PackageVersion>
<Version>4.70.1</Version>
<AssemblyVersion>4.70.1</AssemblyVersion>
<FileVersion>4.70.1</FileVersion>
<PackageVersion>4.70.1</PackageVersion>
<Company>Open Source</Company>
<Product>Dirkster.AvalonDock</Product>
<Copyright>2017-2021</Copyright>
<Copyright>2017-2022</Copyright>
<Description>This assembly implements a docking layout system for WPF.</Description>
<PackageProjectUrl>https://github.com/Dirkster99/AvalonDock</PackageProjectUrl>
<RepositoryUrl>https://github.com/Dirkster99/AvalonDock</RepositoryUrl>
Expand Down
3 changes: 3 additions & 0 deletions source/Components/AvalonDock.Themes.Metro/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,7 @@
<Setter Property="Padding" Value="5,0,5,0" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="AutomationProperties.Name" Value="{Binding LayoutElement.Title}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
Expand Down Expand Up @@ -1690,6 +1691,7 @@
Text="{x:Static avalonDockProperties:Resources.Active_ToolWindows}" />
<ListBox
x:Name="PART_AnchorableListBox"
AutomationProperties.Name="{x:Static avalonDockProperties:Resources.Active_ToolWindows}"
Grid.Row="1"
MaxHeight="400"
Background="Transparent"
Expand Down Expand Up @@ -1726,6 +1728,7 @@
Text="{x:Static avalonDockProperties:Resources.Active_Files}" />
<ListBox
x:Name="PART_DocumentListBox"
AutomationProperties.Name="{x:Static avalonDockProperties:Resources.Active_Files}"
Grid.Row="1"
MaxHeight="400"
Background="Transparent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.60.1</Version>
<AssemblyVersion>4.60.1</AssemblyVersion>
<FileVersion>4.60.1</FileVersion>
<PackageVersion>4.60.1</PackageVersion>
<Version>4.70.1</Version>
<AssemblyVersion>4.70.1</AssemblyVersion>
<FileVersion>4.70.1</FileVersion>
<PackageVersion>4.70.1</PackageVersion>
<Company>Open Source</Company>
<Product>Dirkster.AvalonDock</Product>
<Copyright>2017-2021</Copyright>
<Copyright>2017-2022</Copyright>
<Description>This assembly implements a docking layout system for WPF.</Description>
<PackageProjectUrl>https://github.com/Dirkster99/AvalonDock</PackageProjectUrl>
<RepositoryUrl>https://github.com/Dirkster99/AvalonDock</RepositoryUrl>
Expand Down
3 changes: 3 additions & 0 deletions source/Components/AvalonDock.Themes.VS2010/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,7 @@
<Setter Property="Padding" Value="5,0,5,0" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="AutomationProperties.Name" Value="{Binding LayoutElement.Title}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
Expand Down Expand Up @@ -1725,6 +1726,7 @@
Text="{x:Static avalonDockProperties:Resources.Active_ToolWindows}" />
<ListBox
x:Name="PART_AnchorableListBox"
AutomationProperties.Name="{x:Static avalonDockProperties:Resources.Active_ToolWindows}"
Grid.Row="1"
MaxHeight="400"
Background="Transparent"
Expand Down Expand Up @@ -1761,6 +1763,7 @@
Text="{x:Static avalonDockProperties:Resources.Active_Files}" />
<ListBox
x:Name="PART_DocumentListBox"
AutomationProperties.Name="{x:Static avalonDockProperties:Resources.Active_Files}"
Grid.Row="1"
MaxHeight="400"
Background="Transparent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.60.1</Version>
<AssemblyVersion>4.60.1</AssemblyVersion>
<FileVersion>4.60.1</FileVersion>
<PackageVersion>4.60.1</PackageVersion>
<Version>4.70.1</Version>
<AssemblyVersion>4.70.1</AssemblyVersion>
<FileVersion>4.70.1</FileVersion>
<PackageVersion>4.70.1</PackageVersion>
<Company>Open Source</Company>
<Product>Dirkster.AvalonDock</Product>
<Copyright>2017-2021</Copyright>
<Copyright>2017-2022</Copyright>
<Description>This assembly implements a docking layout system for WPF.</Description>
<PackageProjectUrl>https://github.com/Dirkster99/AvalonDock</PackageProjectUrl>
<RepositoryUrl>https://github.com/Dirkster99/AvalonDock</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2477,6 +2477,7 @@
<Setter Property="Padding" Value="5,0,5,0" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="AutomationProperties.Name" Value="{Binding LayoutElement.Title}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
Expand Down Expand Up @@ -2618,6 +2619,7 @@
Text="{x:Static avalonDockProperties:Resources.Active_ToolWindows}" />
<ListBox
x:Name="PART_AnchorableListBox"
AutomationProperties.Name="{x:Static avalonDockProperties:Resources.Active_ToolWindows}"
Grid.Row="1"
MaxHeight="400"
Background="Transparent"
Expand Down Expand Up @@ -2655,6 +2657,7 @@

<ListBox
x:Name="PART_DocumentListBox"
AutomationProperties.Name="{x:Static avalonDockProperties:Resources.Active_Files}"
Grid.Row="1"
MaxHeight="400"
Background="Transparent"
Expand Down
10 changes: 5 additions & 5 deletions source/Components/AvalonDock/AvalonDock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>4.60.1</Version>
<AssemblyVersion>4.60.1</AssemblyVersion>
<FileVersion>4.60.1</FileVersion>
<PackageVersion>4.60.1</PackageVersion>
<Version>4.70.1</Version>
<AssemblyVersion>4.70.1</AssemblyVersion>
<FileVersion>4.70.1</FileVersion>
<PackageVersion>4.70.1</PackageVersion>
<Company>Open Source</Company>
<Product>Dirkster.AvalonDock</Product>
<Copyright>2017-2021</Copyright>
<Copyright>2017-2022</Copyright>
<Description>This assembly implements a docking layout system for WPF.</Description>
<PackageProjectUrl>https://github.com/Dirkster99/AvalonDock</PackageProjectUrl>
<RepositoryUrl>https://github.com/Dirkster99/AvalonDock</RepositoryUrl>
Expand Down
17 changes: 10 additions & 7 deletions source/Components/AvalonDock/Controls/DragService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/************************************************************************
/************************************************************************
AvalonDock
Copyright (C) 2007-2013 Xceed Software Inc.
Expand Down Expand Up @@ -85,13 +85,14 @@ public DragService(LayoutFloatingWindowControl floatingWindow)
internal void UpdateMouseLocation(Point dragPosition)
{
////var floatingWindowModel = _floatingWindow.Model as LayoutFloatingWindow;
// TODO - pass in without DPI adjustment, screen co-ords, adjust inside the target window

var newHost = _overlayWindowHosts.FirstOrDefault(oh => oh.HitTest(dragPosition));
var newHost = _overlayWindowHosts.FirstOrDefault(oh => oh.HitTestScreen(dragPosition));

if (_currentHost != null || _currentHost != newHost)
{
//is mouse still inside current overlay window host?
if ((_currentHost != null && !_currentHost.HitTest(dragPosition)) ||
if ((_currentHost != null && !_currentHost.HitTestScreen(dragPosition)) ||
_currentHost != newHost)
{
//esit drop target
Expand Down Expand Up @@ -125,7 +126,7 @@ internal void UpdateMouseLocation(Point dragPosition)
return;

if (_currentDropTarget != null &&
!_currentDropTarget.HitTest(dragPosition))
!_currentDropTarget.HitTestScreen(dragPosition))
{
_currentWindow.DragLeave(_currentDropTarget);
_currentDropTarget = null;
Expand All @@ -134,8 +135,9 @@ internal void UpdateMouseLocation(Point dragPosition)
List<IDropArea> areasToRemove = new List<IDropArea>();
_currentWindowAreas.ForEach(a =>
{

//is mouse still inside this area?
if (!a.DetectionRect.Contains(dragPosition))
if (!a.DetectionRect.Contains(a.TransformToDeviceDPI(dragPosition)))
{
_currentWindow.DragLeave(a);
areasToRemove.Add(a);
Expand All @@ -146,7 +148,7 @@ internal void UpdateMouseLocation(Point dragPosition)
_currentWindowAreas.Remove(a));

var areasToAdd =
_currentHost.GetDropAreas(_floatingWindow).Where(cw => !_currentWindowAreas.Contains(cw) && cw.DetectionRect.Contains(dragPosition)).ToList();
_currentHost.GetDropAreas(_floatingWindow).Where(cw => !_currentWindowAreas.Contains(cw) && cw.DetectionRect.Contains(cw.TransformToDeviceDPI(dragPosition))).ToList();

_currentWindowAreas.AddRange(areasToAdd);

Expand All @@ -160,7 +162,7 @@ internal void UpdateMouseLocation(Point dragPosition)
if (_currentDropTarget != null)
return;

_currentDropTarget = _currentWindow.GetTargets().FirstOrDefault(dt => dt.HitTest(dragPosition));
_currentDropTarget = _currentWindow.GetTargets().FirstOrDefault(dt => dt.HitTestScreen(dragPosition));

if (_currentDropTarget != null)
{
Expand All @@ -185,6 +187,7 @@ internal void UpdateMouseLocation(Point dragPosition)
/// is docked into a new visual tree position).</param>
internal void Drop(Point dropLocation, out bool dropHandled)
{
// TODO - pass in without DPI adjustment, screen co-ords, adjust inside the target window
dropHandled = false;

UpdateMouseLocation(dropLocation);
Expand Down
9 changes: 8 additions & 1 deletion source/Components/AvalonDock/Controls/DropArea.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/************************************************************************
/************************************************************************
AvalonDock
Copyright (C) 2007-2013 Xceed Software Inc.
Expand Down Expand Up @@ -36,6 +36,8 @@ public interface IDropArea

/// <summary> Gets the type of drop area for this drop target.</summary>
DropAreaType Type { get; }

Point TransformToDeviceDPI(Point dragPosition);
}

/// <inheritdoc />
Expand Down Expand Up @@ -70,6 +72,11 @@ internal DropArea(T areaElement, DropAreaType type)
/// <inheritdoc />
public DropAreaType Type { get; }

public Point TransformToDeviceDPI(Point dragPosition)
{
return AreaElement.TransformToDeviceDPI(dragPosition);
}

#endregion IDropArea

#region Properties
Expand Down
12 changes: 9 additions & 3 deletions source/Components/AvalonDock/Controls/DropTarget.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/************************************************************************
/************************************************************************
AvalonDock
Copyright (C) 2007-2013 Xceed Software Inc.
Expand Down Expand Up @@ -106,6 +106,11 @@ protected virtual void Drop(LayoutDocumentFloatingWindow floatingWindow)

#region Public Methods

public bool HitTestScreen(Point dragPoint)
{
return HitTest(_targetElement.TransformToDeviceDPI(dragPoint));
}

public void Drop(LayoutFloatingWindow floatingWindow)
{
var root = floatingWindow.Root;
Expand All @@ -121,7 +126,8 @@ public void Drop(LayoutFloatingWindow floatingWindow)
var fwAsDocument = floatingWindow as LayoutDocumentFloatingWindow;
this.Drop(fwAsDocument);
}

if (currentActiveContent == null)
return;
Dispatcher.BeginInvoke(new Action(() =>
{
currentActiveContent.IsSelected = false;
Expand Down Expand Up @@ -149,4 +155,4 @@ public void DragLeave()

#endregion Public Methods
}
}
}
4 changes: 2 additions & 2 deletions source/Components/AvalonDock/Controls/IDropTarget.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/************************************************************************
/************************************************************************
AvalonDock
Copyright (C) 2007-2013 Xceed Software Inc.
Expand Down Expand Up @@ -48,7 +48,7 @@ internal interface IDropTarget
/// <summary>Determines whether the <paramref name="dragPoint"/> is part of this drop target or not.</summary>
/// <param name="dragPoint">The point to test.</param>
/// <returns><c>true</c> if it is inside the target.</returns>
bool HitTest(Point dragPoint);
bool HitTestScreen(Point dragPoint);

/// <summary>
/// Method is invoked to complete a drag & drop operation with a (new) docking position
Expand Down
Loading

0 comments on commit 7c661f1

Please sign in to comment.