Skip to content

Commit

Permalink
V4.5.0 Released
Browse files Browse the repository at this point in the history
  • Loading branch information
XceedBoucherS committed Nov 25, 2022
1 parent ff6ba4a commit c110ea7
Show file tree
Hide file tree
Showing 33 changed files with 756 additions and 87 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1314,10 +1314,10 @@
<Setter Property="BorderBrush"
Value="{DynamicResource {x:Static avalonDockAero:AeroColors.BaseColor14Key}}" />
<Setter Property="BorderThickness"
Value="1" />
Value="3" />
<Setter Property="shell:WindowChrome.WindowChrome">
<Setter.Value>
<shell:WindowChrome ResizeBorderThickness="10"
<shell:WindowChrome ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}}}"
CaptionHeight="18"
CornerRadius="3"
GlassFrameThickness="0"
Expand Down Expand Up @@ -1491,10 +1491,10 @@
<Setter Property="BorderBrush"
Value="{DynamicResource {x:Static avalonDockAero:AeroColors.BaseColor16Key}}" />
<Setter Property="BorderThickness"
Value="4" />
Value="3" />
<Setter Property="shell:WindowChrome.WindowChrome">
<Setter.Value>
<shell:WindowChrome ResizeBorderThickness="10"
<shell:WindowChrome ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}}}"
CaptionHeight="18"
CornerRadius="7"
GlassFrameThickness="0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,11 +1357,11 @@
<Setter Property="BorderBrush"
Value="{DynamicResource AvalonDock_ThemeMetro_BaseColor6}" />
<Setter Property="BorderThickness"
Value="1" />
Value="3" />
<Setter Property="shell:WindowChrome.WindowChrome">
<Setter.Value>
<shell:WindowChrome CornerRadius="0"
ResizeBorderThickness="10"
ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}}}"
CaptionHeight="24"
GlassFrameThickness="0"
ShowSystemMenu="False" />
Expand Down Expand Up @@ -1548,11 +1548,11 @@
<Setter Property="BorderBrush"
Value="{DynamicResource AvalonDock_ThemeMetro_BaseColor6}" />
<Setter Property="BorderThickness"
Value="1" />
Value="3" />
<Setter Property="shell:WindowChrome.WindowChrome">
<Setter.Value>
<shell:WindowChrome CornerRadius="0"
ResizeBorderThickness="10"
ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}}}"
CaptionHeight="24"
GlassFrameThickness="0" />
</Setter.Value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1456,10 +1456,10 @@
<Setter Property="BorderBrush"
Value="{DynamicResource AvalonDock_ThemeVS2010_BaseColor33}" />
<Setter Property="BorderThickness"
Value="1" />
Value="3" />
<Setter Property="shell:WindowChrome.WindowChrome">
<Setter.Value>
<shell:WindowChrome ResizeBorderThickness="10"
<shell:WindowChrome ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutDocumentFloatingWindowControl}}}"
CaptionHeight="18"
CornerRadius="3"
GlassFrameThickness="0"
Expand Down Expand Up @@ -1683,10 +1683,10 @@
<Setter Property="BorderBrush"
Value="{DynamicResource AvalonDock_ThemeVS2010_BaseColor16}" />
<Setter Property="BorderThickness"
Value="4" />
Value="3" />
<Setter Property="shell:WindowChrome.WindowChrome">
<Setter.Value>
<shell:WindowChrome ResizeBorderThickness="10"
<shell:WindowChrome ResizeBorderThickness="{Binding ResizeBorderThickness, RelativeSource={RelativeSource AncestorType={x:Type avalonDockControls:LayoutAnchorableFloatingWindowControl}}}"
CaptionHeight="18"
CornerRadius="7"
GlassFrameThickness="0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,32 @@ public void Drop( LayoutFloatingWindow floatingWindow )
{
var root = floatingWindow.Root;
var currentActiveContent = floatingWindow.Root.ActiveContent;
var manager = root.Manager;
var fwAsAnchorable = floatingWindow as LayoutAnchorableFloatingWindow;

if( fwAsAnchorable != null )
{
// Raise PreviewDock Event
var draggedLayoutAnchorable = floatingWindow.Descendents().OfType<LayoutAnchorable>().FirstOrDefault( l => l != null );
manager.RaisePreviewDockEvent( draggedLayoutAnchorable );

this.Drop( fwAsAnchorable );

// Raise Dock Event
manager.RaiseDockedEvent( draggedLayoutAnchorable );
}
else
{
var fwAsDocument = floatingWindow as LayoutDocumentFloatingWindow;

// Raise PreviewDock Event
var draggedLayoutDocument = floatingWindow.Descendents().OfType<LayoutDocument>().FirstOrDefault( l => l != null );
manager.RaisePreviewDockEvent( draggedLayoutDocument );

this.Drop( fwAsDocument );

// Raise Dock Event
manager.RaiseDockedEvent( draggedLayoutDocument );
}

if( currentActiveContent != null )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,14 @@ public static T FindLogicalAncestor<T>( this DependencyObject dependencyObject )
while( target != null && !( target is T ) );
return target as T;
}

public static IEnumerable<DependencyObject> FindLogicalAncestorsAndSelf( this DependencyObject self )
{
while( self != null )
{
yield return self;
self = LogicalTreeHelper.GetParent( self ) ?? VisualTreeHelper.GetParent( self );
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class LayoutDocumentTabItem : Control
private List<Rect> _otherTabsScreenArea = null;
private List<TabItem> _otherTabs = null;
private Rect _parentDocumentTabPanelScreenArea;
private DocumentPaneTabPanel _parentDocumentTabPanel;
private Panel _parentTabPanel;
private bool _isMouseDown = false;
private Point _mouseDownPoint;
private double _mouseLastChangePositionX;
Expand Down Expand Up @@ -220,7 +220,7 @@ protected override void OnMouseMove( System.Windows.Input.MouseEventArgs e )
containerPane.MoveChild( currentIndex, newIndex );
_dragBuffer = MaxDragBuffer;
this.Model.IsActive = true;
_parentDocumentTabPanel.UpdateLayout();
_parentTabPanel.UpdateLayout();
this.UpdateDragDetails();
_mouseLastChangePositionX = mousePosInScreenCoord.X;
}
Expand Down Expand Up @@ -271,10 +271,19 @@ protected override void OnMouseDown( MouseButtonEventArgs e )

private void UpdateDragDetails()
{
_parentDocumentTabPanel = this.FindLogicalAncestor<DocumentPaneTabPanel>();
_parentDocumentTabPanelScreenArea = _parentDocumentTabPanel.GetScreenArea();
_parentTabPanel = this.FindLogicalAncestor<DocumentPaneTabPanel>();

if( _parentTabPanel == null )
{
_parentTabPanel = this.GetParentPanel();
}

if( _parentTabPanel == null )
return;

_parentDocumentTabPanelScreenArea = _parentTabPanel.GetScreenArea();
_parentDocumentTabPanelScreenArea.Inflate( 0, _dragBuffer );
_otherTabs = _parentDocumentTabPanel.Children.Cast<TabItem>().Where( ch => ch.Visibility != System.Windows.Visibility.Collapsed ).ToList();
_otherTabs = _parentTabPanel.Children.Cast<TabItem>().Where( ch => ch.Visibility != System.Windows.Visibility.Collapsed ).ToList();
var currentTabScreenArea = this.FindLogicalAncestor<TabItem>().GetScreenArea();
_otherTabsScreenArea = _otherTabs.Select( ti =>
{
Expand All @@ -285,6 +294,21 @@ private void UpdateDragDetails()
} ).ToList();
}

private Panel GetParentPanel()
{
var parents = this.FindLogicalAncestorsAndSelf();

foreach( var parent in parents )
{
var panel = parent as Panel;
if( panel != null && ( panel.Children[ 0 ] as TabItem ) != null )
{
return panel;
}
}
return null;
}

private void StartDraggingFloatingWindowForContent()
{
this.ReleaseMouseCapture();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,45 @@ protected override void OnStateChanged( EventArgs e )
}
}

if( this.WindowState == WindowState.Normal )
{
this.UpdatePositionAndSizeOfPanes();
}

base.OnStateChanged( e );
}

#endregion

#region ResizeBorderThickness

/// <summary>
/// ResizeBorderThickness Dependency Property
/// </summary>
public static readonly DependencyProperty ResizeBorderThicknessProperty = DependencyProperty.Register(
"ResizeBorderThickness",
typeof( Thickness ),
typeof( LayoutFloatingWindowControl ),
new FrameworkPropertyMetadata( new Thickness( 10 ) ) );

/// <summary>
/// Gets or sets the LayoutDocumentFloatingWindowControl/LayoutAnchorableFloatingWindowControl resize icon Border Thickness property.
/// This dependency property makes it possible to increase the resize icon border of floating windows.
/// </summary>
public Thickness ResizeBorderThickness
{
get
{
return ( Thickness )GetValue( ResizeBorderThicknessProperty );
}
set
{
SetValue( ResizeBorderThicknessProperty, value );
}
}

#endregion

#endregion

#region Overrides
Expand All @@ -264,10 +298,13 @@ protected override void OnClosing( System.ComponentModel.CancelEventArgs e )

protected override void OnClosed( EventArgs e )
{
var root = this.Model.Root;
var root = ( this.Model != null ) ? this.Model.Root : null;
if( root != null )
{
root.Manager.RemoveFloatingWindow( this );
if( root.Manager != null )
{
root.Manager.RemoveFloatingWindow( this );
}
root.CollectGarbage();
}

Expand Down Expand Up @@ -305,6 +342,34 @@ protected override void OnInitialized( EventArgs e )
base.OnInitialized( e );
}

protected override void OnKeyDown( KeyEventArgs e )
{
var root = this.Model.Root;
if( root != null )
{
if( root.Manager.AllowMovingFloatingWindowWithKeyboard )
{
switch( e.Key )
{
case Key.Left:
this.Left -= 25;
break;
case Key.Right:
this.Left += 25;
break;
case Key.Up:
this.Top -= 25;
break;
case Key.Down:
this.Top += 25;
break;
}
}
}

base.OnKeyDown( e );
}

protected override void OnPreviewKeyDown( KeyEventArgs e )
{
if( Keyboard.IsKeyDown( Key.LeftCtrl ) || Keyboard.IsKeyDown( Key.RightCtrl ) )
Expand Down Expand Up @@ -499,7 +564,7 @@ internal void InternalClose()
_isClosing = true;

// Added Dispatcher to prevent InvalidOperationException issue in reference to bug case
// DevOps #2106
// Azure case #2106
Dispatcher.BeginInvoke( new Action( () =>
{
this.Close();
Expand Down
Loading

0 comments on commit c110ea7

Please sign in to comment.