diff --git a/Handlers/NavigationPageHandler.cs b/Handlers/NavigationPageHandler.cs index aff9a7c..32d34b7 100644 --- a/Handlers/NavigationPageHandler.cs +++ b/Handlers/NavigationPageHandler.cs @@ -1,12 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.IO; using Microsoft.Maui.Handlers; using Microsoft.Maui.Graphics; using Microsoft.Maui.Controls; using Microsoft.Maui.Platform; using Microsoft.Maui.Platform.Linux.Hosting; using SkiaSharp; +using Svg.Skia; using System.Collections.Specialized; namespace Microsoft.Maui.Platform.Linux.Handlers; @@ -164,7 +166,7 @@ public partial class NavigationPageHandler : ViewHandler [nameof(IStepper.Value)] = MapValue, [nameof(IStepper.Minimum)] = MapMinimum, [nameof(IStepper.Maximum)] = MapMaximum, + ["Increment"] = MapIncrement, [nameof(IView.Background)] = MapBackground, + [nameof(IView.IsEnabled)] = MapIsEnabled, }; public static CommandMapper CommandMapper = @@ -45,6 +48,17 @@ public partial class StepperHandler : ViewHandler { base.ConnectHandler(platformView); platformView.ValueChanged += OnValueChanged; + + // Apply dark theme colors if needed + if (Application.Current?.UserAppTheme == AppTheme.Dark) + { + platformView.ButtonBackgroundColor = new SKColor(66, 66, 66); + platformView.ButtonPressedColor = new SKColor(97, 97, 97); + platformView.ButtonDisabledColor = new SKColor(48, 48, 48); + platformView.SymbolColor = new SKColor(224, 224, 224); + platformView.SymbolDisabledColor = new SKColor(97, 97, 97); + platformView.BorderColor = new SKColor(97, 97, 97); + } } protected override void DisconnectHandler(SkiaStepper platformView) @@ -86,4 +100,20 @@ public partial class StepperHandler : ViewHandler handler.PlatformView.BackgroundColor = solidPaint.Color.ToSKColor(); } } + + public static void MapIncrement(StepperHandler handler, IStepper stepper) + { + if (handler.PlatformView is null) return; + + if (stepper is Stepper stepperControl) + { + handler.PlatformView.Increment = stepperControl.Increment; + } + } + + public static void MapIsEnabled(StepperHandler handler, IStepper stepper) + { + if (handler.PlatformView is null) return; + handler.PlatformView.IsEnabled = stepper.IsEnabled; + } } diff --git a/Handlers/TimePickerHandler.cs b/Handlers/TimePickerHandler.cs index 6bac774..f37f988 100644 --- a/Handlers/TimePickerHandler.cs +++ b/Handlers/TimePickerHandler.cs @@ -47,6 +47,16 @@ public partial class TimePickerHandler : ViewHandler + diff --git a/Views/SkiaPage.cs b/Views/SkiaPage.cs index 77bf6eb..ae70923 100644 --- a/Views/SkiaPage.cs +++ b/Views/SkiaPage.cs @@ -449,6 +449,7 @@ public class SkiaContentPage : SkiaPage public class SkiaToolbarItem { public string Text { get; set; } = ""; + public SKBitmap? Icon { get; set; } public SkiaToolbarItemOrder Order { get; set; } = SkiaToolbarItemOrder.Primary; public System.Windows.Input.ICommand? Command { get; set; } public SKRect HitBounds { get; set; }