Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion build/Package.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@

<PackageProjectUrl>https://github.com/Onebeld/PleasantUI</PackageProjectUrl>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="HotAvalonia" Version="3.*" PrivateAssets="All" Publish="True" />
<PackageReference Include="MonoMod.RuntimeDetour" Version="*" PrivateAssets="All" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="12.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="**\*.axaml"/>
<Compile Update="**\*.axaml.cs"/>
Expand Down
3 changes: 2 additions & 1 deletion docs/PleasantMiniWindow.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ApplicationIcon>PleasantUIIcon.ico</ApplicationIcon>
<IncludeAvaloniaGenerators>true</IncludeAvaloniaGenerators>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>embedded</DebugType>
<IncludeSymbolsInSingleFile>true</IncludeSymbolsInSingleFile>
Expand All @@ -23,6 +23,9 @@
<PackageReference Include="Avalonia.Desktop" Version="12.0.0" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.0" />
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="9.0.8" />
<PackageReference Include="HotAvalonia" Version="3.*" PrivateAssets="All" Publish="True" />
<PackageReference Include="MonoMod.RuntimeDetour" Version="*" PrivateAssets="All" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="12.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
70 changes: 35 additions & 35 deletions samples/PleasantUI.Example/Factories/ControlPageCardsFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,55 @@ public AvaloniaList<ControlPageCard> 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),
];
}

public AvaloniaList<ControlPageCard> 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/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/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),
];
}

public AvaloniaList<ControlPageCard> CreateToolkitControlPageCards()
{
return
[
new("CardTitle/MessageBox", MaterialIcons.MessageOutline, "Card/MessageBox", new MessageBoxPage(), _eventAggregator),
new("CardTitle/NoticeDialog", MaterialIcons.InformationOutline, "Card/NoticeDialog", new NoticeDialogPage(), _eventAggregator),
new("CardTitle/StepDialog", MaterialIcons.OrderNumericAscending, "Card/StepDialog", new StepDialogPage(), _eventAggregator),
new("CardTitle/Docking", MaterialIcons.ViewDashboardOutline, "Card/Docking", new DockingPage(), _eventAggregator),
new("CardTitle/MessageBox", MaterialIcons.MessageOutline, "Card/MessageBox", () => new MessageBoxPage(), _eventAggregator),
new("CardTitle/NoticeDialog", MaterialIcons.InformationOutline, "Card/NoticeDialog", () => new NoticeDialogPage(), _eventAggregator),
new("CardTitle/StepDialog", MaterialIcons.OrderNumericAscending, "Card/StepDialog", () => new StepDialogPage(), _eventAggregator),
new("CardTitle/Docking", MaterialIcons.ViewDashboardOutline, "Card/Docking", () => new DockingPage(), _eventAggregator),
];
}
}
6 changes: 3 additions & 3 deletions samples/PleasantUI.Example/Models/ControlPageCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IPage> Page { get; set; }

public string Title
{
Expand All @@ -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<IPage> page, IEventAggregator eventAggregator)
{
_eventAggregator = eventAggregator;
TitleKey = titleKey;
Expand Down Expand Up @@ -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()));
}
3 changes: 3 additions & 0 deletions samples/PleasantUI.Example/PleasantUI.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<ItemGroup>
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="HotAvalonia" Version="3.*" PrivateAssets="All" Publish="True" />
<PackageReference Include="MonoMod.RuntimeDetour" Version="*" PrivateAssets="All" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="12.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ The above copyright notice and this permission notice shall be included in all c
<data name="MiniWindow/PropsTitle" xml:space="preserve"><value>Key properties</value></data>
<data name="MiniWindow/PropEnableCustomTitleBar" xml:space="preserve"><value>Shows the custom drag handle and caption buttons instead of the OS title bar.</value></data>
<data name="MiniWindow/PropShowPinButton" xml:space="preserve"><value>Shows a pin button that toggles always-on-top (Topmost).</value></data>
<data name="MiniWindow/PropShowHiddenButton" xml:space="preserve"><value>Shows a minimize button that collapses the window to the taskbar.</value></data>
<data name="MiniWindow/PropShowMinimizeButton" xml:space="preserve"><value>Shows a minimize button that collapses the window to the taskbar.</value></data>
<data name="MiniWindow/PropEnableBlur" xml:space="preserve"><value>Enables acrylic/blur transparency behind the window background.</value></data>

<!-- StepDialog page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@
<data name="MiniWindow/PropsTitle" xml:space="preserve"><value>Ключевые свойства</value></data>
<data name="MiniWindow/PropEnableCustomTitleBar" xml:space="preserve"><value>Показывает настраиваемую ручку перетаскивания и кнопки заголовка вместо системной строки заголовка.</value></data>
<data name="MiniWindow/PropShowPinButton" xml:space="preserve"><value>Показывает кнопку закрепления, переключающую режим «поверх всех окон» (Topmost).</value></data>
<data name="MiniWindow/PropShowHiddenButton" xml:space="preserve"><value>Показывает кнопку сворачивания, скрывающую окно на панель задач.</value></data>
<data name="MiniWindow/PropShowMinimizeButton" xml:space="preserve"><value>Показывает кнопку сворачивания, скрывающую окно на панель задач.</value></data>
<data name="MiniWindow/PropEnableBlur" xml:space="preserve"><value>Включает акриловое/размытое прозрачное фоновое покрытие окна.</value></data>

<!-- StepDialog page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
<TextBlock Grid.Row="0" Grid.Column="2" Text="{Localize MiniWindow/PropEnableCustomTitleBar}" TextWrapping="Wrap" FontSize="12" Foreground="{DynamicResource TextFillColor2}" />
<TextBlock Grid.Row="1" Grid.Column="0" Text="ShowPinButton" FontFamily="Consolas,Monospace" FontSize="12" Foreground="{DynamicResource AccentFillColor1}" VerticalAlignment="Center" Margin="0 6 0 0" />
<TextBlock Grid.Row="1" Grid.Column="2" Text="{Localize MiniWindow/PropShowPinButton}" TextWrapping="Wrap" FontSize="12" Foreground="{DynamicResource TextFillColor2}" Margin="0 6 0 0" />
<TextBlock Grid.Row="2" Grid.Column="0" Text="ShowHiddenButton" FontFamily="Consolas,Monospace" FontSize="12" Foreground="{DynamicResource AccentFillColor1}" VerticalAlignment="Center" Margin="0 6 0 0" />
<TextBlock Grid.Row="2" Grid.Column="2" Text="{Localize MiniWindow/PropShowHiddenButton}" TextWrapping="Wrap" FontSize="12" Foreground="{DynamicResource TextFillColor2}" Margin="0 6 0 0" />
<TextBlock Grid.Row="2" Grid.Column="0" Text="ShowMinimizeButton" FontFamily="Consolas,Monospace" FontSize="12" Foreground="{DynamicResource AccentFillColor1}" VerticalAlignment="Center" Margin="0 6 0 0" />
<TextBlock Grid.Row="2" Grid.Column="2" Text="{Localize MiniWindow/PropShowMinimizeButton}" TextWrapping="Wrap" FontSize="12" Foreground="{DynamicResource TextFillColor2}" Margin="0 6 0 0" />
<TextBlock Grid.Row="3" Grid.Column="0" Text="EnableBlur" FontFamily="Consolas,Monospace" FontSize="12" Foreground="{DynamicResource AccentFillColor1}" VerticalAlignment="Center" Margin="0 6 0 0" />
<TextBlock Grid.Row="3" Grid.Column="2" Text="{Localize MiniWindow/PropEnableBlur}" TextWrapping="Wrap" FontSize="12" Foreground="{DynamicResource TextFillColor2}" Margin="0 6 0 0" />
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading
Loading