Skip to content

Commit 2b0dc1a

Browse files
authored
Merge pull request #20 from redmarklabs/main
Some minor error fixes and a minor update for Avalonia V12
2 parents 7f69b77 + f3638f0 commit 2b0dc1a

15 files changed

Lines changed: 46 additions & 34 deletions

File tree

samples/PleasantUI.Example/Properties/Localizations/Library.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@
397397
<data name="ItemListPanel/ToggleLoading" xml:space="preserve"><value>Toggle loading</value></data>
398398
<data name="ItemListPanel/Clear" xml:space="preserve"><value>Clear items</value></data>
399399
<data name="ItemListPanel/Reload" xml:space="preserve"><value>Reload items</value></data>
400-
<data name="ItemListPanel/SearchWatermark" xml:space="preserve"><value>Search files...</value></data>
400+
<data name="ItemListPanel/SearchPlaceholderText" xml:space="preserve"><value>Search files...</value></data>
401401
<data name="ItemListPanel/EmptyTitle" xml:space="preserve"><value>No files</value></data>
402402
<data name="ItemListPanel/EmptySubtitle" xml:space="preserve"><value>Add items using the Reload button above.</value></data>
403403
<data name="ItemListPanel/LoadingTitle" xml:space="preserve"><value>Loading files</value></data>

samples/PleasantUI.Example/Properties/Localizations/Library.ru.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@
390390
<data name="ItemListPanel/ToggleLoading" xml:space="preserve"><value>Переключить загрузку</value></data>
391391
<data name="ItemListPanel/Clear" xml:space="preserve"><value>Очистить</value></data>
392392
<data name="ItemListPanel/Reload" xml:space="preserve"><value>Перезагрузить</value></data>
393-
<data name="ItemListPanel/SearchWatermark" xml:space="preserve"><value>Поиск файлов...</value></data>
393+
<data name="ItemListPanel/SearchPlaceholderText" xml:space="preserve"><value>Поиск файлов...</value></data>
394394
<data name="ItemListPanel/EmptyTitle" xml:space="preserve"><value>Нет файлов</value></data>
395395
<data name="ItemListPanel/EmptySubtitle" xml:space="preserve"><value>Добавьте элементы кнопкой «Перезагрузить».</value></data>
396396
<data name="ItemListPanel/LoadingTitle" xml:space="preserve"><value>Загрузка файлов</value></data>

samples/PleasantUI.Example/Views/Pages/ControlPages/CalendarPageView.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<TextBlock Theme="{DynamicResource BodyStrongTextBlockTheme}" Text="{Localize InlineCalendar}" HorizontalAlignment="Center" />
1010
<Calendar SelectionMode="SingleDate" />
1111
<TextBlock Theme="{DynamicResource BodyStrongTextBlockTheme}" Text="{Localize DatePicker}" HorizontalAlignment="Center" />
12-
<CalendarDatePicker HorizontalAlignment="Center" Watermark="{Localize PickADate}" />
12+
<CalendarDatePicker HorizontalAlignment="Center" PlaceholderText="{Localize PickADate}" />
1313
<TextBlock Theme="{DynamicResource BodyStrongTextBlockTheme}" Text="{Localize SpinnerDatePicker}" HorizontalAlignment="Center" />
1414
<controls:PleasantDatePicker HorizontalAlignment="Center" />
1515
</StackPanel>

samples/PleasantUI.Example/Views/Pages/ControlPages/ComboBoxPageView.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
<ComboBoxItem Content="{Localize Option1, Context=ComboBoxPage}" />
1818
</ComboBox>
1919
<TextBlock Theme="{DynamicResource BodyStrongTextBlockTheme}" Text="{Localize AutoCompleteBox}" />
20-
<AutoCompleteBox x:Name="FruitAutoComplete" Watermark="{Localize StartTyping}" HorizontalAlignment="Stretch" />
20+
<AutoCompleteBox x:Name="FruitAutoComplete" PlaceholderText="{Localize StartTyping}" HorizontalAlignment="Stretch" />
2121
</StackPanel>
2222
</UserControl>

samples/PleasantUI.Example/Views/Pages/ControlPages/TextBoxPageView.axaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
x:Class="PleasantUI.Example.Views.Pages.ControlPages.TextBoxPageView">
77
<StackPanel Spacing="12" HorizontalAlignment="Center" VerticalAlignment="Center" Width="340">
88
<TextBlock Theme="{DynamicResource BodyStrongTextBlockTheme}" Text="{Localize TextBox}" />
9-
<TextBox Watermark="{Localize EnterText}" />
9+
<TextBox PlaceholderText="{Localize EnterText}" />
1010
<TextBlock Theme="{DynamicResource BodyStrongTextBlockTheme}" Text="{Localize Password}" />
11-
<TextBox Watermark="{Localize EnterPassword}" PasswordChar="" />
11+
<TextBox PlaceholderText="{Localize EnterPassword}" PasswordChar="" />
1212
<TextBlock Theme="{DynamicResource BodyStrongTextBlockTheme}" Text="{Localize Multiline}" />
1313
<TextBox Classes="MultilineTextBox"
1414
PlaceholderText="{Localize EnterMultipleLines}"
@@ -24,7 +24,7 @@
2424
<TextBlock Theme="{DynamicResource BodyStrongTextBlockTheme}" Text="{Localize ReadOnly}" />
2525
<TextBox Text="{Localize ReadOnlyText}" IsReadOnly="True" />
2626
<TextBlock Theme="{DynamicResource BodyStrongTextBlockTheme}" Text="{Localize Disabled}" />
27-
<TextBox Watermark="{Localize DisabledInput}" IsEnabled="False" />
27+
<TextBox PlaceholderText="{Localize DisabledInput}" IsEnabled="False" />
2828
<TextBlock Theme="{DynamicResource BodyStrongTextBlockTheme}" Text="{Localize NumericUpDown}" />
2929
<NumericUpDown Minimum="0" Maximum="100" Value="42" />
3030
</StackPanel>

samples/PleasantUI.Example/Views/Pages/PleasantControlPages/ItemListPanelPageView.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</WrapPanel>
2424

2525
<controls:ItemListPanel x:Name="ListPanel"
26-
SearchWatermark="{Localize ItemListPanel/SearchWatermark}"
26+
SearchPlaceholderText="{Localize ItemListPanel/SearchPlaceholderText}"
2727
EmptyStateTitle="{Localize ItemListPanel/EmptyTitle}"
2828
EmptyStateSubtitle="{Localize ItemListPanel/EmptySubtitle}"
2929
LoadingTitle="{Localize ItemListPanel/LoadingTitle}"

samples/PleasantUI.Example/Views/Pages/PleasantControlPages/StepDialogPageView.axaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private async void OnOpenBasic(object? s, RoutedEventArgs e)
4343
dialog.Steps.Add(new StepItem { Header = Localizer.Tr("StepDialog/AcceptLicenseHeader"),
4444
Description = Localizer.Tr("StepDialog/AcceptLicenseDescription") });
4545
dialog.Steps.Add(new StepItem { Header = Localizer.Tr("StepDialog/ChooseDirectoryHeader"),
46-
Content = new TextBox { Watermark = Localizer.Tr("StepDialog/DefaultDirectoryPath"), Width = 280 } });
46+
Content = new TextBox { PlaceholderText = Localizer.Tr("StepDialog/DefaultDirectoryPath"), Width = 280 } });
4747
dialog.Steps.Add(new StepItem { Header = Localizer.Tr("StepDialog/CompleteInstallationHeader"),
4848
Description = Localizer.Tr("StepDialog/CompleteInstallationDescription") });
4949

src/PleasantUI/Controls/ItemListPanel/ItemListPanel.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public class ItemListPanel : TemplatedControl
6363
public static readonly StyledProperty<string?> SearchTextProperty =
6464
AvaloniaProperty.Register<ItemListPanel, string?>(nameof(SearchText));
6565

66-
/// <summary>Defines the <see cref="SearchWatermark"/> property.</summary>
67-
public static readonly StyledProperty<string> SearchWatermarkProperty =
68-
AvaloniaProperty.Register<ItemListPanel, string>(nameof(SearchWatermark), defaultValue: "Search...");
66+
/// <summary>Defines the <see cref="SearchPlaceholderText"/> property.</summary>
67+
public static readonly StyledProperty<string> SearchPlaceholderTextProperty =
68+
AvaloniaProperty.Register<ItemListPanel, string>(nameof(SearchPlaceholderText), defaultValue: "Search...");
6969

7070
/// <summary>Defines the <see cref="ItemsSource"/> property.</summary>
7171
public static readonly StyledProperty<IEnumerable?> ItemsSourceProperty =
@@ -140,11 +140,11 @@ public string? SearchText
140140
set => SetValue(SearchTextProperty, value);
141141
}
142142

143-
/// <summary>Gets or sets the watermark shown in the search box.</summary>
144-
public string SearchWatermark
143+
/// <summary>Gets or sets the placeholder text shown in the search box.</summary>
144+
public string SearchPlaceholderText
145145
{
146-
get => GetValue(SearchWatermarkProperty);
147-
set => SetValue(SearchWatermarkProperty, value);
146+
get => GetValue(SearchPlaceholderTextProperty);
147+
set => SetValue(SearchPlaceholderTextProperty, value);
148148
}
149149

150150
/// <summary>Gets or sets the items source for the list.</summary>

src/PleasantUI/Controls/NavigationView/NavigationView.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ public class NavigationView : TreeView
165165
AvaloniaProperty.Register<NavigationView, bool>(nameof(DisplayTopIndent), true);
166166

167167
/// <summary>
168-
/// Defines the <see cref="NotMakeOffsetForContentPanel" /> property.
168+
/// Defines the <see cref="ContentPanelOffsetDisabled" /> property.
169169
/// </summary>
170-
public static readonly StyledProperty<bool> NotMakeOffsetForContentPanelProperty =
171-
AvaloniaProperty.Register<NavigationView, bool>(nameof(NotMakeOffsetForContentPanel));
170+
public static readonly StyledProperty<bool> ContentPanelOffsetDisabledProperty =
171+
AvaloniaProperty.Register<NavigationView, bool>(nameof(ContentPanelOffsetDisabled));
172172

173173
/// <summary>
174174
/// Defines the <see cref="ItemsAsStrings" /> property.
@@ -333,10 +333,10 @@ public bool DisplayTopIndent
333333
/// <value>
334334
/// <c>true</c> if the content panel should not have an offset; otherwise, <c>false</c>.
335335
/// </value>
336-
public bool NotMakeOffsetForContentPanel
336+
public bool ContentPanelOffsetDisabled
337337
{
338-
get => GetValue(NotMakeOffsetForContentPanelProperty);
339-
set => SetValue(NotMakeOffsetForContentPanelProperty, value);
338+
get => GetValue(ContentPanelOffsetDisabledProperty);
339+
set => SetValue(ContentPanelOffsetDisabledProperty, value);
340340
}
341341

342342
/// <summary>

src/PleasantUI/Controls/TreeViewPanel/TreeViewPanel.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System.Collections.Specialized;
2-
using System.Diagnostics;
31
using Avalonia;
42
using Avalonia.Animation;
53
using Avalonia.Collections;
@@ -8,8 +6,11 @@
86
using Avalonia.Controls.Primitives;
97
using Avalonia.Input;
108
using Avalonia.Interactivity;
9+
using Avalonia.Media;
1110
using Avalonia.Metadata;
1211
using Avalonia.Styling;
12+
using System.Collections.Specialized;
13+
using System.Diagnostics;
1314

1415
namespace PleasantUI.Controls;
1516

@@ -43,6 +44,10 @@ public class TreeViewPanel : TemplatedControl
4344

4445
// ── Styled properties ─────────────────────────────────────────────────────
4546

47+
/// <summary>Defines the <see cref="SectionIcon"/> property.</summary>
48+
public static readonly StyledProperty<Geometry> SectionIconProperty =
49+
AvaloniaProperty.Register<TreeViewPanel, Geometry>(nameof(SectionIcon));
50+
4651
/// <summary>Defines the <see cref="FilterText"/> property.</summary>
4752
public static readonly StyledProperty<string?> FilterTextProperty =
4853
AvaloniaProperty.Register<TreeViewPanel, string?>(nameof(FilterText));
@@ -88,6 +93,13 @@ public class TreeViewPanel : TemplatedControl
8893

8994
// ── CLR accessors ─────────────────────────────────────────────────────────
9095

96+
/// <summary>Gets or sets the icon used for sections.</summary>
97+
public Geometry SectionIcon
98+
{
99+
get => GetValue(SectionIconProperty);
100+
set => SetValue(SectionIconProperty, value);
101+
}
102+
91103
/// <summary>Gets or sets the text used to filter items across all sections.</summary>
92104
public string? FilterText
93105
{

0 commit comments

Comments
 (0)