Skip to content

[WIP] Pleasant Renaissance — Part 1: General changes and improvements#22

Draft
Onebeld wants to merge 14 commits into
mainfrom
dev
Draft

[WIP] Pleasant Renaissance — Part 1: General changes and improvements#22
Onebeld wants to merge 14 commits into
mainfrom
dev

Conversation

@Onebeld

@Onebeld Onebeld commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

This PR is the first part of a broader initiative to improve the overall quality of the PleasantUI codebase. The work includes cleaning up existing implementations, improving consistency across the library, fixing issues, and introducing new functionality where appropriate.

While AI-assisted code generation can be a valuable tool, generated code still requires careful review, testing, and refinement to ensure it meets the project's quality standards and remains consistent with the rest of the codebase.

This initiative is not the only one and there will be more PR.

Some changes may break some projects, but I can't call it version 6. In the future, I will try to minimize such critical changes.

What was added?

  • The README has been updated to explain the philosophy of this library and why it exists and why it has the name it does.
  • PleasantIcon - This control allows developers to use any icons. By default, it supports conversions from Geometry and IImage, and you can add them yourself, as is done for the sample app.
  • The ability to set a font for the program has been added. You can choose your favorite font installed on your system from the general list. The Montserrat font looks really nice, in my opinion!

Fonts

  • Animations based on composition rendering have been added. After some research, implicit animations can now be applied to controls within a parent. An animation for appearing in a list has also been added.
PleasantUI.Example.Desktop_KPTHCrnkr3.mp4
  • ColorPicker - This control allows you to change colors on the fly. This makes theme editing much more fun and color selection faster.
chrome_AQF7GiIQkj.mp4
  • The code has been updated with comments for authorship according to the SPDX standard.

  • SearchableComboBox - This control allows you to search for items without creating additional search functionality. It's still experimental, but the results are satisfactory.

explorer_CcdDo2G8Rx.mp4
  • PleasantUI now provides a source code generator for creating an enumeration file with localization keys, as well as an analyzer for using these keys in a project. The analyzer also checks for keys missing from resx files, highlighting the code in the editor and issuing a warning during compilation.

What was removed?

  • MaterialIcons source generator - This project should initially be internal to insert icons, assigning Geometry. With the new IconControl, the internal MaterialIcon should be removed.
  • SmoothScrollViewer (finally!) - This control is too complex to maintain in the next major version of Avalonia. Instead, it has been replaced with an attached property implementation.
  • VGUI theme - This theme is the most unique of all existing ones: while standard themes simply change colors, VGUI changes almost everything. Perhaps it will be reintroduced when full support for theme editing beyond colors is implemented.
  • PleasantReDock - This control is unstable; for some reason, it's in the core library but listed as being from the ToolKit. But the main reason is that it uses Xaml.Interactions.Interactivity to get its behavior, which can introduce reflection, which can interfere with AOT compilation.

What's planned next?

  • Replace NavigationView with a better solution. Honestly, I don't like the current implementation of this control. NavigationView refinement
  • Removing unnecessary functionality. If there is functionality that is redundant within the library, it is better to remove it.
  • Adding basic controls added in Avalonia 12

@Onebeld

Onebeld commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

If you've previously used SmoothScrollViewer in your projects, you can switch to the regular ScrollViewer. Smooth scrolling will automatically apply to all basic controls of this type.

…y, and added a ToolTip for the PleasantDrawer close button

+ Smooth horizontal scrolling is implemented if the user presses the Shift key.
+ You can now specify the direction in which scrolling will occur using the mouse wheel.
+ Added link to original code
@Onebeld Onebeld changed the title [WIP] A big change in the library [WIP] A comprehensive set of changes to PleasantUI Jun 17, 2026
@Onebeld

Onebeld commented Jun 20, 2026

Copy link
Copy Markdown
Owner Author

It appears that all code used for this project has been attributed according to the SPDX standard. If I've missed anything or formatted it incorrectly, please let me know.

@Onebeld Onebeld changed the title [WIP] A comprehensive set of changes to PleasantUI [WIP] A comprehensive set of changes to PleasantUI (part 1) Jun 28, 2026
@Onebeld

Onebeld commented Jun 28, 2026

Copy link
Copy Markdown
Owner Author

Thanks to the Composition renderer, I was able to implement smooth movement of elements

PleasantUI.Example.Desktop_KPTHCrnkr3.mp4

@redmarklabs

Copy link
Copy Markdown
Contributor

The smoothed element movement looks great! :)

Glad to see you're refining the NavigationView as well, it was a little strange the way it works.

I take it the VGUI theme got deleted as part of the AI code cleanup? Don't get me wrong I'd probably never have used it, and it wasn't exactly in keeping with the rest of the themes, but it did look kinda cool I guess.

@Onebeld

Onebeld commented Jun 29, 2026

Copy link
Copy Markdown
Owner Author

The smoothed element movement looks great! :)

Glad to see you're refining the NavigationView as well, it was a little strange the way it works.

I take it the VGUI theme got deleted as part of the AI code cleanup? Don't get me wrong I'd probably never have used it, and it wasn't exactly in keeping with the rest of the themes, but it did look kinda cool I guess.

Yes, I had to remove VGUI (PR #11) for several reasons:

  1. There are some areas, such as hard-coded window corner only on Windows, that can't be changed in any way, plus it requires a WinAPI call, even though it's a cross-platform library.
  2. Changes to control properties, such as CornerRadius, Margin, BorderThickness, etc., while in other themes only change colors.

These reasons are mainly due to the inability to customize this theme. Perhaps in the future, full editing of not only colors but also parameters will be implemented, but definitely not within the scope of this PR.

There's still a lot of work to do before we can deliver a good library to developers (making it perfect is quite difficult, and sometimes even impossible)

@Onebeld Onebeld self-assigned this Jun 29, 2026
@Onebeld

Onebeld commented Jul 2, 2026

Copy link
Copy Markdown
Owner Author

I would like to answer questions that customers may have regarding the source code generator and analyzer.

How can I use localization keys?

It's very simple. For convenience, create an AssemblyInfo.cs file in the Properties folder and paste this code. The enum file is located in the PleasantUI.Core.Localization namespace:

using Avalonia.Metadata;

[assembly: XmlnsDefinition("https://github.com/avaloniaui", "PleasantUI.Core.Localization")]

You can now use a key in AXAML files; the IDE will automatically suggest keys for you:

<TextBlock Theme="{DynamicResource TitleTextBlockTheme}"
                   TextAlignment="Center"
                   TextWrapping="Wrap"
                   Text="{Localize {x:Static LocKey.WelcomeToPleasantUI}}"/> 

This will also be accessible through C# code by simply specifying an Enum.

Does the generator support multiple resx files?

Yes! For the example application, I specifically separated the localization files: one is for library strings only, and the other is used in the final application.

How does the analyzer work?

The analyzer searches the code for all references to localization keys, and it doesn't matter whether you use a string or insert it via Enum.

The library contains localization strings. What happens to them if I include them in my application?

The analyzer will have a built-in list of keys that are in the library by default. This means the analyzer will not consider these keys when searching for unused ones.

@Onebeld

Onebeld commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

I would like to thank contributor @pieckenst for adding localization strings—and doing so in various ways.

This helped create an analyzer capable of handling even the most unusual and complex cases to check for the use of localization keys within the project.

Added unit tests for over 25 cases to the analyzer

@Onebeld Onebeld changed the title [WIP] A comprehensive set of changes to PleasantUI (part 1) [WIP] Pleasant Renaissance — Part 1: General changes and improvements Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants