fluentribbon / Fluent.Ribbon

WPF Ribbon control like in Office
http://fluentribbon.github.io
MIT License
2.48k stars 515 forks source link

Maximum dropdown height is not screen aware #1162

Closed pschimmel closed 2 months ago

pschimmel commented 10 months ago

Hi! I found a potential issue in the definition of the maximum height of a dropdown of the DropDown buttons. The dependency property is defined as follows:

public static readonly DependencyProperty MaxDropDownHeightProperty = DependencyProperty.Register(nameof(MaxDropDownHeight), typeof(double), typeof(DropDownButton), new PropertyMetadata(SystemParameters.PrimaryScreenHeight / 3.0));

As far as I know, the SystemParameters.PrimaryScreenHeight does not consider DPI settings of the monitors.

https://learn.microsoft.com/en-us/dotnet/api/system.windows.systemparameters.primaryscreenheight?view=windowsdesktop-7.0

In my opinion it is also questionably to use the height of the primary screen as the application could be shown on a different screen with totally different settings.

batzen commented 10 months ago

Indeed. It revert felt right to use the primary screen, regardless of the DPI issue. But i never found a better way to define a reasonable default. Will think about it again.

pschimmel commented 9 months ago

Indeed, I also had no better (simple) idea to what to set it to something meaningful. For now, I just set the max height to a very large number so that the size is only limited by the screen boundaries. This fixes my immediate problem that a dropdown with a large number of items in it always show the scrolling arrows when opened.