diff --git a/Perspex.Windows/Window.cs b/Perspex.Windows/Window.cs index 52001ec063..ee93c754f0 100644 --- a/Perspex.Windows/Window.cs +++ b/Perspex.Windows/Window.cs @@ -69,7 +69,7 @@ protected override Visual DefaultTemplate() { Border border = new Border(); - border.Background = new Perspex.Media.SolidColorBrush(0xff808080); + border.Background = new Perspex.Media.SolidColorBrush(0xffffffff); ContentPresenter contentPresenter = new ContentPresenter(); contentPresenter.Bind(ContentPresenter.ContentProperty, this.GetObservable(ContentProperty)); border.Content = contentPresenter; diff --git a/Perspex/Controls/Button.cs b/Perspex/Controls/Button.cs index 95cd6cb3d7..85126b762b 100644 --- a/Perspex/Controls/Button.cs +++ b/Perspex/Controls/Button.cs @@ -14,6 +14,7 @@ namespace Perspex.Controls border.Background = new Perspex.Media.SolidColorBrush(0xff808080); border.BorderBrush = new Perspex.Media.SolidColorBrush(0xff000000); border.BorderThickness = 2; + border.Padding = new Thickness(3); ContentPresenter contentPresenter = new ContentPresenter(); contentPresenter.Bind(ContentPresenter.ContentProperty, this.GetObservable(ContentProperty)); border.Content = contentPresenter; diff --git a/Perspex/Controls/Decorator.cs b/Perspex/Controls/Decorator.cs index 4d28c8b5e0..35fd73768b 100644 --- a/Perspex/Controls/Decorator.cs +++ b/Perspex/Controls/Decorator.cs @@ -9,6 +9,9 @@ public static readonly PerspexProperty ContentProperty = PerspexProperty.Register("Content"); + public static readonly PerspexProperty PaddingProperty = + PerspexProperty.Register("Padding"); + public Decorator() { // TODO: Unset old content's visual parent. @@ -27,6 +30,12 @@ set { this.SetValue(ContentProperty, value); } } + public Thickness Padding + { + get { return this.GetValue(PaddingProperty); } + set { this.SetValue(PaddingProperty, value); } + } + public override IEnumerable VisualChildren { get @@ -42,7 +51,7 @@ if (content != null) { - content.Arrange(new Rect(finalSize)); + content.Arrange(new Rect(finalSize).Deflate(this.Padding)); } return finalSize; @@ -55,7 +64,7 @@ if (content != null) { content.Measure(availableSize); - return content.DesiredSize.Value; + return content.DesiredSize.Value.Inflate(this.Padding); } else {