Skip to content

Commit 3301e02

Browse files
committed
- improve label readability for avg wait ratio by using black font over light grey background
- switch wait color legend to the right of the global wait header
1 parent 4bda395 commit 3301e02

2 files changed

Lines changed: 26 additions & 16 deletions

File tree

src/PlanViewer.App/Controls/WaitStatsProfileControl.axaml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
<UserControl xmlns="https://github.com/avaloniaui"
2-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3-
xmlns:local="using:PlanViewer.App.Controls"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:local="using:PlanViewer.App.Controls"
44
x:Class="PlanViewer.App.Controls.WaitStatsProfileControl">
55
<Grid RowDefinitions="Auto,*">
6-
<!-- Header: toggle chart type -->
7-
<StackPanel Grid.Row="0" Orientation="Horizontal" Spacing="6" Margin="4,2">
8-
<Button x:Name="ToggleChartButton" Content=""
6+
<!-- Header row: left controls + right-aligned legend button -->
7+
<Grid Grid.Row="0" ColumnDefinitions="Auto,Auto,*,Auto" Margin="4,2">
8+
<Button x:Name="ToggleChartButton" Grid.Column="0" Content="&#x25A4;"
99
Width="22" Height="22" Padding="0"
1010
FontSize="12" Background="Transparent" BorderThickness="0"
1111
Foreground="{DynamicResource ForegroundBrush}"
1212
ToolTip.Tip="Toggle bar / ribbon chart"
1313
Click="ToggleChart_Click"/>
14-
<TextBlock x:Name="TitleText" Text="Wait Stats"
14+
<TextBlock x:Name="TitleText" Grid.Column="1" Text="Wait Stats"
1515
FontSize="11" FontWeight="SemiBold"
1616
Foreground="{DynamicResource SlicerToggleBrush}"
17-
VerticalAlignment="Center"/>
18-
<Button x:Name="LegendButton" Content=""
19-
Width="22" Height="22" Padding="0"
20-
FontSize="12" Background="Transparent" BorderThickness="0"
17+
VerticalAlignment="Center" Margin="6,0,0,0"/>
18+
<!-- spacer -->
19+
<Button x:Name="LegendButton" Grid.Column="3" Content="Legend"
20+
Height="20" Padding="8,0"
21+
FontSize="10"
22+
Background="Transparent" BorderThickness="1"
23+
BorderBrush="{DynamicResource ForegroundMutedBrush}"
2124
Foreground="{DynamicResource ForegroundBrush}"
2225
ToolTip.Tip="Show color legend"
26+
VerticalAlignment="Center"
2327
Click="Legend_Click"/>
24-
</StackPanel>
28+
</Grid>
2529
<!-- Content area -->
2630
<Grid Grid.Row="1" x:Name="ContentArea" MinHeight="24">
2731
<local:WaitProfileBarControl x:Name="GlobalBar" PercentMode="True" IsVisible="False"/>

src/PlanViewer.App/Controls/WaitStatsRibbonControl.axaml.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,20 @@ private void Redraw()
215215
};
216216
RibbonCanvas.Children.Add(avgLine);
217217

218-
var avgLabel = new TextBlock
218+
var avgLabel = new Border
219219
{
220-
Text = $"avg:{WaitRatioFormatter.Format(avgWait)}",
221-
FontSize = 8,
222-
Foreground = dashBrush,
220+
Background = new SolidColorBrush(Color.Parse("#B0D0D0D0")),
221+
CornerRadius = new CornerRadius(3),
222+
Padding = new Thickness(4, 1),
223+
Child = new TextBlock
224+
{
225+
Text = $"avg:{WaitRatioFormatter.Format(avgWait)}",
226+
FontSize = 10,
227+
Foreground = Brushes.Black,
228+
},
223229
};
224230
Canvas.SetLeft(avgLabel, 2);
225-
Canvas.SetTop(avgLabel, avgY - 12);
231+
Canvas.SetTop(avgLabel, avgY - 16);
226232
RibbonCanvas.Children.Add(avgLabel);
227233
}
228234
}

0 commit comments

Comments
 (0)