AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
26.05k stars 2.25k forks source link

Allow the user to choose the resize border size when using ExtendClientAreaToDecorationsHint #10040

Open LouChiSoft opened 1 year ago

LouChiSoft commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, as far as I can tell, if you use the ExtendClientAreaToDecorationsHint="True" option the outer 6-8 pixels are used for resizing the window. I am trying to create a custom titlebar that doubles as a tabline, but above that I want a small empty area that can be used as a drag handle. The problem is that the resize are is that large that the drag handle area has to take up a pretty large amount of space to be useful.

Describe the solution you'd like An additional option on the Window control that lets you decide where the resize area starts and ends. Example:

WindowResizeArea="0,3" <!-- This would set the resize border to the outer most 4 pixels of a window -->
WindowResizeArea="-2,1" <!-- This would set the resize border to the 2 pixels outside the window, and the outer most 2 pixels of the window itself -->

Describe alternatives you've considered I am new to Avalonia and MVVM in general so don't know if there is an alternative. But when trying to find any references to the resize area there didn't seem to be any.

maxkatz6 commented 1 year ago

Unfortunately, I don't think there is even close possibilities to have a crossplatform API for that feature. I could be done in two ways:

LouChiSoft commented 1 year ago

Oh really, that's a shame. I'm wanting to make a bit of a production app, so any padding is really just wasted space in this case. Even if it is only 6-8 pixels on each side. And on a more subjective not doesn't look as good in my opinion.