Browse Source

Merge branch 'master' into fixes/2316-selectorparser-null-type

pull/2317/head
Steven Kirk 7 years ago
committed by GitHub
parent
commit
690bac6be5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      samples/RenderDemo/SideBar.xaml
  2. 16
      src/Avalonia.X11/X11Window.cs

8
samples/RenderDemo/SideBar.xaml

@ -1,5 +1,5 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style Selector="TabControl.sidebar">
<Setter Property="TabStripPlacement" Value="Left"/>
<Setter Property="Padding" Value="8 0 0 0"/>
@ -17,7 +17,7 @@
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"
Background="{TemplateBinding Background}">
<ItemsPresenter
Name="PART_ItemsPresenter"
Name="PART_ItemsPresenter"
Items="{TemplateBinding Items}"
ItemsPanel="{TemplateBinding ItemsPanel}"
ItemTemplate="{TemplateBinding ItemTemplate}"
@ -25,7 +25,7 @@
</ItemsPresenter>
</ScrollViewer>
<ContentPresenter
Name="PART_Content"
Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
@ -63,4 +63,4 @@
<Style Selector="TabControl.sidebar > TabItem:selected /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush2}"/>
</Style>
</Styles>
</Styles>

16
src/Avalonia.X11/X11Window.cs

@ -557,8 +557,14 @@ namespace Avalonia.X11
private bool _systemDecorations = true;
private bool _canResize = true;
private (Size minSize, Size maxSize) _scaledMinMaxSize;
private (PixelSize minSize, PixelSize maxSize) _minMaxSize;
private const int MaxWindowDimension = 100000;
private (Size minSize, Size maxSize) _scaledMinMaxSize =
(new Size(1, 1), new Size(double.PositiveInfinity, double.PositiveInfinity));
private (PixelSize minSize, PixelSize maxSize) _minMaxSize = (new PixelSize(1, 1),
new PixelSize(MaxWindowDimension, MaxWindowDimension));
private double _scaling = 1;
void ScheduleInput(RawInputEventArgs args, ref XEvent xev)
@ -874,10 +880,10 @@ namespace Avalonia.X11
(int)(minSize.Width < 1 ? 1 : minSize.Width * Scaling),
(int)(minSize.Height < 1 ? 1 : minSize.Height * Scaling));
const int maxDim = 100000;
const int maxDim = MaxWindowDimension;
var max = new PixelSize(
(int)(maxSize.Width > maxDim ? maxDim : Math.Max(min.Width, minSize.Width * Scaling)),
(int)(maxSize.Height > maxDim ? maxDim : Math.Max(min.Height, minSize.Height * Scaling)));
(int)(maxSize.Width > maxDim ? maxDim : Math.Max(min.Width, maxSize.Width * Scaling)),
(int)(maxSize.Height > maxDim ? maxDim : Math.Max(min.Height, maxSize.Height * Scaling)));
_minMaxSize = (min, max);
UpdateSizeHints(null);

Loading…
Cancel
Save