diff --git a/source/Components/AvalonDock/Controls/LayoutPanelControl.cs b/source/Components/AvalonDock/Controls/LayoutPanelControl.cs index 4744f786..c859f124 100644 --- a/source/Components/AvalonDock/Controls/LayoutPanelControl.cs +++ b/source/Components/AvalonDock/Controls/LayoutPanelControl.cs @@ -1,4 +1,4 @@ -/************************************************************************ +/************************************************************************ AvalonDock Copyright (C) 2007-2013 Xceed Software Inc. @@ -9,6 +9,7 @@ This program is provided to you under the terms of the Microsoft Public using AvalonDock.Layout; using System; +using System.Linq; using System.Windows; using System.Windows.Controls; @@ -61,6 +62,23 @@ protected override void OnFixChildrenDockLengths() { var childPositionableModelWidthActualSize = _model.Children[i] as ILayoutPositionableElement as ILayoutPositionableElementWithActualSize; var childDockMinWidth = (_model.Children[i] as ILayoutPositionableElement).CalculatedDockMinWidth(); + if (childPositionableModelWidthActualSize.ActualWidth == 0) + { + if (childPositionableModelWidthActualSize.DockWidth.IsStar) + { + childPositionableModelWidthActualSize.ActualWidth = (ActualWidth - _model.Children.Cast() + .Where(j => j.DockWidth.IsAbsolute) + .Select(j => j.DockWidth.Value) + .Sum()) * childPositionableModelWidthActualSize.DockWidth.Value / _model.Children.Cast() + .Where(j => j.DockWidth.IsStar) + .Select(j => j.DockWidth.Value) + .Sum(); + } + else if (childPositionableModelWidthActualSize.DockWidth.IsAbsolute) + { + childPositionableModelWidthActualSize.ActualWidth = childPositionableModelWidthActualSize.DockWidth.Value; + } + } var widthToSet = Math.Max(childPositionableModelWidthActualSize.ActualWidth, childDockMinWidth); widthToSet = Math.Min(widthToSet, ActualWidth / 2.0); @@ -99,6 +117,23 @@ protected override void OnFixChildrenDockLengths() { var childPositionableModelWidthActualSize = _model.Children[i] as ILayoutPositionableElement as ILayoutPositionableElementWithActualSize; var childDockMinHeight = (_model.Children[i] as ILayoutPositionableElement).CalculatedDockMinHeight(); + if (childPositionableModelWidthActualSize.ActualHeight == 0) + { + if (childPositionableModelWidthActualSize.DockHeight.IsStar) + { + childPositionableModelWidthActualSize.ActualHeight = ((ActualHeight - _model.Children.Cast() + .Where(j => j.DockHeight.IsAbsolute) + .Select(j => j.DockHeight.Value) + .Sum())) * childPositionableModelWidthActualSize.DockHeight.Value / _model.Children.Cast() + .Where(j => j.DockHeight.IsStar) + .Select(j => j.DockHeight.Value) + .Sum(); + } + else if (childPositionableModelWidthActualSize.DockHeight.IsAbsolute) + { + childPositionableModelWidthActualSize.ActualHeight = childPositionableModelWidthActualSize.DockHeight.Value; + } + } var heightToSet = Math.Max(childPositionableModelWidthActualSize.ActualHeight, childDockMinHeight); heightToSet = Math.Min(heightToSet, ActualHeight / 2.0); heightToSet = Math.Max(heightToSet, childDockMinHeight); diff --git a/source/Components/AvalonDock/Themes/generic.xaml b/source/Components/AvalonDock/Themes/generic.xaml index b958e806..b086a180 100644 --- a/source/Components/AvalonDock/Themes/generic.xaml +++ b/source/Components/AvalonDock/Themes/generic.xaml @@ -1,1314 +1,1317 @@ + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:avalonDock="clr-namespace:AvalonDock" + xmlns:avalonDockControls="clr-namespace:AvalonDock.Controls" + xmlns:avalonDockConverters="clr-namespace:AvalonDock.Converters" + xmlns:avalonDockLayout="clr-namespace:AvalonDock.Layout" + xmlns:avalonDockProperties="clr-namespace:AvalonDock.Properties" + xmlns:shell="clr-namespace:Microsoft.Windows.Shell"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - + + + + + - + - - - + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - + + - - + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + - + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - +