Missing maui compliance
This commit is contained in:
@@ -143,12 +143,7 @@ public partial class LayoutHandler : ViewHandler<ILayout, SkiaLayoutView>
|
||||
|
||||
if (layout is IPadding paddable)
|
||||
{
|
||||
var padding = paddable.Padding;
|
||||
handler.PlatformView.Padding = new SKRect(
|
||||
(float)padding.Left,
|
||||
(float)padding.Top,
|
||||
(float)padding.Right,
|
||||
(float)padding.Bottom);
|
||||
handler.PlatformView.Padding = paddable.Padding;
|
||||
handler.PlatformView.InvalidateMeasure();
|
||||
handler.PlatformView.Invalidate();
|
||||
}
|
||||
@@ -262,11 +257,7 @@ public partial class GridHandler : LayoutHandler
|
||||
if (VirtualView is IPadding paddable)
|
||||
{
|
||||
var padding = paddable.Padding;
|
||||
platformView.Padding = new SKRect(
|
||||
(float)padding.Left,
|
||||
(float)padding.Top,
|
||||
(float)padding.Right,
|
||||
(float)padding.Bottom);
|
||||
platformView.Padding = padding;
|
||||
Console.WriteLine($"[GridHandler] Applied Padding: L={padding.Left}, T={padding.Top}, R={padding.Right}, B={padding.Bottom}");
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ public static class LinuxProgramHost
|
||||
Spacing = 15,
|
||||
BackgroundColor = Color.FromRgb(0xF5, 0xF5, 0xF5)
|
||||
};
|
||||
root.Padding = new SKRect(20, 20, 20, 20);
|
||||
root.Padding = new Thickness(20, 20, 20, 20);
|
||||
|
||||
// ========== TITLE ==========
|
||||
root.AddChild(new SkiaLabel
|
||||
|
||||
@@ -66,12 +66,12 @@ public class SkiaCarouselView : SkiaLayoutView
|
||||
/// <summary>
|
||||
/// Gets or sets the peek amount (how much of adjacent items to show).
|
||||
/// </summary>
|
||||
public float PeekAreaInsets { get; set; } = 0f;
|
||||
public double PeekAreaInsets { get; set; } = 0.0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the spacing between items.
|
||||
/// </summary>
|
||||
public float ItemSpacing { get; set; } = 0f;
|
||||
public double ItemSpacing { get; set; } = 0.0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether swipe gestures are enabled.
|
||||
@@ -204,20 +204,20 @@ public class SkiaCarouselView : SkiaLayoutView
|
||||
|
||||
private float GetOffsetForPosition(int position)
|
||||
{
|
||||
float itemWidth = Bounds.Width - PeekAreaInsets * 2;
|
||||
return position * (itemWidth + ItemSpacing);
|
||||
float itemWidth = Bounds.Width - (float)PeekAreaInsets * 2;
|
||||
return position * (itemWidth + (float)ItemSpacing);
|
||||
}
|
||||
|
||||
private int GetPositionForOffset(float offset)
|
||||
{
|
||||
float itemWidth = Bounds.Width - PeekAreaInsets * 2;
|
||||
float itemWidth = Bounds.Width - (float)PeekAreaInsets * 2;
|
||||
if (itemWidth <= 0) return 0;
|
||||
return Math.Clamp((int)Math.Round(offset / (itemWidth + ItemSpacing)), 0, Math.Max(0, _items.Count - 1));
|
||||
return Math.Clamp((int)Math.Round(offset / (itemWidth + (float)ItemSpacing)), 0, Math.Max(0, _items.Count - 1));
|
||||
}
|
||||
|
||||
protected override SKSize MeasureOverride(SKSize availableSize)
|
||||
{
|
||||
float itemWidth = availableSize.Width - PeekAreaInsets * 2;
|
||||
float itemWidth = availableSize.Width - (float)PeekAreaInsets * 2;
|
||||
float itemHeight = availableSize.Height - (ShowIndicators ? 30 : 0);
|
||||
|
||||
foreach (var item in _items)
|
||||
@@ -230,12 +230,12 @@ public class SkiaCarouselView : SkiaLayoutView
|
||||
|
||||
protected override SKRect ArrangeOverride(SKRect bounds)
|
||||
{
|
||||
float itemWidth = bounds.Width - PeekAreaInsets * 2;
|
||||
float itemWidth = bounds.Width - (float)PeekAreaInsets * 2;
|
||||
float itemHeight = bounds.Height - (ShowIndicators ? 30 : 0);
|
||||
|
||||
for (int i = 0; i < _items.Count; i++)
|
||||
{
|
||||
float x = bounds.Left + PeekAreaInsets + i * (itemWidth + ItemSpacing) - _scrollOffset;
|
||||
float x = bounds.Left + (float)PeekAreaInsets + i * (itemWidth + (float)ItemSpacing) - _scrollOffset;
|
||||
var itemBounds = new SKRect(x, bounds.Top, x + itemWidth, bounds.Top + itemHeight);
|
||||
_items[i].Arrange(itemBounds);
|
||||
}
|
||||
@@ -271,12 +271,12 @@ public class SkiaCarouselView : SkiaLayoutView
|
||||
canvas.ClipRect(bounds);
|
||||
|
||||
// Draw visible items
|
||||
float itemWidth = bounds.Width - PeekAreaInsets * 2;
|
||||
float itemWidth = bounds.Width - (float)PeekAreaInsets * 2;
|
||||
float contentHeight = bounds.Height - (ShowIndicators ? 30 : 0);
|
||||
|
||||
for (int i = 0; i < _items.Count; i++)
|
||||
{
|
||||
float x = bounds.Left + PeekAreaInsets + i * (itemWidth + ItemSpacing) - _scrollOffset;
|
||||
float x = bounds.Left + (float)PeekAreaInsets + i * (itemWidth + (float)ItemSpacing) - _scrollOffset;
|
||||
|
||||
// Only draw visible items
|
||||
if (x + itemWidth > bounds.Left && x < bounds.Right)
|
||||
@@ -389,7 +389,7 @@ public class SkiaCarouselView : SkiaLayoutView
|
||||
_isDragging = false;
|
||||
|
||||
// Determine target position based on velocity and position
|
||||
float itemWidth = Bounds.Width - PeekAreaInsets * 2;
|
||||
float itemWidth = Bounds.Width - (float)PeekAreaInsets * 2;
|
||||
int targetPosition = GetPositionForOffset(_scrollOffset);
|
||||
|
||||
// Apply velocity influence
|
||||
|
||||
@@ -205,7 +205,7 @@ public class SkiaCollectionView : SkiaItemsView
|
||||
}
|
||||
|
||||
/// <summary>Gets the SKColor for rendering selection highlight.</summary>
|
||||
public SKColor SelectionColorSK => _selectionColorSK;
|
||||
internal SKColor SelectionColorSK => _selectionColorSK;
|
||||
|
||||
public Color HeaderBackgroundColor
|
||||
{
|
||||
@@ -214,7 +214,7 @@ public class SkiaCollectionView : SkiaItemsView
|
||||
}
|
||||
|
||||
/// <summary>Gets the SKColor for rendering header background.</summary>
|
||||
public SKColor HeaderBackgroundColorSK => _headerBackgroundColorSK;
|
||||
internal SKColor HeaderBackgroundColorSK => _headerBackgroundColorSK;
|
||||
|
||||
public Color FooterBackgroundColor
|
||||
{
|
||||
@@ -223,7 +223,7 @@ public class SkiaCollectionView : SkiaItemsView
|
||||
}
|
||||
|
||||
/// <summary>Gets the SKColor for rendering footer background.</summary>
|
||||
public SKColor FooterBackgroundColorSK => _footerBackgroundColorSK;
|
||||
internal SKColor FooterBackgroundColorSK => _footerBackgroundColorSK;
|
||||
|
||||
public event EventHandler<CollectionSelectionChangedEventArgs>? SelectionChanged;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using Microsoft.Maui.Graphics;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Microsoft.Maui.Platform;
|
||||
@@ -27,7 +28,7 @@ public class SkiaContentPresenter : SkiaView
|
||||
propertyChanged: (b, o, n) => ((SkiaContentPresenter)b).InvalidateMeasure());
|
||||
|
||||
public static readonly BindableProperty PaddingProperty =
|
||||
BindableProperty.Create(nameof(Padding), typeof(SKRect), typeof(SkiaContentPresenter), SKRect.Empty,
|
||||
BindableProperty.Create(nameof(Padding), typeof(Thickness), typeof(SkiaContentPresenter), default(Thickness),
|
||||
propertyChanged: (b, o, n) => ((SkiaContentPresenter)b).InvalidateMeasure());
|
||||
|
||||
#endregion
|
||||
@@ -64,9 +65,9 @@ public class SkiaContentPresenter : SkiaView
|
||||
/// <summary>
|
||||
/// Gets or sets the padding around the content.
|
||||
/// </summary>
|
||||
public SKRect Padding
|
||||
public Thickness Padding
|
||||
{
|
||||
get => (SKRect)GetValue(PaddingProperty);
|
||||
get => (Thickness)GetValue(PaddingProperty);
|
||||
set => SetValue(PaddingProperty, value);
|
||||
}
|
||||
|
||||
@@ -127,23 +128,27 @@ public class SkiaContentPresenter : SkiaView
|
||||
protected override SKSize MeasureOverride(SKSize availableSize)
|
||||
{
|
||||
var padding = Padding;
|
||||
var paddingLeft = (float)padding.Left;
|
||||
var paddingTop = (float)padding.Top;
|
||||
var paddingRight = (float)padding.Right;
|
||||
var paddingBottom = (float)padding.Bottom;
|
||||
|
||||
if (Content == null)
|
||||
return new SKSize(padding.Left + padding.Right, padding.Top + padding.Bottom);
|
||||
return new SKSize(paddingLeft + paddingRight, paddingTop + paddingBottom);
|
||||
|
||||
// When alignment is not Fill, give content unlimited size in that dimension
|
||||
// so it can measure its natural size without truncation
|
||||
var measureWidth = HorizontalContentAlignment == LayoutAlignment.Fill
|
||||
? Math.Max(0, availableSize.Width - padding.Left - padding.Right)
|
||||
? Math.Max(0, availableSize.Width - paddingLeft - paddingRight)
|
||||
: float.PositiveInfinity;
|
||||
var measureHeight = VerticalContentAlignment == LayoutAlignment.Fill
|
||||
? Math.Max(0, availableSize.Height - padding.Top - padding.Bottom)
|
||||
? Math.Max(0, availableSize.Height - paddingTop - paddingBottom)
|
||||
: float.PositiveInfinity;
|
||||
|
||||
var contentSize = Content.Measure(new SKSize(measureWidth, measureHeight));
|
||||
return new SKSize(
|
||||
contentSize.Width + padding.Left + padding.Right,
|
||||
contentSize.Height + padding.Top + padding.Bottom);
|
||||
contentSize.Width + paddingLeft + paddingRight,
|
||||
contentSize.Height + paddingTop + paddingBottom);
|
||||
}
|
||||
|
||||
protected override SKRect ArrangeOverride(SKRect bounds)
|
||||
@@ -152,10 +157,10 @@ public class SkiaContentPresenter : SkiaView
|
||||
{
|
||||
var padding = Padding;
|
||||
var contentBounds = new SKRect(
|
||||
bounds.Left + padding.Left,
|
||||
bounds.Top + padding.Top,
|
||||
bounds.Right - padding.Right,
|
||||
bounds.Bottom - padding.Bottom);
|
||||
bounds.Left + (float)padding.Left,
|
||||
bounds.Top + (float)padding.Top,
|
||||
bounds.Right - (float)padding.Right,
|
||||
bounds.Bottom - (float)padding.Bottom);
|
||||
|
||||
// Apply alignment
|
||||
var contentSize = Content.DesiredSize;
|
||||
|
||||
@@ -94,17 +94,17 @@ public class SkiaIndicatorView : SkiaView
|
||||
/// <summary>
|
||||
/// Gets or sets the indicator size.
|
||||
/// </summary>
|
||||
public float IndicatorSize { get; set; } = 10f;
|
||||
public double IndicatorSize { get; set; } = 10.0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the selected indicator size.
|
||||
/// </summary>
|
||||
public float SelectedIndicatorSize { get; set; } = 10f;
|
||||
public double SelectedIndicatorSize { get; set; } = 10.0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the spacing between indicators.
|
||||
/// </summary>
|
||||
public float IndicatorSpacing { get; set; } = 8f;
|
||||
public double IndicatorSpacing { get; set; } = 8.0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the indicator shape.
|
||||
@@ -133,7 +133,7 @@ public class SkiaIndicatorView : SkiaView
|
||||
/// <summary>
|
||||
/// Gets or sets the border width.
|
||||
/// </summary>
|
||||
public float BorderWidth { get; set; } = 1f;
|
||||
public double BorderWidth { get; set; } = 1.0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum visible indicators.
|
||||
@@ -153,8 +153,8 @@ public class SkiaIndicatorView : SkiaView
|
||||
}
|
||||
|
||||
int visibleCount = Math.Min(_count, MaximumVisible);
|
||||
float totalWidth = visibleCount * IndicatorSize + (visibleCount - 1) * IndicatorSpacing;
|
||||
float height = Math.Max(IndicatorSize, SelectedIndicatorSize);
|
||||
float totalWidth = visibleCount * (float)IndicatorSize + (visibleCount - 1) * (float)IndicatorSpacing;
|
||||
float height = Math.Max((float)IndicatorSize, (float)SelectedIndicatorSize);
|
||||
|
||||
return new SKSize(totalWidth, height);
|
||||
}
|
||||
@@ -167,8 +167,8 @@ public class SkiaIndicatorView : SkiaView
|
||||
canvas.ClipRect(Bounds);
|
||||
|
||||
int visibleCount = Math.Min(_count, MaximumVisible);
|
||||
float totalWidth = visibleCount * IndicatorSize + (visibleCount - 1) * IndicatorSpacing;
|
||||
float startX = Bounds.MidX - totalWidth / 2 + IndicatorSize / 2;
|
||||
float totalWidth = visibleCount * (float)IndicatorSize + (visibleCount - 1) * (float)IndicatorSpacing;
|
||||
float startX = Bounds.MidX - totalWidth / 2 + (float)IndicatorSize / 2;
|
||||
float centerY = Bounds.MidY;
|
||||
|
||||
// Determine visible range if count > MaximumVisible
|
||||
@@ -204,18 +204,18 @@ public class SkiaIndicatorView : SkiaView
|
||||
{
|
||||
Color = _borderColorSK,
|
||||
Style = SKPaintStyle.Stroke,
|
||||
StrokeWidth = BorderWidth,
|
||||
StrokeWidth = (float)BorderWidth,
|
||||
IsAntialias = true
|
||||
};
|
||||
|
||||
for (int i = startIndex; i < endIndex; i++)
|
||||
{
|
||||
int visualIndex = i - startIndex;
|
||||
float x = startX + visualIndex * (IndicatorSize + IndicatorSpacing);
|
||||
float x = startX + visualIndex * ((float)IndicatorSize + (float)IndicatorSpacing);
|
||||
bool isSelected = i == _position;
|
||||
|
||||
var paint = isSelected ? selectedPaint : normalPaint;
|
||||
float size = isSelected ? SelectedIndicatorSize : IndicatorSize;
|
||||
float size = isSelected ? (float)SelectedIndicatorSize : (float)IndicatorSize;
|
||||
|
||||
DrawIndicator(canvas, x, centerY, size, paint, borderPaint);
|
||||
}
|
||||
@@ -282,7 +282,7 @@ public class SkiaIndicatorView : SkiaView
|
||||
if (_count > 0)
|
||||
{
|
||||
int visibleCount = Math.Min(_count, MaximumVisible);
|
||||
float totalWidth = visibleCount * IndicatorSize + (visibleCount - 1) * IndicatorSpacing;
|
||||
float totalWidth = visibleCount * (float)IndicatorSize + (visibleCount - 1) * (float)IndicatorSpacing;
|
||||
float startX = Bounds.MidX - totalWidth / 2;
|
||||
|
||||
int startIndex = 0;
|
||||
@@ -298,8 +298,8 @@ public class SkiaIndicatorView : SkiaView
|
||||
|
||||
for (int i = 0; i < visibleCount; i++)
|
||||
{
|
||||
float indicatorX = startX + i * (IndicatorSize + IndicatorSpacing);
|
||||
if (x >= indicatorX && x <= indicatorX + IndicatorSize)
|
||||
float indicatorX = startX + i * ((float)IndicatorSize + (float)IndicatorSpacing);
|
||||
if (x >= indicatorX && x <= indicatorX + (float)IndicatorSize)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
@@ -315,7 +315,7 @@ public class SkiaIndicatorView : SkiaView
|
||||
|
||||
// Calculate which indicator was clicked
|
||||
int visibleCount = Math.Min(_count, MaximumVisible);
|
||||
float totalWidth = visibleCount * IndicatorSize + (visibleCount - 1) * IndicatorSpacing;
|
||||
float totalWidth = visibleCount * (float)IndicatorSize + (visibleCount - 1) * (float)IndicatorSpacing;
|
||||
float startX = Bounds.MidX - totalWidth / 2;
|
||||
|
||||
int startIndex = 0;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using Microsoft.Maui.Graphics;
|
||||
using SkiaSharp;
|
||||
using Microsoft.Maui;
|
||||
|
||||
@@ -19,9 +20,9 @@ public abstract class SkiaLayoutView : SkiaView
|
||||
public static readonly BindableProperty SpacingProperty =
|
||||
BindableProperty.Create(
|
||||
nameof(Spacing),
|
||||
typeof(float),
|
||||
typeof(double),
|
||||
typeof(SkiaLayoutView),
|
||||
0f,
|
||||
0.0,
|
||||
BindingMode.TwoWay,
|
||||
propertyChanged: (b, o, n) => ((SkiaLayoutView)b).InvalidateMeasure());
|
||||
|
||||
@@ -31,9 +32,9 @@ public abstract class SkiaLayoutView : SkiaView
|
||||
public static readonly BindableProperty PaddingProperty =
|
||||
BindableProperty.Create(
|
||||
nameof(Padding),
|
||||
typeof(SKRect),
|
||||
typeof(Thickness),
|
||||
typeof(SkiaLayoutView),
|
||||
SKRect.Empty,
|
||||
default(Thickness),
|
||||
BindingMode.TwoWay,
|
||||
propertyChanged: (b, o, n) => ((SkiaLayoutView)b).InvalidateMeasure());
|
||||
|
||||
@@ -61,18 +62,18 @@ public abstract class SkiaLayoutView : SkiaView
|
||||
/// <summary>
|
||||
/// Spacing between children.
|
||||
/// </summary>
|
||||
public float Spacing
|
||||
public double Spacing
|
||||
{
|
||||
get => (float)GetValue(SpacingProperty);
|
||||
get => (double)GetValue(SpacingProperty);
|
||||
set => SetValue(SpacingProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Padding around the content.
|
||||
/// </summary>
|
||||
public SKRect Padding
|
||||
public Thickness Padding
|
||||
{
|
||||
get => (SKRect)GetValue(PaddingProperty);
|
||||
get => (Thickness)GetValue(PaddingProperty);
|
||||
set => SetValue(PaddingProperty, value);
|
||||
}
|
||||
|
||||
@@ -201,10 +202,10 @@ public abstract class SkiaLayoutView : SkiaView
|
||||
protected SKRect GetContentBounds(SKRect bounds)
|
||||
{
|
||||
return new SKRect(
|
||||
bounds.Left + Padding.Left,
|
||||
bounds.Top + Padding.Top,
|
||||
bounds.Right - Padding.Right,
|
||||
bounds.Bottom - Padding.Bottom);
|
||||
bounds.Left + (float)Padding.Left,
|
||||
bounds.Top + (float)Padding.Top,
|
||||
bounds.Right - (float)Padding.Right,
|
||||
bounds.Bottom - (float)Padding.Bottom);
|
||||
}
|
||||
|
||||
protected override void OnDraw(SKCanvas canvas, SKRect bounds)
|
||||
@@ -359,10 +360,10 @@ public class SkiaStackLayout : SkiaLayoutView
|
||||
protected override SKSize MeasureOverride(SKSize availableSize)
|
||||
{
|
||||
// Handle NaN/Infinity in padding
|
||||
var paddingLeft = float.IsNaN(Padding.Left) ? 0 : Padding.Left;
|
||||
var paddingRight = float.IsNaN(Padding.Right) ? 0 : Padding.Right;
|
||||
var paddingTop = float.IsNaN(Padding.Top) ? 0 : Padding.Top;
|
||||
var paddingBottom = float.IsNaN(Padding.Bottom) ? 0 : Padding.Bottom;
|
||||
var paddingLeft = (float)(double.IsNaN(Padding.Left) ? 0 : Padding.Left);
|
||||
var paddingRight = (float)(double.IsNaN(Padding.Right) ? 0 : Padding.Right);
|
||||
var paddingTop = (float)(double.IsNaN(Padding.Top) ? 0 : Padding.Top);
|
||||
var paddingBottom = (float)(double.IsNaN(Padding.Bottom) ? 0 : Padding.Bottom);
|
||||
|
||||
var contentWidth = availableSize.Width - paddingLeft - paddingRight;
|
||||
var contentHeight = availableSize.Height - paddingTop - paddingBottom;
|
||||
@@ -402,7 +403,7 @@ public class SkiaStackLayout : SkiaLayoutView
|
||||
|
||||
// Add spacing
|
||||
var visibleCount = Children.Count(c => c.IsVisible);
|
||||
var totalSpacing = Math.Max(0, visibleCount - 1) * Spacing;
|
||||
var totalSpacing = (float)(Math.Max(0, visibleCount - 1) * Spacing);
|
||||
|
||||
if (Orientation == StackOrientation.Vertical)
|
||||
{
|
||||
@@ -459,7 +460,7 @@ public class SkiaStackLayout : SkiaLayoutView
|
||||
content.Top + offset,
|
||||
content.Left + contentWidth,
|
||||
content.Top + offset + useHeight);
|
||||
offset += useHeight + Spacing;
|
||||
offset += useHeight + (float)Spacing;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -499,7 +500,7 @@ public class SkiaStackLayout : SkiaLayoutView
|
||||
childTop,
|
||||
content.Left + offset + useWidth,
|
||||
childBottom);
|
||||
offset += useWidth + Spacing;
|
||||
offset += useWidth + (float)Spacing;
|
||||
}
|
||||
|
||||
// Apply child's margin
|
||||
@@ -627,8 +628,8 @@ public class SkiaGrid : SkiaLayoutView
|
||||
|
||||
protected override SKSize MeasureOverride(SKSize availableSize)
|
||||
{
|
||||
var contentWidth = availableSize.Width - Padding.Left - Padding.Right;
|
||||
var contentHeight = availableSize.Height - Padding.Top - Padding.Bottom;
|
||||
var contentWidth = availableSize.Width - (float)Padding.Left - (float)Padding.Right;
|
||||
var contentHeight = availableSize.Height - (float)Padding.Top - (float)Padding.Bottom;
|
||||
|
||||
// Handle NaN/Infinity
|
||||
if (float.IsNaN(contentWidth) || float.IsInfinity(contentWidth)) contentWidth = 800;
|
||||
@@ -713,8 +714,8 @@ public class SkiaGrid : SkiaLayoutView
|
||||
var totalHeight = _rowHeights.Sum() + Math.Max(0, rowCount - 1) * RowSpacing;
|
||||
|
||||
return new SKSize(
|
||||
totalWidth + Padding.Left + Padding.Right,
|
||||
totalHeight + Padding.Top + Padding.Bottom);
|
||||
totalWidth + (float)Padding.Left + (float)Padding.Right,
|
||||
totalHeight + (float)Padding.Top + (float)Padding.Bottom);
|
||||
}
|
||||
|
||||
private int GetMaxRow()
|
||||
@@ -1042,8 +1043,8 @@ public class SkiaAbsoluteLayout : SkiaLayoutView
|
||||
}
|
||||
|
||||
return new SKSize(
|
||||
maxRight + Padding.Left + Padding.Right,
|
||||
maxBottom + Padding.Top + Padding.Bottom);
|
||||
maxRight + (float)Padding.Left + (float)Padding.Right,
|
||||
maxBottom + (float)Padding.Top + (float)Padding.Bottom);
|
||||
}
|
||||
|
||||
protected override SKRect ArrangeOverride(SKRect bounds)
|
||||
|
||||
@@ -235,86 +235,86 @@ public static class SkiaTheme
|
||||
#region SKColor Cached Conversions (for rendering performance)
|
||||
|
||||
// Primary
|
||||
public static readonly SKColor PrimarySK = Primary.ToSKColor();
|
||||
public static readonly SKColor PrimaryDarkSK = PrimaryDark.ToSKColor();
|
||||
public static readonly SKColor PrimaryLightSK = PrimaryLight.ToSKColor();
|
||||
public static readonly SKColor PrimarySelectionSK = PrimarySelection.ToSKColor();
|
||||
public static readonly SKColor PrimaryHalfSK = PrimaryHalf.ToSKColor();
|
||||
internal static readonly SKColor PrimarySK = Primary.ToSKColor();
|
||||
internal static readonly SKColor PrimaryDarkSK = PrimaryDark.ToSKColor();
|
||||
internal static readonly SKColor PrimaryLightSK = PrimaryLight.ToSKColor();
|
||||
internal static readonly SKColor PrimarySelectionSK = PrimarySelection.ToSKColor();
|
||||
internal static readonly SKColor PrimaryHalfSK = PrimaryHalf.ToSKColor();
|
||||
|
||||
// Text
|
||||
public static readonly SKColor TextPrimarySK = TextPrimary.ToSKColor();
|
||||
public static readonly SKColor TextSecondarySK = TextSecondary.ToSKColor();
|
||||
public static readonly SKColor TextTertiarySK = TextTertiary.ToSKColor();
|
||||
public static readonly SKColor TextDisabledSK = TextDisabled.ToSKColor();
|
||||
public static readonly SKColor TextPlaceholderSK = TextPlaceholder.ToSKColor();
|
||||
public static readonly SKColor TextLinkSK = TextLink.ToSKColor();
|
||||
public static readonly SKColor TextLinkVisitedSK = TextLinkVisited.ToSKColor();
|
||||
internal static readonly SKColor TextPrimarySK = TextPrimary.ToSKColor();
|
||||
internal static readonly SKColor TextSecondarySK = TextSecondary.ToSKColor();
|
||||
internal static readonly SKColor TextTertiarySK = TextTertiary.ToSKColor();
|
||||
internal static readonly SKColor TextDisabledSK = TextDisabled.ToSKColor();
|
||||
internal static readonly SKColor TextPlaceholderSK = TextPlaceholder.ToSKColor();
|
||||
internal static readonly SKColor TextLinkSK = TextLink.ToSKColor();
|
||||
internal static readonly SKColor TextLinkVisitedSK = TextLinkVisited.ToSKColor();
|
||||
|
||||
// Backgrounds
|
||||
public static readonly SKColor BackgroundWhiteSK = SKColors.White;
|
||||
public static readonly SKColor WhiteSemiTransparentSK = WhiteSemiTransparent.ToSKColor();
|
||||
public static readonly SKColor BackgroundLightSK = BackgroundLight.ToSKColor();
|
||||
public static readonly SKColor BackgroundLightAltSK = BackgroundLightAlt.ToSKColor();
|
||||
public static readonly SKColor BackgroundSurfaceSK = BackgroundSurface.ToSKColor();
|
||||
public static readonly SKColor BackgroundDisabledSK = BackgroundDisabled.ToSKColor();
|
||||
internal static readonly SKColor BackgroundWhiteSK = SKColors.White;
|
||||
internal static readonly SKColor WhiteSemiTransparentSK = WhiteSemiTransparent.ToSKColor();
|
||||
internal static readonly SKColor BackgroundLightSK = BackgroundLight.ToSKColor();
|
||||
internal static readonly SKColor BackgroundLightAltSK = BackgroundLightAlt.ToSKColor();
|
||||
internal static readonly SKColor BackgroundSurfaceSK = BackgroundSurface.ToSKColor();
|
||||
internal static readonly SKColor BackgroundDisabledSK = BackgroundDisabled.ToSKColor();
|
||||
|
||||
// Gray scale
|
||||
public static readonly SKColor Gray50SK = Gray50.ToSKColor();
|
||||
public static readonly SKColor Gray100SK = Gray100.ToSKColor();
|
||||
public static readonly SKColor Gray200SK = Gray200.ToSKColor();
|
||||
public static readonly SKColor Gray300SK = Gray300.ToSKColor();
|
||||
public static readonly SKColor Gray400SK = Gray400.ToSKColor();
|
||||
public static readonly SKColor Gray500SK = Gray500.ToSKColor();
|
||||
public static readonly SKColor Gray600SK = Gray600.ToSKColor();
|
||||
public static readonly SKColor Gray700SK = Gray700.ToSKColor();
|
||||
public static readonly SKColor Gray800SK = Gray800.ToSKColor();
|
||||
public static readonly SKColor Gray900SK = Gray900.ToSKColor();
|
||||
internal static readonly SKColor Gray50SK = Gray50.ToSKColor();
|
||||
internal static readonly SKColor Gray100SK = Gray100.ToSKColor();
|
||||
internal static readonly SKColor Gray200SK = Gray200.ToSKColor();
|
||||
internal static readonly SKColor Gray300SK = Gray300.ToSKColor();
|
||||
internal static readonly SKColor Gray400SK = Gray400.ToSKColor();
|
||||
internal static readonly SKColor Gray500SK = Gray500.ToSKColor();
|
||||
internal static readonly SKColor Gray600SK = Gray600.ToSKColor();
|
||||
internal static readonly SKColor Gray700SK = Gray700.ToSKColor();
|
||||
internal static readonly SKColor Gray800SK = Gray800.ToSKColor();
|
||||
internal static readonly SKColor Gray900SK = Gray900.ToSKColor();
|
||||
|
||||
// Borders
|
||||
public static readonly SKColor BorderLightSK = BorderLight.ToSKColor();
|
||||
public static readonly SKColor BorderMediumSK = BorderMedium.ToSKColor();
|
||||
public static readonly SKColor BorderDarkSK = BorderDark.ToSKColor();
|
||||
internal static readonly SKColor BorderLightSK = BorderLight.ToSKColor();
|
||||
internal static readonly SKColor BorderMediumSK = BorderMedium.ToSKColor();
|
||||
internal static readonly SKColor BorderDarkSK = BorderDark.ToSKColor();
|
||||
|
||||
// Shadows
|
||||
public static readonly SKColor Shadow10SK = Shadow10.ToSKColor();
|
||||
public static readonly SKColor Shadow15SK = Shadow15.ToSKColor();
|
||||
public static readonly SKColor Shadow20SK = Shadow20.ToSKColor();
|
||||
public static readonly SKColor Shadow25SK = Shadow25.ToSKColor();
|
||||
public static readonly SKColor Shadow40SK = Shadow40.ToSKColor();
|
||||
public static readonly SKColor Shadow50SK = Shadow50.ToSKColor();
|
||||
internal static readonly SKColor Shadow10SK = Shadow10.ToSKColor();
|
||||
internal static readonly SKColor Shadow15SK = Shadow15.ToSKColor();
|
||||
internal static readonly SKColor Shadow20SK = Shadow20.ToSKColor();
|
||||
internal static readonly SKColor Shadow25SK = Shadow25.ToSKColor();
|
||||
internal static readonly SKColor Shadow40SK = Shadow40.ToSKColor();
|
||||
internal static readonly SKColor Shadow50SK = Shadow50.ToSKColor();
|
||||
|
||||
// Overlays
|
||||
public static readonly SKColor Overlay40SK = Overlay40.ToSKColor();
|
||||
public static readonly SKColor Overlay50SK = Overlay50.ToSKColor();
|
||||
internal static readonly SKColor Overlay40SK = Overlay40.ToSKColor();
|
||||
internal static readonly SKColor Overlay50SK = Overlay50.ToSKColor();
|
||||
|
||||
// Status
|
||||
public static readonly SKColor ErrorSK = Error.ToSKColor();
|
||||
public static readonly SKColor SuccessSK = Success.ToSKColor();
|
||||
public static readonly SKColor WarningSK = Warning.ToSKColor();
|
||||
internal static readonly SKColor ErrorSK = Error.ToSKColor();
|
||||
internal static readonly SKColor SuccessSK = Success.ToSKColor();
|
||||
internal static readonly SKColor WarningSK = Warning.ToSKColor();
|
||||
|
||||
// Buttons
|
||||
public static readonly SKColor ButtonCancelSK = ButtonCancel.ToSKColor();
|
||||
public static readonly SKColor ButtonCancelHoverSK = ButtonCancelHover.ToSKColor();
|
||||
internal static readonly SKColor ButtonCancelSK = ButtonCancel.ToSKColor();
|
||||
internal static readonly SKColor ButtonCancelHoverSK = ButtonCancelHover.ToSKColor();
|
||||
|
||||
// Scrollbars
|
||||
public static readonly SKColor ScrollbarThumbSK = ScrollbarThumb.ToSKColor();
|
||||
public static readonly SKColor ScrollbarTrackSK = ScrollbarTrack.ToSKColor();
|
||||
internal static readonly SKColor ScrollbarThumbSK = ScrollbarThumb.ToSKColor();
|
||||
internal static readonly SKColor ScrollbarTrackSK = ScrollbarTrack.ToSKColor();
|
||||
|
||||
// Indicators
|
||||
public static readonly SKColor IndicatorUnselectedSK = IndicatorUnselected.ToSKColor();
|
||||
public static readonly SKColor IndicatorSelectedSK = IndicatorSelected.ToSKColor();
|
||||
internal static readonly SKColor IndicatorUnselectedSK = IndicatorUnselected.ToSKColor();
|
||||
internal static readonly SKColor IndicatorSelectedSK = IndicatorSelected.ToSKColor();
|
||||
|
||||
// Menu
|
||||
public static readonly SKColor MenuBackgroundSK = MenuBackground.ToSKColor();
|
||||
public static readonly SKColor MenuHoverSK = MenuHover.ToSKColor();
|
||||
public static readonly SKColor MenuActiveSK = MenuActive.ToSKColor();
|
||||
public static readonly SKColor MenuSeparatorSK = MenuSeparator.ToSKColor();
|
||||
internal static readonly SKColor MenuBackgroundSK = MenuBackground.ToSKColor();
|
||||
internal static readonly SKColor MenuHoverSK = MenuHover.ToSKColor();
|
||||
internal static readonly SKColor MenuActiveSK = MenuActive.ToSKColor();
|
||||
internal static readonly SKColor MenuSeparatorSK = MenuSeparator.ToSKColor();
|
||||
|
||||
// Dark theme
|
||||
public static readonly SKColor DarkBackgroundSK = DarkBackground.ToSKColor();
|
||||
public static readonly SKColor DarkSurfaceSK = DarkSurface.ToSKColor();
|
||||
public static readonly SKColor DarkTextSK = DarkText.ToSKColor();
|
||||
public static readonly SKColor DarkHoverSK = DarkHover.ToSKColor();
|
||||
internal static readonly SKColor DarkBackgroundSK = DarkBackground.ToSKColor();
|
||||
internal static readonly SKColor DarkSurfaceSK = DarkSurface.ToSKColor();
|
||||
internal static readonly SKColor DarkTextSK = DarkText.ToSKColor();
|
||||
internal static readonly SKColor DarkHoverSK = DarkHover.ToSKColor();
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user