Fix target framework version and unintentionally reintroduced code

This commit is contained in:
Peter Kirmeier 2023-08-31 17:26:28 +02:00
parent 65a7340171
commit c5f9977c7d
2 changed files with 1 additions and 28 deletions

View file

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net7.0-windows10.0.22000.0</TargetFramework>
<SelfContained>true</SelfContained>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
<UseWPF>True</UseWPF>

View file

@ -960,33 +960,6 @@ namespace SystemTrayMenu.UserInterface
double icoWidth = 16 * Scaling.FactorByDpi;
Resources["ColumnIconWidth"] = Math.Ceiling(icoWidth * factorIconSizeInPercent * Scaling.Factor);
double renderedMaxWidth = 0D;
foreach (RowData item in dgv.Items)
{
double renderedWidth = new FormattedText(
item.ColumnText,
CultureInfo.CurrentCulture,
FlowDirection.LeftToRight,
new Typeface(dgv.FontFamily, dgv.FontStyle, dgv.FontWeight, dgv.FontStretch),
dgv.FontSize,
dgv.Foreground,
VisualTreeHelper.GetDpi(this).PixelsPerDip).Width;
if (renderedWidth > renderedMaxWidth)
{
renderedMaxWidth = renderedWidth;
}
}
//if (renderedMaxWidth == 0D)
//{
// renderedMaxWidth = 99999D;
//}
// Margin of the windowFrame is allowed to exceed the boundaries, so we just add them afterwards
//Resources["ColumnTextMaxWidth"] = Math.Ceiling(
// Math.Min(renderedMaxWidth, (double)Scaling.Factor * Scaling.FactorByDpi * 400D * (Settings.Default.WidthMaxInPercent / 100D))
// + windowFrame.Margin.Left + windowFrame.Margin.Right);
// Margin of the windowFrame is allowed to exceed the boundaries, so we just add them afterwards
Resources["ColumnTextMaxWidth"] = Math.Ceiling(
((double)Scaling.Factor * Scaling.FactorByDpi * 400D * (Settings.Default.WidthMaxInPercent / 100D))