From b9668ef25a88119494e99d4d1c84799fb935487a Mon Sep 17 00:00:00 2001 From: DmitryZhutkov Date: Sat, 11 Apr 2026 14:25:13 +0500 Subject: [PATCH 1/5] Adding HotReload support --- build/Package.props | 8 ++- .../PleasantUI.Example.Desktop.csproj | 12 ++++ .../Factories/ControlPageCardsFactory.cs | 68 +++++++++---------- .../Models/ControlPageCard.cs | 6 +- .../PleasantUI.Example.csproj | 3 + 5 files changed, 59 insertions(+), 38 deletions(-) diff --git a/build/Package.props b/build/Package.props index dd69d21e..c60946e5 100644 --- a/build/Package.props +++ b/build/Package.props @@ -23,7 +23,13 @@ true https://github.com/Onebeld/PleasantUI - + + + + + + + diff --git a/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj b/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj index eaa15cbe..840e5458 100644 --- a/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj +++ b/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj @@ -16,13 +16,25 @@ embedded true + $(DefineConstants);ENABLE_XAML_HOT_RELOAD + + + $(MSBuildProjectDirectory)\..\..\src\PleasantUI + + + + + + + + diff --git a/samples/PleasantUI.Example/Factories/ControlPageCardsFactory.cs b/samples/PleasantUI.Example/Factories/ControlPageCardsFactory.cs index 88ea2db4..8babe097 100644 --- a/samples/PleasantUI.Example/Factories/ControlPageCardsFactory.cs +++ b/samples/PleasantUI.Example/Factories/ControlPageCardsFactory.cs @@ -18,16 +18,16 @@ public AvaloniaList CreateBasicControlPageCards() { return [ - new("CardTitle/Button", MaterialIcons.ButtonCursor, "Card/Button", new ButtonPage(), _eventAggregator), - new("CardTitle/Checkbox", MaterialIcons.CheckboxMarkedOutline,"Card/Checkbox", new CheckBoxPage(), _eventAggregator), - new("CardTitle/Progress", MaterialIcons.ProgressHelper, "Card/Progress", new ProgressPage(), _eventAggregator), - new("CardTitle/Calendar", MaterialIcons.CalendarOutline, "Card/Calendar", new CalendarPage(), _eventAggregator), - new("CardTitle/Carousel", MaterialIcons.ViewCarouselOutline, "Card/Carousel", new CarouselPage(), _eventAggregator), - new("CardTitle/ComboBox", MaterialIcons.ExpandAllOutline, "Card/ComboBox", new ComboBoxPage(), _eventAggregator), - new("CardTitle/TextBox", MaterialIcons.FormTextbox, "Card/TextBox", new TextBoxPage(), _eventAggregator), - new("CardTitle/DataGrid", MaterialIcons.Grid, "Card/DataGrid", new DataGridPage(), _eventAggregator), - new("CardTitle/PinCode", MaterialIcons.KeyboardOutline, "Card/PinCode", new PinCodePage(), _eventAggregator), - new("CardTitle/SelectionList", MaterialIcons.ViewListOutline, "Card/SelectionList", new SelectionListPage(), _eventAggregator), + new("CardTitle/Button", MaterialIcons.ButtonCursor, "Card/Button", () => new ButtonPage(), _eventAggregator), + new("CardTitle/Checkbox", MaterialIcons.CheckboxMarkedOutline,"Card/Checkbox", () => new CheckBoxPage(), _eventAggregator), + new("CardTitle/Progress", MaterialIcons.ProgressHelper, "Card/Progress", () => new ProgressPage(), _eventAggregator), + new("CardTitle/Calendar", MaterialIcons.CalendarOutline, "Card/Calendar", () => new CalendarPage(), _eventAggregator), + new("CardTitle/Carousel", MaterialIcons.ViewCarouselOutline, "Card/Carousel", () => new CarouselPage(), _eventAggregator), + new("CardTitle/ComboBox", MaterialIcons.ExpandAllOutline, "Card/ComboBox", () => new ComboBoxPage(), _eventAggregator), + new("CardTitle/TextBox", MaterialIcons.FormTextbox, "Card/TextBox", () => new TextBoxPage(), _eventAggregator), + new("CardTitle/DataGrid", MaterialIcons.Grid, "Card/DataGrid", () => new DataGridPage(), _eventAggregator), + new("CardTitle/PinCode", MaterialIcons.KeyboardOutline, "Card/PinCode", () => new PinCodePage(), _eventAggregator), + new("CardTitle/SelectionList", MaterialIcons.ViewListOutline, "Card/SelectionList", () => new SelectionListPage(), _eventAggregator), ]; } @@ -35,28 +35,28 @@ public AvaloniaList CreatePleasantControlPageCards() { return [ - new("CardTitle/PleasantSnackbar", MaterialIcons.InformationOutline, "Card/PleasantSnackbar", new PleasantSnackbarPage(), _eventAggregator), - new("CardTitle/InformationBlock", MaterialIcons.InformationBoxOutline, "Card/InformationBlock", new InformationBlockPage(), _eventAggregator), - new("CardTitle/OptionsDisplayItem", MaterialIcons.ViewListOutline, "Card/OptionsDisplayItem", new OptionsDisplayItemPage(), _eventAggregator), - new("CardTitle/PleasantTabView", MaterialIcons.Tab, "Card/PleasantTabView", new PleasantTabViewPage(), _eventAggregator), - new("CardTitle/PleasantMenu", MaterialIcons.MenuOpen, "Card/PleasantMenu", new PleasantMenuPage(), _eventAggregator), - new("CardTitle/Timeline", MaterialIcons.TimelineOutline, "Card/Timeline", new TimelinePage(), _eventAggregator), - new("CardTitle/InstallWizard", MaterialIcons.WizardHat, "Card/InstallWizard", new InstallWizardPage(), _eventAggregator), - new("CardTitle/PleasantDrawer", MaterialIcons.DrawingBox, "Card/PleasantDrawer", new PleasantDrawerPage(), _eventAggregator), - new("CardTitle/PopConfirm", MaterialIcons.CheckboxMarkedCircle, "Card/PopConfirm", new PopConfirmPage(), _eventAggregator), - new("CardTitle/PathPicker", MaterialIcons.FolderOpenOutline, "Card/PathPicker", new PathPickerPage(), _eventAggregator), - new("CardTitle/PleasantMiniWindow", MaterialIcons.WindowMinimize, "Card/PleasantMiniWindow", new PleasantMiniWindowPage(), _eventAggregator), - new("CardTitle/BreadcrumbBar", MaterialIcons.PageNextOutline, "Card/BreadcrumbBar", new BreadcrumbBarPage(), _eventAggregator), - new("CardTitle/CommandBar", MaterialIcons.ViewGridOutline, "Card/CommandBar", new CommandBarPage(), _eventAggregator), - new("CardTitle/DashboardCard", MaterialIcons.ViewDashboardOutline, "Card/DashboardCard", new DashboardCardPage(), _eventAggregator), - new("CardTitle/LogViewerPanel", MaterialIcons.TextBoxOutline, "Card/LogViewerPanel", new LogViewerPanelPage(), _eventAggregator), - new("CardTitle/TerminalPanel", MaterialIcons.ConsoleLine, "Card/TerminalPanel", new TerminalPanelPage(), _eventAggregator), - new("CardTitle/TreeViewPanel", MaterialIcons.FileTreeOutline, "Card/TreeViewPanel", new TreeViewPanelPage(), _eventAggregator), - new("CardTitle/ItemListPanel", MaterialIcons.FormatListBulletedType, "Card/ItemListPanel", new ItemListPanelPage(), _eventAggregator), - new("CardTitle/StepDialog", MaterialIcons.OrderNumericAscending, "Card/StepDialog", new StepDialogPage(), _eventAggregator), - new("CardTitle/PropertyGrid", MaterialIcons.TableColumnPlusAfter, "Card/PropertyGrid", new PropertyGridPage(), _eventAggregator), - new("CardTitle/DownloadPanel", MaterialIcons.DownloadOutline, "Card/DownloadPanel", new DownloadPanelPage(), _eventAggregator), - new("CardTitle/CrashReportDialog", MaterialIcons.BugOutline, "Card/CrashReportDialog", new CrashReportDialogPage(), _eventAggregator), + new("CardTitle/PleasantSnackbar", MaterialIcons.InformationOutline, "Card/PleasantSnackbar", () => new PleasantSnackbarPage(), _eventAggregator), + new("CardTitle/InformationBlock", MaterialIcons.InformationBoxOutline, "Card/InformationBlock", () => new InformationBlockPage(), _eventAggregator), + new("CardTitle/OptionsDisplayItem", MaterialIcons.ViewListOutline, "Card/OptionsDisplayItem", () => new OptionsDisplayItemPage(), _eventAggregator), + new("CardTitle/PleasantTabView", MaterialIcons.Tab, "Card/PleasantTabView", () => new PleasantTabViewPage(), _eventAggregator), + new("CardTitle/PleasantMenu", MaterialIcons.MenuOpen, "Card/PleasantMenu", () => new PleasantMenuPage(), _eventAggregator), + new("CardTitle/Timeline", MaterialIcons.TimelineOutline, "Card/Timeline", () => new TimelinePage(), _eventAggregator), + new("CardTitle/InstallWizard", MaterialIcons.WizardHat, "Card/InstallWizard", () => new InstallWizardPage(), _eventAggregator), + new("CardTitle/PleasantDrawer", MaterialIcons.DrawingBox, "Card/PleasantDrawer", () => new PleasantDrawerPage(), _eventAggregator), + new("CardTitle/PopConfirm", MaterialIcons.CheckboxMarkedCircle, "Card/PopConfirm", () => new PopConfirmPage(), _eventAggregator), + new("CardTitle/PathPicker", MaterialIcons.FolderOpenOutline, "Card/PathPicker", () => new PathPickerPage(), _eventAggregator), + new("CardTitle/PleasantMiniWindow", MaterialIcons.WindowMinimize, "Card/PleasantMiniWindow", () => new PleasantMiniWindowPage(), _eventAggregator), + new("CardTitle/BreadcrumbBar", MaterialIcons.PageNextOutline, "Card/BreadcrumbBar", () => new BreadcrumbBarPage(), _eventAggregator), + new("CardTitle/CommandBar", MaterialIcons.ViewGridOutline, "Card/CommandBar", () => new CommandBarPage(), _eventAggregator), + new("CardTitle/DashboardCard", MaterialIcons.ViewDashboardOutline, "Card/DashboardCard", () => new DashboardCardPage(), _eventAggregator), + new("CardTitle/LogViewerPanel", MaterialIcons.TextBoxOutline, "Card/LogViewerPanel", () => new LogViewerPanelPage(), _eventAggregator), + new("CardTitle/TerminalPanel", MaterialIcons.ConsoleLine, "Card/TerminalPanel", () => new TerminalPanelPage(), _eventAggregator), + new("CardTitle/TreeViewPanel", MaterialIcons.FileTreeOutline, "Card/TreeViewPanel", () => new TreeViewPanelPage(), _eventAggregator), + new("CardTitle/ItemListPanel", MaterialIcons.FormatListBulletedType, "Card/ItemListPanel", () => new ItemListPanelPage(), _eventAggregator), + new("CardTitle/StepDialog", MaterialIcons.OrderNumericAscending, "Card/StepDialog", () => new StepDialogPage(), _eventAggregator), + new("CardTitle/PropertyGrid", MaterialIcons.TableColumnPlusAfter, "Card/PropertyGrid", () => new PropertyGridPage(), _eventAggregator), + new("CardTitle/DownloadPanel", MaterialIcons.DownloadOutline, "Card/DownloadPanel", () => new DownloadPanelPage(), _eventAggregator), + new("CardTitle/CrashReportDialog", MaterialIcons.BugOutline, "Card/CrashReportDialog", () => new CrashReportDialogPage(), _eventAggregator), ]; } @@ -64,8 +64,8 @@ public AvaloniaList CreateToolkitControlPageCards() { return [ - new("CardTitle/MessageBox", MaterialIcons.MessageOutline, "Card/MessageBox", new MessageBoxPage(), _eventAggregator), - new("CardTitle/Docking", MaterialIcons.ViewDashboardOutline, "Card/Docking", new DockingPage(), _eventAggregator), + new("CardTitle/MessageBox", MaterialIcons.MessageOutline, "Card/MessageBox", () => new MessageBoxPage(), _eventAggregator), + new("CardTitle/Docking", MaterialIcons.ViewDashboardOutline, "Card/Docking", () => new DockingPage(), _eventAggregator), ]; } } \ No newline at end of file diff --git a/samples/PleasantUI.Example/Models/ControlPageCard.cs b/samples/PleasantUI.Example/Models/ControlPageCard.cs index 11f01e3f..b0ecec72 100644 --- a/samples/PleasantUI.Example/Models/ControlPageCard.cs +++ b/samples/PleasantUI.Example/Models/ControlPageCard.cs @@ -19,7 +19,7 @@ public class ControlPageCard : INotifyPropertyChanged public string TitleKey { get; } public string DescriptionKey { get; } public Geometry Icon { get; set; } - public IPage Page { get; set; } + public Func Page { get; set; } public string Title { @@ -43,7 +43,7 @@ private set } } - public ControlPageCard(string titleKey, Geometry icon, string descriptionKey, IPage page, IEventAggregator eventAggregator) + public ControlPageCard(string titleKey, Geometry icon, string descriptionKey, Func page, IEventAggregator eventAggregator) { _eventAggregator = eventAggregator; TitleKey = titleKey; @@ -79,5 +79,5 @@ private static string Resolve(string key) => Localizer.Instance.TryGetString(key, out string value) ? value : key; public void OpenPage() => - _eventAggregator.PublishAsync(new ChangePageMessage(Page)); + _eventAggregator.PublishAsync(new ChangePageMessage(Page.Invoke())); } diff --git a/samples/PleasantUI.Example/PleasantUI.Example.csproj b/samples/PleasantUI.Example/PleasantUI.Example.csproj index e86aa45d..7a538881 100644 --- a/samples/PleasantUI.Example/PleasantUI.Example.csproj +++ b/samples/PleasantUI.Example/PleasantUI.Example.csproj @@ -23,6 +23,9 @@ + + + From b0322323203f65d621cd4e92310b40c1e44ad731 Mon Sep 17 00:00:00 2001 From: Dmitry Zhutkov Date: Sat, 11 Apr 2026 14:40:06 +0500 Subject: [PATCH 2/5] Update PleasantUI.Example.Desktop.csproj --- .../PleasantUI.Example.Desktop.csproj | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj b/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj index 840e5458..4de84deb 100644 --- a/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj +++ b/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj @@ -13,20 +13,6 @@ true - - embedded - true - $(DefineConstants);ENABLE_XAML_HOT_RELOAD - - - - $(MSBuildProjectDirectory)\..\..\src\PleasantUI - - - - - - From f17f2e2090d609373614199805c004350c9e1ec0 Mon Sep 17 00:00:00 2001 From: Dmitry Zhutkov Date: Sat, 11 Apr 2026 14:40:57 +0500 Subject: [PATCH 3/5] Update PleasantUI.Example.Desktop.csproj --- .../PleasantUI.Example.Desktop.csproj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj b/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj index 4de84deb..8db2d6c6 100644 --- a/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj +++ b/samples/PleasantUI.Example.Desktop/PleasantUI.Example.Desktop.csproj @@ -12,6 +12,11 @@ PleasantUIIcon.ico true + + + embedded + true + From 0a9cbf4ea96318c39387d570c594a26a7a8bb3c5 Mon Sep 17 00:00:00 2001 From: redmarklabs Date: Sat, 25 Apr 2026 13:30:27 +0100 Subject: [PATCH 4/5] Fixed MiniWindow title bar buttons --- .../Properties/Localizations/App.resx | 2 +- .../Properties/Localizations/App.ru.resx | 2 +- .../PleasantMiniWindowPageView.axaml | 4 +-- .../PleasantMiniWindowPageView.axaml.cs | 10 +++--- .../PleasantMiniWindow/PleasantMiniWindow.cs | 35 +++++++++++++------ .../PleasantControls/PleasantMiniWindow.axaml | 15 +++++--- 6 files changed, 46 insertions(+), 22 deletions(-) diff --git a/samples/PleasantUI.Example/Properties/Localizations/App.resx b/samples/PleasantUI.Example/Properties/Localizations/App.resx index 0b9cc9a6..d65e3a26 100644 --- a/samples/PleasantUI.Example/Properties/Localizations/App.resx +++ b/samples/PleasantUI.Example/Properties/Localizations/App.resx @@ -648,7 +648,7 @@ The above copyright notice and this permission notice shall be included in all c Key properties Shows the custom drag handle and caption buttons instead of the OS title bar. Shows a pin button that toggles always-on-top (Topmost). - Shows a minimize button that collapses the window to the taskbar. + Shows a minimize button that collapses the window to the taskbar. Enables acrylic/blur transparency behind the window background. diff --git a/samples/PleasantUI.Example/Properties/Localizations/App.ru.resx b/samples/PleasantUI.Example/Properties/Localizations/App.ru.resx index 7257aaa1..c9937ebf 100644 --- a/samples/PleasantUI.Example/Properties/Localizations/App.ru.resx +++ b/samples/PleasantUI.Example/Properties/Localizations/App.ru.resx @@ -620,7 +620,7 @@ Ключевые свойства Показывает настраиваемую ручку перетаскивания и кнопки заголовка вместо системной строки заголовка. Показывает кнопку закрепления, переключающую режим «поверх всех окон» (Topmost). - Показывает кнопку сворачивания, скрывающую окно на панель задач. + Показывает кнопку сворачивания, скрывающую окно на панель задач. Включает акриловое/размытое прозрачное фоновое покрытие окна. diff --git a/samples/PleasantUI.Example/Views/Pages/PleasantControlPages/PleasantMiniWindowPageView.axaml b/samples/PleasantUI.Example/Views/Pages/PleasantControlPages/PleasantMiniWindowPageView.axaml index 9ea79264..94e6dc35 100644 --- a/samples/PleasantUI.Example/Views/Pages/PleasantControlPages/PleasantMiniWindowPageView.axaml +++ b/samples/PleasantUI.Example/Views/Pages/PleasantControlPages/PleasantMiniWindowPageView.axaml @@ -44,8 +44,8 @@ - - + + diff --git a/samples/PleasantUI.Example/Views/Pages/PleasantControlPages/PleasantMiniWindowPageView.axaml.cs b/samples/PleasantUI.Example/Views/Pages/PleasantControlPages/PleasantMiniWindowPageView.axaml.cs index 1b9296d2..0e4524b4 100644 --- a/samples/PleasantUI.Example/Views/Pages/PleasantControlPages/PleasantMiniWindowPageView.axaml.cs +++ b/samples/PleasantUI.Example/Views/Pages/PleasantControlPages/PleasantMiniWindowPageView.axaml.cs @@ -35,10 +35,12 @@ private void OpenSteamPanel() { var steamWindow = new PleasantMiniWindow { - Title = "Steam", - Width = 460, - Height = 340, - ShowHiddenButton = true, + Title = "Steam", + Width = 460, + Height = 340, + ShowPinButton = true, + ShowMinimizeButton = true, + ShowCloseButton = true, }; // Nav items: (label, description, opens games list) diff --git a/src/PleasantUI/Controls/PleasantMiniWindow/PleasantMiniWindow.cs b/src/PleasantUI/Controls/PleasantMiniWindow/PleasantMiniWindow.cs index 3e7b57af..7487ebfc 100644 --- a/src/PleasantUI/Controls/PleasantMiniWindow/PleasantMiniWindow.cs +++ b/src/PleasantUI/Controls/PleasantMiniWindow/PleasantMiniWindow.cs @@ -15,20 +15,20 @@ public class PleasantMiniWindow : PleasantWindowBase private Button? _closeButton; private Panel? _dragWindowPanel; - private Button? _hiddenButton; + private Button? _minimizeButton; protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { base.OnApplyTemplate(e); _closeButton = e.NameScope.Find From 6a6f86af65dc9116cd439747b334ed5c76fed1cc Mon Sep 17 00:00:00 2001 From: redmarklabs Date: Sat, 25 Apr 2026 13:37:15 +0100 Subject: [PATCH 5/5] Updated MiniWindow docs and set defaults --- docs/PleasantMiniWindow.md | 3 ++- .../Controls/PleasantMiniWindow/PleasantMiniWindow.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/PleasantMiniWindow.md b/docs/PleasantMiniWindow.md index 17047c8c..340c4cf5 100644 --- a/docs/PleasantMiniWindow.md +++ b/docs/PleasantMiniWindow.md @@ -29,7 +29,8 @@ public partial class MyToolWindow : PleasantMiniWindow | `EnableCustomTitleBar` | `bool` | from settings | Replaces the OS title bar with the minimal Fluent one | | `EnableBlur` | `bool` | from settings | Acrylic/blur background | | `ShowPinButton` | `bool` | `true` | Shows the pin (always-on-top) toggle button | -| `ShowHiddenButton` | `bool` | `false` | Shows a minimize button | +| `ShowMinimizedButton` | `bool` | `false` | Shows a minimize button | +| `ShowClosedButton` | `bool` | `true` | Shows a close button | ## Showing as a dialog diff --git a/src/PleasantUI/Controls/PleasantMiniWindow/PleasantMiniWindow.cs b/src/PleasantUI/Controls/PleasantMiniWindow/PleasantMiniWindow.cs index 7487ebfc..e9e1f5a6 100644 --- a/src/PleasantUI/Controls/PleasantMiniWindow/PleasantMiniWindow.cs +++ b/src/PleasantUI/Controls/PleasantMiniWindow/PleasantMiniWindow.cs @@ -55,13 +55,13 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e) /// Defines the property. /// public static readonly StyledProperty ShowMinimizeButtonProperty = - AvaloniaProperty.Register(nameof(ShowMinimizeButton)); + AvaloniaProperty.Register(nameof(ShowMinimizeButton), false); /// /// Defines the property. /// public static readonly StyledProperty ShowCloseButtonProperty = - AvaloniaProperty.Register(nameof(ShowCloseButton)); + AvaloniaProperty.Register(nameof(ShowCloseButton), true); /// /// Defines the property.