Restore Autofit Column Width Button on Main Window (#10579)

* Add autofit column width button to ProfilesView

restore-autofit-column-width-button

* Restore autofit button
This commit is contained in:
tt2563
2026-11-13 14:16:23 +08:00
committed by GitHub
parent e3457fa4b4
commit e57e122770
2 changed files with 17 additions and 0 deletions
@@ -69,6 +69,16 @@
PlaceholderText="{x:Static resx:ResUI.MsgServerTitle}"
ToolTip.Tip="{x:Static resx:ResUI.MsgServerTitle}" />
<Button
x:Name="btnAutofitColumnWidth"
Margin="{StaticResource MarginLr4}"
Classes="IconButton Success"
ToolTip.Tip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}">
<Button.Content>
<PathIcon Data="{StaticResource SemiIconExpand}" />
</Button.Content>
</Button>
<Button
x:Name="btnFastRealPing"
Margin="{StaticResource MarginLr4}"
@@ -18,6 +18,7 @@ public partial class ProfilesView : ReactiveUserControl<ProfilesViewModel>
_config = AppManager.Instance.Config;
menuSelectAll.Click += menuSelectAll_Click;
btnAutofitColumnWidth.Click += BtnAutofitColumnWidth_Click;
txtServerFilter.KeyDown += TxtServerFilter_KeyDown;
lstProfiles.KeyDown += LstProfiles_KeyDown;
lstProfiles.SelectionChanged += lstProfiles_SelectionChanged;
@@ -316,6 +317,12 @@ public partial class ProfilesView : ReactiveUserControl<ProfilesViewModel>
}
}
private void BtnAutofitColumnWidth_Click(object? sender, RoutedEventArgs e)
{
AutofitColumnWidth();
}
private void AutofitColumnWidth()
{
try