Display filling level
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
@@ -39,8 +38,11 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
|
||||
Stroke = Brushes.Black,
|
||||
StrokeThickness = 2,
|
||||
};
|
||||
var hx = CenterX + WIDTH / 2 - 10;
|
||||
var left = CenterX - WIDTH / 2;
|
||||
var right = CenterX + WIDTH / 2;
|
||||
var top = CenterY - HEIGHT / 2;
|
||||
var bottom = CenterY + HEIGHT / 2;
|
||||
var hx = right - 10;
|
||||
var h = 15;
|
||||
var w = 25;
|
||||
_hopperOuter = new Polygon() {
|
||||
@@ -51,6 +53,14 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
|
||||
Points = [new(hx - w + 2, top - h), new(hx, top + 26), new(hx + w - 2, top - h)],
|
||||
Fill = Brushes.WhiteSmoke,
|
||||
};
|
||||
_bottomOuter = new Polygon() {
|
||||
Points = [new(left + 20, bottom), new(right - 20, bottom), new(right - 15, bottom + 10), new(left + 15, bottom + 10)],
|
||||
Fill = Brushes.Black,
|
||||
};
|
||||
_bottomInner = new Polygon() {
|
||||
Points = [new(left + 20 + 2, bottom), new(right - 20 - 2, bottom), new(right - 15 - 2, bottom + 10), new(left + 15 + 2, bottom + 10)],
|
||||
Fill = Brushes.WhiteSmoke,
|
||||
};
|
||||
_text = new() {
|
||||
Text = Label,
|
||||
FontSize = 12,
|
||||
@@ -63,8 +73,10 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
|
||||
_text.SetValue(Canvas.LeftProperty, CenterX - WIDTH / 2);
|
||||
_text.SetValue(Canvas.TopProperty, CenterY - 8);
|
||||
canvas.Children.Add(_hopperOuter);
|
||||
canvas.Children.Add(_bottomOuter);
|
||||
canvas.Children.Add(_rect);
|
||||
canvas.Children.Add(_hopperInner);
|
||||
canvas.Children.Add(_bottomInner);
|
||||
canvas.Children.Add(_text);
|
||||
}
|
||||
|
||||
@@ -73,9 +85,18 @@ namespace PamhagenSysCtrl.Helpers.Pipeline {
|
||||
}
|
||||
|
||||
public void Update(bool isHovering, bool isPressed) {
|
||||
_rect?.Fill = isHovering ? Brushes.LightGray : Brushes.WhiteSmoke;
|
||||
_hopperInner?.Fill = isHovering ? Brushes.LightGray : Brushes.WhiteSmoke;
|
||||
_bottomInner?.Fill = isHovering ? Brushes.LightGray : Brushes.WhiteSmoke;
|
||||
_rect?.Fill =
|
||||
isHovering && isPressed ? Brushes.DarkGray :
|
||||
isHovering ? Brushes.LightGray :
|
||||
Brushes.WhiteSmoke;
|
||||
_hopperInner?.Fill =
|
||||
isHovering && isPressed ? Brushes.DarkGray :
|
||||
isHovering ? Brushes.LightGray :
|
||||
Brushes.WhiteSmoke;
|
||||
_bottomInner?.Fill =
|
||||
isHovering && isPressed ? Brushes.DarkGray :
|
||||
isHovering ? Brushes.LightGray :
|
||||
Brushes.WhiteSmoke;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user