Skip to content

Commit

Permalink
Use SimpleVirtualizingStackPanel on ListBox of marked logs and time c…
Browse files Browse the repository at this point in the history
…ategories.
  • Loading branch information
hamster620 committed Oct 20, 2023
1 parent 10fd5ed commit f5b92c0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
31 changes: 29 additions & 2 deletions ULogViewer/Controls/SessionView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,23 @@
<TextBlock Classes="SessionView_SidePanel_Header_Right" Grid.Column="1" Text="{Binding MarkedLogs.Count, StringFormat={} ({0})}"/>
</Grid>
</Border>
<asControls:ListBox Classes="Log" Name="markedLogListBox" Background="{x:Static Brushes.Transparent}" BorderThickness="0" Focusable="False" Grid.Row="1" DoubleClickOnItem="OnMarkedLogListBoxDoubleClickOnItem" IsVisible="{Binding HasMarkedLogs}" ItemsSource="{Binding MarkedLogs}" SelectionChanged="OnMarkedLogListBoxSelectionChanged" SelectionMode="Single"/>
<asControls:ListBox Classes="Log"
Name="markedLogListBox"
Background="{x:Static Brushes.Transparent}"
BorderThickness="0"
Focusable="False"
Grid.Row="1"
DoubleClickOnItem="OnMarkedLogListBoxDoubleClickOnItem"
IsVisible="{Binding HasMarkedLogs}"
ItemsSource="{Binding MarkedLogs}"
SelectionChanged="OnMarkedLogListBoxSelectionChanged"
SelectionMode="Single">
<asControls:ListBox.ItemsPanel>
<ItemsPanelTemplate>
<appControls:SimpleVirtualizingStackPanel ItemHeight="{DynamicResource Double/SessionView.MarkedLogListBox.Item.Height}"/>
</ItemsPanelTemplate>
</asControls:ListBox.ItemsPanel>
</asControls:ListBox>
</Grid>

<!-- Timestamp categories -->
Expand All @@ -1619,7 +1635,18 @@
<TextBlock Classes="SessionView_SidePanel_Header_Right" Grid.Column="1" Text="{Binding TimestampCategories.Count, StringFormat={} ({0})}"/>
</Grid>
</Border>
<asControls:ListBox Classes="Log" Name="timestampCategoryListBox" Background="{x:Static Brushes.Transparent}" BorderThickness="0" Focusable="False" Grid.Row="1" ItemsSource="{Binding LogCategorizing.TimestampCategories}">
<asControls:ListBox Classes="Log"
Name="timestampCategoryListBox"
Background="{x:Static Brushes.Transparent}"
BorderThickness="0"
Focusable="False"
Grid.Row="1"
ItemsSource="{Binding LogCategorizing.TimestampCategories}">
<asControls:ListBox.ItemsPanel>
<ItemsPanelTemplate>
<appControls:SimpleVirtualizingStackPanel ItemHeight="{DynamicResource Double/SessionView.MarkedLogListBox.Item.Height}"/>
</ItemsPanelTemplate>
</asControls:ListBox.ItemsPanel>
<asControls:ListBox.ItemTemplate>
<DataTemplate x:CompileBindings="True" x:DataType="appCategorizing:DisplayableLogCategory">
<Grid ColumnDefinitions="Auto,*">
Expand Down
2 changes: 1 addition & 1 deletion ULogViewer/Controls/SessionView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2370,7 +2370,7 @@ IDataTemplate CreateMarkedLogItemTemplate(LogProfile profile, IList<DisplayableL
it.Padding = itemPadding;
it.TextTrimming = TextTrimming.CharacterEllipsis;
it.TextWrapping = TextWrapping.NoWrap;
it.VerticalAlignment = VerticalAlignment.Top;
it.VerticalAlignment = VerticalAlignment.Center;
if (timestampStringProperty != null)
it.Bind(ToolTip.TipProperty, new Binding { Path = timestampStringProperty.Name });
});
Expand Down
2 changes: 2 additions & 0 deletions ULogViewer/Styles/Resources-Compact.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<sys:Double x:Key="Double/SessionView.LogFileInfo.Summary.FontSize">12</sys:Double>
<sys:Double x:Key="Double/SessionView.LogListBox.ColorIndicator.Width">6</sys:Double>
<sys:Double x:Key="Double/SessionView.LogListBox.Item.Height">20</sys:Double>
<sys:Double x:Key="Double/SessionView.MarkedLogListBox.Item.Height">20</sys:Double>
<Thickness x:Key="Thickness/SessionView.LogAnalysisRuleSetListBox.Icon.Margin">0,0,5,0</Thickness>
<Thickness x:Key="Thickness/SessionView.LogAnalysisRuleSetListBox.Item.Padding">5,3,18,3</Thickness>
<Thickness x:Key="Thickness/SessionView.LogAnalysisRuleSetsPopup.Padding">5</Thickness>
Expand All @@ -70,6 +71,7 @@
<Thickness x:Key="Thickness/SessionView.LogFileListBox.Item.Padding">5,3,5,3</Thickness>
<Thickness x:Key="Thickness/SessionView.LogHeader.Margin">3,4,3,4</Thickness>
<Thickness x:Key="Thickness/SessionView.LogListBox.MultiLineIndicator.Margin">2,0,4,0</Thickness>
<Thickness x:Key="Thickness/SessionView.MarkedLogListBox.Item.Padding">3,0,3,0</Thickness>
<Thickness x:Key="Thickness/SessionView.PredefinedLogTextFilterListBox.Item.Padding">5,3,18,3</Thickness>
<Thickness x:Key="Thickness/SessionView.PredefinedLogTextFiltersPopup.Padding">5</Thickness>
<Thickness x:Key="Thickness/SessionView.SidePanel.Header.Padding">0</Thickness>
Expand Down
1 change: 1 addition & 0 deletions ULogViewer/Styles/Resources.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
<sys:Double x:Key="Double/SessionView.LogListBox.MinSizeToCloseSidePanel">100</sys:Double>
<sys:Double x:Key="Double/SessionView.LogListBox.MultiLineIndicator.Opacity">0.3</sys:Double>
<sys:Double x:Key="Double/SessionView.LogsProgressBar.Height">2</sys:Double>
<sys:Double x:Key="Double/SessionView.MarkedLogListBox.Item.Height">24</sys:Double>
<sys:Double x:Key="Double/SessionView.PredefinedLogTextFilterListBox.Icon.Size">12</sys:Double>
<sys:Double x:Key="Double/SessionView.PredefinedLogTextFilterListBox.MaxHeight">400</sys:Double>
<sys:Double x:Key="Double/SessionView.PredefinedLogTextFilterListBox.MinHeight">100</sys:Double>
Expand Down

0 comments on commit f5b92c0

Please sign in to comment.