Dong Bin
6 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
5 additions and
6 deletions
-
src/Avalonia.Controls/DateTimePickers/DatePickerPresenter.cs
|
|
|
@ -457,18 +457,17 @@ namespace Avalonia.Controls |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ConfigureSpacer(items._firstSpacer, columnIndex > 1); |
|
|
|
ConfigureSpacer(items._secondSpacer, columnIndex > 2); |
|
|
|
ConfigureSpacer(items._firstSpacer, columnIndex > 1, 1); |
|
|
|
ConfigureSpacer(items._secondSpacer, columnIndex > 2, 3); |
|
|
|
return; |
|
|
|
|
|
|
|
static void ConfigureSpacer(Control? spacer, bool visible) |
|
|
|
static void ConfigureSpacer(Control? spacer, bool visible, int column) |
|
|
|
{ |
|
|
|
if (spacer == null) |
|
|
|
return; |
|
|
|
|
|
|
|
// ternary conditional operator is used to make sure grid cells will be validated
|
|
|
|
Grid.SetColumn(spacer, visible ? 1 : 0); |
|
|
|
Grid.SetColumn(spacer, visible ? column : 0); |
|
|
|
spacer.IsVisible = visible; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|