Browse Source
Merge branch 'AvaloniaUI:master' into fix-progressbar-indicator-size-issue
pull/9371/head
zhijun zhou
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
19 additions and
4 deletions
-
src/Avalonia.Base/Layout/UniformGridLayoutState.cs
-
src/Linux/Avalonia.LinuxFramebuffer/DrmOutputOptions.cs
-
src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs
|
|
|
@ -117,12 +117,12 @@ namespace Avalonia.Layout |
|
|
|
double extraMinorPixelsForEachItem = 0.0; |
|
|
|
if (!double.IsInfinity(availableSizeMinor)) |
|
|
|
{ |
|
|
|
var numItemsPerColumn = Math.Min( |
|
|
|
var numItemsPerColumn = (int)Math.Min( |
|
|
|
maxItemsPerLine, |
|
|
|
Math.Max(1.0, availableSizeMinor / (itemSizeMinor + minorItemSpacing))); |
|
|
|
var usedSpace = (numItemsPerColumn * (itemSizeMinor + minorItemSpacing)) - minorItemSpacing; |
|
|
|
var remainingSpace = ((int)(availableSizeMinor - usedSpace)); |
|
|
|
extraMinorPixelsForEachItem = remainingSpace / ((int)numItemsPerColumn); |
|
|
|
var remainingSpace = availableSizeMinor - usedSpace; |
|
|
|
extraMinorPixelsForEachItem = (int)(remainingSpace / numItemsPerColumn); |
|
|
|
} |
|
|
|
|
|
|
|
if (stretch == UniformGridLayoutItemsStretch.Fill) |
|
|
|
|
|
|
|
@ -23,5 +23,11 @@ namespace Avalonia.LinuxFramebuffer |
|
|
|
/// Default: R0 G0 B0 A0
|
|
|
|
/// </summary>
|
|
|
|
public Color InitialBufferSwappingColor { get; set; } = new Color(0, 0, 0, 0); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// specific the video mode with which the DrmOutput should be created, if it is not found it will fallback to the preferred mode.
|
|
|
|
/// If NULL preferred mode will be used.
|
|
|
|
/// </summary>
|
|
|
|
public PixelSize? VideoMode { get; set; } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -51,7 +51,16 @@ namespace Avalonia.LinuxFramebuffer.Output |
|
|
|
if(connector == null) |
|
|
|
throw new InvalidOperationException("Unable to find connected DRM connector"); |
|
|
|
|
|
|
|
var mode = connector.Modes.OrderByDescending(x => x.IsPreferred) |
|
|
|
DrmModeInfo? mode = null; |
|
|
|
|
|
|
|
if (options?.VideoMode != null) |
|
|
|
{ |
|
|
|
mode = connector.Modes |
|
|
|
.FirstOrDefault(x => x.Resolution.Width == options.VideoMode.Value.Width && |
|
|
|
x.Resolution.Height == options.VideoMode.Value.Height); |
|
|
|
} |
|
|
|
|
|
|
|
mode ??= connector.Modes.OrderByDescending(x => x.IsPreferred) |
|
|
|
.ThenByDescending(x => x.Resolution.Width * x.Resolution.Height) |
|
|
|
//.OrderByDescending(x => x.Resolution.Width * x.Resolution.Height)
|
|
|
|
.FirstOrDefault(); |
|
|
|
|