SPARK-524: Change ladder badge

This commit is contained in:
Michael Harding committed 2018-02-26 16:00:22 -05:00
1 parent 7bf8e77999
commit bde83aa111
3 files changed
+8 -6

No files matched your search

+5 -2
View File
@@ -32,7 +32,7 @@ namespace mbts.ui.controls {
}
public Badge() {
FontSize = 8;
FontSize = 4;
}
public string Text {
@@ -107,13 +107,16 @@ namespace mbts.ui.controls {
double border_thickness = BorderThickness.Top;
var pen = new Pen(BorderBrush, border_thickness);
dc.DrawRoundedRectangle(Background, pen, new Rect(0, 0, ActualWidth, ActualHeight), CornerRadius, CornerRadius);
if (_center_text != null && _center_text.Width < ActualWidth) {
if (_center_text != null) {
_center_text.SetFontSize(FontSize);
dc.DrawText(_center_text, new Point((ActualWidth-_center_text.Width)/2, (ActualHeight-_center_text.Height)/2));
}
if (_top_text != null) {
_top_text.SetFontSize(FontSize);
dc.DrawText(_top_text, new Point(border_thickness, 0.0));
}
if (_bottom_text != null) {
_bottom_text.SetFontSize(FontSize);
dc.DrawText(_bottom_text, new Point(border_thickness, ActualHeight - _bottom_text.Height));
}
}
@@ -1,4 +1,4 @@
<UserControl x:Class="mbts.spark.LadderView"
<UserControl x:Class="mbts.spark.LadderView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mbts="clr-namespace:mbts.ui"
@@ -170,8 +170,7 @@
<Setter Property="Background" Value="{Binding background}" />
<Setter Property="BorderBrush" Value="{Binding border}" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="TopText" Value="{Binding line1}" />
<Setter Property="BottomText" Value="{Binding line2}" />
<Setter Property="Text" Value="{Binding text}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Width" Value="14" />
<Setter Property="Height" Value="8" />
@@ -77,8 +77,8 @@ namespace mbts.spark {
public double real_price => _real_price;
public Side side => _order.Def.Side;
public string text => "";
string _buy_sell_indicator => _order.Def.Side == Side.Buy ? "B" : "S";
public string text => $"{OrderUtils.filled(_order)}/{_order.working_quantity()}";
public string line1 => $"{_buy_sell_indicator}:{OrderUtils.filled(_order)}";
public string line2 => $"W:{_order.working_quantity()}";