Draw correctly the time in Fluent TimePicker
This commit is contained in:
Родитель
2b2a0daf6c
Коммит
fd1b394a89
|
@ -13,13 +13,14 @@
|
|||
var height = dirtyRect.Height;
|
||||
|
||||
var defaultBackgroundColor = Fluent.Color.Primary.ThemePrimary.ToColor();
|
||||
|
||||
if (button.Background != null && button.Background is SolidPaint solidPaint)
|
||||
defaultBackgroundColor = solidPaint.Color;
|
||||
|
||||
var disabledColor = Fluent.Color.Background.NeutralLighter.ToColor();
|
||||
|
||||
var backgroundColor = button.IsEnabled ? defaultBackgroundColor : disabledColor;
|
||||
|
||||
if (button.Background != null && button.Background is SolidPaint solidPaint)
|
||||
backgroundColor = solidPaint.Color;
|
||||
|
||||
var border = new LinearGradientPaint
|
||||
{
|
||||
GradientStops = new GradientStop[]
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Microsoft.Maui.Graphics.Controls
|
||||
{
|
||||
|
@ -119,7 +120,7 @@ namespace Microsoft.Maui.Graphics.Controls
|
|||
canvas.FontColor = textColor;
|
||||
canvas.FontSize = fontSize;
|
||||
|
||||
canvas.DrawString(date.ToString("tt"), divided * 2, 0, divided, height, HorizontalAlignment.Center, VerticalAlignment.Center);
|
||||
canvas.DrawString(date.ToString("tt", CultureInfo.InvariantCulture), divided * 2, 0, divided, height, HorizontalAlignment.Center, VerticalAlignment.Center);
|
||||
|
||||
canvas.RestoreState();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче