Browse Source
Merge branch 'master' into x11-remove-transient-hint
pull/3712/head
danwalmsley
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
4 deletions
-
samples/ControlCatalog/MainView.xaml.cs
-
src/Avalonia.Controls/Remote/RemoteWidget.cs
|
|
|
@ -60,8 +60,8 @@ namespace ControlCatalog |
|
|
|
var decorations = this.Find<ComboBox>("Decorations"); |
|
|
|
decorations.SelectionChanged += (sender, e) => |
|
|
|
{ |
|
|
|
Window window = (Window)VisualRoot; |
|
|
|
window.SystemDecorations = (SystemDecorations)decorations.SelectedIndex; |
|
|
|
if (VisualRoot is Window window) |
|
|
|
window.SystemDecorations = (SystemDecorations)decorations.SelectedIndex; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
@ -69,7 +69,8 @@ namespace ControlCatalog |
|
|
|
{ |
|
|
|
base.OnAttachedToVisualTree(e); |
|
|
|
var decorations = this.Find<ComboBox>("Decorations"); |
|
|
|
decorations.SelectedIndex = (int)((Window)VisualRoot).SystemDecorations; |
|
|
|
if (VisualRoot is Window window) |
|
|
|
decorations.SelectedIndex = (int)window.SystemDecorations; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -75,7 +75,11 @@ namespace Avalonia.Controls.Remote |
|
|
|
var fmt = (PixelFormat) _lastFrame.Format; |
|
|
|
if (_bitmap == null || _bitmap.PixelSize.Width != _lastFrame.Width || |
|
|
|
_bitmap.PixelSize.Height != _lastFrame.Height) |
|
|
|
_bitmap = new WriteableBitmap(new PixelSize(_lastFrame.Width, _lastFrame.Height), new Vector(96, 96), fmt); |
|
|
|
{ |
|
|
|
_bitmap?.Dispose(); |
|
|
|
_bitmap = new WriteableBitmap(new PixelSize(_lastFrame.Width, _lastFrame.Height), |
|
|
|
new Vector(96, 96), fmt); |
|
|
|
} |
|
|
|
using (var l = _bitmap.Lock()) |
|
|
|
{ |
|
|
|
var lineLen = (fmt == PixelFormat.Rgb565 ? 2 : 4) * _lastFrame.Width; |
|
|
|
|