From b0b374696893dc3d25d63ed29d0718e859c39b6d Mon Sep 17 00:00:00 2001 From: Dave Friedel Date: Thu, 1 Jan 2026 12:52:33 -0500 Subject: [PATCH] Fix NavigationPageHandler, StepperHandler, TimePickerHandler from decompiled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NavigationPageHandler: - Added LoadToolbarIcon() method for PNG/SVG toolbar icons - Added icon loading in MapToolbarItems() - Fixed OnVirtualViewPushed to set Title and handle null content - Fixed animation parameters to match decompiled StepperHandler: - Added MapIncrement() and MapIsEnabled() methods - Added dark theme color support in ConnectHandler TimePickerHandler: - Added dark theme color support in ConnectHandler SkiaPage: - Added Icon property to SkiaToolbarItem class Also added Svg.Skia package reference. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- Handlers/NavigationPageHandler.cs | 88 +++++++++++++++++++++++++++++-- Handlers/StepperHandler.cs | 30 +++++++++++ Handlers/TimePickerHandler.cs | 10 ++++ MERGE_TRACKING.md | 22 ++++---- OpenMaui.Controls.Linux.csproj | 1 + Views/SkiaPage.cs | 1 + 6 files changed, 136 insertions(+), 16 deletions(-) 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; }