Skip to content

Commit 81a62ff

Browse files
committed
chore: 更新至v2.2.8-beta.2
1 parent 32e54d6 commit 81a62ff

4 files changed

Lines changed: 92 additions & 9 deletions

File tree

MFAAvalonia/ViewModels/Windows/RootViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static string Version
3737
// var minor = version.Minor >= 0 ? version.Minor : 0;
3838
// var patch = version.Build >= 0 ? version.Build : 0;
3939
// return $"v{SemVersion.Parse($"{major}.{minor}.{patch}")}";
40-
return "v2.2.8-beta.1"; // Hardcoded version for now, replace with dynamic versioning later
40+
return "v2.2.8-beta.2"; // Hardcoded version for now, replace with dynamic versioning later
4141
}
4242
}
4343

MFAAvalonia/Views/Pages/TaskQueueView.axaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,10 +1127,10 @@
11271127
</interaction:Interaction.Behaviors>
11281128
</GridSplitter>
11291129

1130-
<Grid Grid.Column="4" RowDefinitions="Auto,*">
1130+
<Grid Grid.Column="4" RowDefinitions="Auto,*" Margin=" 0 0 5 0">
11311131

11321132
<!-- Live View Card -->
1133-
<suki:GlassCard Grid.Row="0" IsAnimated="False" Margin="0,0,15,10"
1133+
<suki:GlassCard Grid.Row="0" IsAnimated="False" Margin="0,0,0,10"
11341134
x:Name="LiveViewCard"
11351135
IsVisible="{Binding IsLiveViewVisible, Source={x:Static helper:Instances.TaskQueueViewModel}}">
11361136
<suki:GroupBox>
@@ -1279,7 +1279,7 @@
12791279
<!-- 右侧列:日志记录 -->
12801280
<suki:GlassCard Grid.Row="1"
12811281
IsAnimated="False"
1282-
Margin="0,0,15,0"
1282+
12831283
x:Name="LogCard"
12841284
PointerPressed="LogCard_PointerPressed"
12851285
ClipToBounds="True">
@@ -1345,12 +1345,12 @@
13451345
<ItemsControl ItemsSource="{Binding Path=LogItemViewModels}">
13461346
<ItemsControl.ItemsPanel>
13471347
<ItemsPanelTemplate>
1348-
<VirtualizingStackPanel />
1348+
<StackPanel Spacing="8" />
13491349
</ItemsPanelTemplate>
13501350
</ItemsControl.ItemsPanel>
13511351
<ItemsControl.ItemTemplate>
13521352
<DataTemplate>
1353-
<Grid Name="ParentGrid" MinHeight="35">
1353+
<Grid Name="ParentGrid" >
13541354
<Grid.ColumnDefinitions>
13551355
<ColumnDefinition Width="Auto" />
13561356
<ColumnDefinition Width="*" />

MFAAvalonia/Views/Pages/TaskQueueView.axaml.cs

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,10 +620,95 @@ await Task.WhenAll(
620620
public void InitializeDeviceSelectorLayout()
621621
{
622622
TopToolbar.SizeChanged += (_, _) => UpdateConnectionLayout();
623-
ThreeColumnGrid.SizeChanged += (_, _) => UpdateThreeColumnLayout();
623+
ThreeColumnGrid.SizeChanged += (_, _) =>
624+
{
625+
UpdateThreeColumnLayout();
626+
// AdjustColumnWidthsForAvailableSpace();
627+
};
628+
624629
UpdateConnectionLayout();
625630
UpdateThreeColumnLayout();
626631
}
632+
private double _lastThreeColumnGridWidth = 0;
633+
//
634+
// /// <summary>
635+
// /// 当窗口大小缩小时,调整列宽度以保持右边距
636+
// /// 优先级:先减右侧面板,右侧到最小值后再减左侧面板
637+
// /// </summary>
638+
// private void AdjustColumnWidthsForAvailableSpace()
639+
// {
640+
// var viewModel = Instances.TaskQueueViewModel;
641+
// if (viewModel == null || ThreeColumnGrid == null) return;
642+
//
643+
// // 只在横向三列模式下处理
644+
// if (_currentThreeColumnLayoutMode != 0) return;
645+
//
646+
// var availableWidth = ThreeColumnGrid.Bounds.Width;
647+
// if (availableWidth <= 0) return;
648+
//
649+
// // 只在窗口缩小时才触发
650+
// if (availableWidth >= _lastThreeColumnGridWidth)
651+
// {
652+
// _lastThreeColumnGridWidth = availableWidth;
653+
// return;
654+
// }
655+
//
656+
// _lastThreeColumnGridWidth = availableWidth;
657+
//
658+
// // 计算固定部分的宽度:左边距15+ 右边距15 + 两个分隔符各15
659+
// const double fixedMargins = 15 + 15 + 15 + 15;
660+
// const double minPanelWidth = 40; // 面板最小宽度
661+
//
662+
// // 获取当前列宽
663+
// var col1Width = viewModel.Column1Width.IsAbsolute ? viewModel.Column1Width.Value : (ThreeColumnGrid.ColumnDefinitions.Count > 0 ? ThreeColumnGrid.ColumnDefinitions[0].ActualWidth : 350);
664+
// var col2Width = viewModel.Column2Width.IsAbsolute ? viewModel.Column2Width.Value : (ThreeColumnGrid.ColumnDefinitions.Count > 2 ? ThreeColumnGrid.ColumnDefinitions[2].ActualWidth : 200);
665+
// var col3Width = viewModel.Column3Width.IsAbsolute ? viewModel.Column3Width.Value : (ThreeColumnGrid.ColumnDefinitions.Count > 4 ? ThreeColumnGrid.ColumnDefinitions[4].ActualWidth : 350);
666+
//
667+
// // 计算当前总宽度
668+
// var totalUsed = col1Width + col2Width + col3Width + fixedMargins;
669+
// // 如果没有超出可用宽度,不需要调整
670+
// if (totalUsed <= availableWidth) return;
671+
//
672+
// var overflow = totalUsed - availableWidth;
673+
// var newCol1Width = col1Width;
674+
// var newCol3Width = col3Width;
675+
// var changed = false;
676+
//
677+
// // 第一步:先减右侧面板
678+
// if (overflow > 0 && col3Width > minPanelWidth)
679+
// {
680+
// var canReduce = col3Width - minPanelWidth;
681+
// var reduceAmount = Math.Min(canReduce, overflow);
682+
// newCol3Width = col3Width - reduceAmount;
683+
// overflow -= reduceAmount;
684+
// changed = true;
685+
// }
686+
//
687+
// // 第二步:右侧已达最小值,减左侧面板
688+
// if (overflow > 0 && col1Width > minPanelWidth)
689+
// {
690+
// var canReduce = col1Width - minPanelWidth;
691+
// var reduceAmount = Math.Min(canReduce, overflow);
692+
// newCol1Width = col1Width - reduceAmount;
693+
// changed = true;
694+
// }
695+
//
696+
// // 应用更改
697+
// if (changed)
698+
// {
699+
// viewModel.SuppressPropertyChangedCallbacks = true;
700+
// if (newCol3Width != col3Width)
701+
// {
702+
// viewModel.Column3Width = new GridLength(newCol3Width, GridUnitType.Pixel);
703+
// }
704+
// if (newCol1Width != col1Width)
705+
// {
706+
// viewModel.Column1Width = new GridLength(newCol1Width, GridUnitType.Pixel);
707+
// }
708+
// viewModel.SuppressPropertyChangedCallbacks = false;
709+
// }
710+
// }
711+
627712

628713
public void UpdateConnectionLayout(bool forceUpdate = false)
629714
{

MFAAvalonia/Views/Windows/RootView.axaml.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,6 @@ public void LoadUI()
310310
{
311311
DispatcherHelper.RunOnMainThread(VersionChecker.CheckMinVersion);
312312
AnnouncementViewModel.CheckAnnouncement();
313-
AddLog(" > 测试");
314-
AddMarkdown(" > 测试");
315313
if (ConfigurationManager.Current.GetValue(ConfigurationKeys.AutoMinimize, false))
316314
{
317315
WindowState = WindowState.Minimized;

0 commit comments

Comments
 (0)