Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove -77 #2097

Closed
wants to merge 0 commits into from
Closed

Remove -77 #2097

wants to merge 0 commits into from

Conversation

IXLLEGACYIXL
Copy link
Collaborator

PR Details

Changing -77 to 77

Description

XAML always spammed errors during usage continously that negative values are invalid

Motivation and Context

Nobody knows why its negative and there was no answer for it and the menuitems are the same as before, just not a spam of bind exceptions

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@manio143
Copy link
Member

manio143 commented Jan 8, 2024

From what I see this code was trying to set MaxWidth to be ActualWidth - 77. Not sure what would trigger the MaxWidth to cause clipping the width value (maybe higher resolution screen?), but I don't think changing the value to positive would be correct.
SumNum performs addition on two doubles. Maybe we need SubNum which will do subtraction?

@Kryptos-FR
Copy link
Member

Yeah it could have been a DPI issue (we had quite a lot of them in the past, but I think some were fixed in WPF in later versions). I'll try to find the original commit.

@@ -157,9 +157,9 @@
<!-- Parameters of the SumNum converters used here must be the total width of fixed columns + MinWidths of sizable columns: 8+5+64=77 -->
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="{Binding NameColumnSize, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type sd:PropertyView}}, Mode=TwoWay}"
MaxWidth="{Binding ActualWidth, ElementName=Grid, Converter={sd:SumNum}, ConverterParameter={sd:Double -77}}" MinWidth="64"/>
MaxWidth="{Binding ActualWidth, ElementName=Grid, Converter={sd:SumNum}, ConverterParameter={sd:Double 77}}" MinWidth="64"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the value to a positive one doesn't make more sense: we would be expanding the MaxWidth to an ever increasing value. After some thought I believe it might have been a workaround for some constraints not working on columns in an earlier version of WPF. Today, it is pointless. A final fix should be to just remove it altogether.

Suggested change
MaxWidth="{Binding ActualWidth, ElementName=Grid, Converter={sd:SumNum}, ConverterParameter={sd:Double 77}}" MinWidth="64"/>
MinWidth="64"/>

And apply the same on all other cases (as well as removing the comment above).

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.

None yet

3 participants