[#20][#80] MemberAdminWindow: Update business share status bar tool tip
Test / Run tests (push) Successful in 2m1s
Test / Run tests (push) Successful in 2m1s
This commit is contained in:
@@ -940,36 +940,24 @@ namespace Elwig.Services {
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddToolTipCell(Grid grid, string text, int row, int col, int colSpan = 1, bool bold = false, bool alignRight = false, bool alignCenter = false) {
|
||||
var tb = new TextBlock() {
|
||||
Text = text,
|
||||
TextAlignment = alignRight ? TextAlignment.Right : alignCenter ? TextAlignment.Center : TextAlignment.Left,
|
||||
Margin = new(0, 12 * row, 0, 0),
|
||||
FontWeight = bold ? FontWeights.Bold : FontWeights.Normal,
|
||||
};
|
||||
tb.SetValue(Grid.ColumnProperty, col);
|
||||
tb.SetValue(Grid.ColumnSpanProperty, colSpan);
|
||||
grid.Children.Add(tb);
|
||||
}
|
||||
|
||||
private static void AddWeightToolTipRow(Grid grid, int row, string? h1, string? h2, int weight, int? total1, int total2) {
|
||||
var bold = h2 == null;
|
||||
if (h1 != null) AddToolTipCell(grid, h1 + ":", row, 0, (h2 == null) ? 2 : 1, bold);
|
||||
if (h2 != null) AddToolTipCell(grid, h2 + ":", row, 1, 1, bold);
|
||||
AddToolTipCell(grid, $"{weight:N0} kg", row, 2, 1, bold, true);
|
||||
if (h1 != null) grid.AddToolTipCell(h1 + ":", row, 0, (h2 == null) ? 2 : 1, bold);
|
||||
if (h2 != null) grid.AddToolTipCell(h2 + ":", row, 1, 1, bold);
|
||||
grid.AddToolTipCell($"{weight:N0} kg", row, 2, bold: bold, alignRight: true);
|
||||
if (total1 != null && total1 != 0)
|
||||
AddToolTipCell(grid, $"{weight * 100.0 / total1:N1} %", row, 3, 1, bold, true);
|
||||
grid.AddToolTipCell($"{weight * 100.0 / total1:N1} %", row, 3, bold: bold, alignRight: true);
|
||||
if (total2 != 0)
|
||||
AddToolTipCell(grid, $"{weight * 100.0 / total2:N1} %", row, 4, 1, bold, true);
|
||||
grid.AddToolTipCell($"{weight * 100.0 / total2:N1} %", row, 4, bold: bold, alignRight: true);
|
||||
}
|
||||
|
||||
private static void AddGradationToolTipRow(Grid grid, int row, string? h1, string? h2, double min, double avg, double max) {
|
||||
var bold = h2 == null;
|
||||
if (h1 != null) AddToolTipCell(grid, h1 + ":", row, 0, (h2 == null) ? 2 : 1, bold);
|
||||
if (h2 != null) AddToolTipCell(grid, h2 + ":", row, 1, 1, bold);
|
||||
AddToolTipCell(grid, $"{min:N1}°", row, 2, 1, bold, true);
|
||||
AddToolTipCell(grid, $"{avg:N1}°", row, 3, 1, bold, true);
|
||||
AddToolTipCell(grid, $"{max:N1}°", row, 4, 1, bold, true);
|
||||
if (h1 != null) grid.AddToolTipCell(h1 + ":", row, 0, (h2 == null) ? 2 : 1, bold);
|
||||
if (h2 != null) grid.AddToolTipCell(h2 + ":", row, 1, bold: bold);
|
||||
grid.AddToolTipCell($"{min:N1}°", row, 2, bold: bold, alignRight: true);
|
||||
grid.AddToolTipCell($"{avg:N1}°", row, 3, bold: bold, alignRight: true);
|
||||
grid.AddToolTipCell($"{max:N1}°", row, 4, bold: bold, alignRight: true);
|
||||
}
|
||||
|
||||
public static async Task<(string WeightText, (string?, string?, int, int?, int)[] WeightGrid, string GradationText, (string?, string?, double, double, double)[] GradationGrid)> GenerateToolTipData(IQueryable<DeliveryPart> deliveryParts) {
|
||||
@@ -1098,9 +1086,9 @@ namespace Elwig.Services {
|
||||
gGrid.ColumnDefinitions.Add(new() { Width = new(35) });
|
||||
gGrid.ColumnDefinitions.Add(new() { Width = new(35) });
|
||||
gGrid.ColumnDefinitions.Add(new() { Width = new(35) });
|
||||
AddToolTipCell(gGrid, "Min.", 0, 2, 1, false, false, true);
|
||||
AddToolTipCell(gGrid, "⌀", 0, 3, 1, false, false, true);
|
||||
AddToolTipCell(gGrid, "Max.", 0, 4, 1, false, false, true);
|
||||
gGrid.AddToolTipCell("Min.", 0, 2, alignCenter: true);
|
||||
gGrid.AddToolTipCell("⌀", 0, 3, alignCenter: true);
|
||||
gGrid.AddToolTipCell("Max.", 0, 4, alignCenter: true);
|
||||
rowNum = 1;
|
||||
foreach (var row in gradationData) {
|
||||
if (rowNum != 1 && row.Item2 == null) rowNum++;
|
||||
|
||||
Reference in New Issue
Block a user