Skip to content

Commit

Permalink
hot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanSoloweow committed May 30, 2020
1 parent 03c5955 commit a1c7b2f
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 5 deletions.
1 change: 1 addition & 0 deletions SimpleStateMachineNodeEditor/Icons/Icons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<ResourceDictionary Source="Exit.xaml"/>
<ResourceDictionary Source="SelectAll.xaml"/>
<ResourceDictionary Source="Loop.xaml"/>
<ResourceDictionary Source="SelectedLoop.xaml"/>
<ResourceDictionary Source="Close.xaml"/>
<ResourceDictionary Source="Copy.xaml"/>
<ResourceDictionary Source="ExpandDownAll.xaml"/>
Expand Down
18 changes: 18 additions & 0 deletions SimpleStateMachineNodeEditor/Icons/SelectedLoop.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SimpleStateMachineNodeEditor.Icons"
xmlns:theme="clr-namespace:SimpleStateMachineNodeEditor.Styles.Themes">
<DrawingBrush x:Key="IconSelectedLoop" TileMode="Tile">
<DrawingBrush.Drawing>
<GeometryDrawing Brush="{DynamicResource ColorSelectedElement}" >
<GeometryDrawing.Geometry >
<PathGeometry Figures="M515.216,32.2104 C 471.039,64.9407 316.749,210.919 285,241.156 354.528,309.155 476.402,421.505 519.933,456.569 529.209,459.558 539.111,457.671 546.19,451.542 555.782,443.051 556.092,441.322 556.092,390.691 L 556.092,345.094 623.066,352.167 C 685.164,363.02 743.338,384.245 783.587,410.973 803.716,424.34 824.621,444.779 836.101,462.072 880.591,529.527 843.806,607.354 743.497,657.827 729.504,664.899 727.459,667.262 727.459,676.538 727.459,685.029 733.429,691 741.919,691 753.399,691 811.097,665.843 844.894,646.188 927.43,597.919 979,534.238 990.947,466.004 994.562,444.938 993.302,412.543 987.959,392.261 955.415,268.204 795.052,169.621 581.556,142.267 L 556.877,139.119 C 556.409,139.119 556.092,119.148 556.092,94.7828 556.092,52.9599 555.933,50.1294 552.794,43.6835 546.348,30.4748 528.265,24.9723 515.216,32.2104 Z" FillRule="Nonzero" >
<PathGeometry.Transform>
<ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
</PathGeometry.Transform>
</PathGeometry>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,10 @@
</None>
</ItemGroup>

<ItemGroup>
<Page Update="Icons\SelectedLoop.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion SimpleStateMachineNodeEditor/Styles/Themes/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<SolidColorBrush x:Key="ColorConnectorForeground" Color="White"/>

<SolidColorBrush x:Key="ColorCutter" Color="Red"/>
<SolidColorBrush x:Key="ColorCutter" Color="#D23030"/>


<SolidColorBrush x:Key="ColorButtonStroke" Color="LightGray"/>
Expand Down
2 changes: 1 addition & 1 deletion SimpleStateMachineNodeEditor/Styles/Themes/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<SolidColorBrush x:Key="ColorConnectorForeground" Color="Black"/>

<SolidColorBrush x:Key="ColorCutter" Color="Red"/>
<SolidColorBrush x:Key="ColorCutter" Color="#D23030"/>


<SolidColorBrush x:Key="ColorButtonStroke" Color="#626264"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ViewModelConnect : ReactiveObject

[Reactive] public ViewModelNodesCanvas NodesCanvas { get; set; }

[Reactive] public DoubleCollection StrokeDashArray { get; set; }
[Reactive] public DoubleCollection StrokeDashArray { get; set; } = new DoubleCollection() { 10, 3 };

[Reactive] public double StrokeThickness { get; set; } = 1;

Expand All @@ -48,6 +48,7 @@ private void SetupSubscriptions()
this.WhenAnyValue(x => x.ToConnector.PositionConnectPoint).Subscribe(value => EndPointUpdate(value));
this.WhenAnyValue(x => x.FromConnector.Selected).Subscribe(value => Select(value));
this.WhenAnyValue(x => x.NodesCanvas.Theme).Subscribe(_ => Select(this.FromConnector.Selected));
this.WhenAnyValue(x => x.ToConnector).Where(x => x != null).Subscribe(_ => StrokeDashArray = null);
}
private void UpdateSubscriptionForPosition(bool nodeIsCollapse)
{
Expand All @@ -72,7 +73,6 @@ private void Initial(ViewModelNodesCanvas viewModelNodesCanvas, ViewModelConnect
}
private void Select(bool value)
{
//this.StrokeDashArray = value ? new DoubleCollection() { 10, 3 } : null;
this.Stroke = Application.Current.Resources[value ? "ColorSelectedElement": "ColorConnect"] as SolidColorBrush;
}
private void StartPointUpdate(Point point)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ private void Select(bool value)
{
this.FormStroke = Application.Current.Resources["ColorNodesCanvasBackground"] as SolidColorBrush;
this.Foreground = Application.Current.Resources[this.Selected ? "ColorSelectedElement" : "ColorConnectorForeground"] as SolidColorBrush;
this.FormFill = Application.Current.Resources[this.Selected ? "ColorSelectedElement" : "ColorConnector"] as SolidColorBrush;
if (!this.ItsLoop)
this.FormFill = Application.Current.Resources[this.Selected ? "ColorSelectedElement" : "ColorConnector"] as SolidColorBrush;
else
this.FormFill = Application.Current.Resources[this.Selected ? "IconSelectedLoop" : "IconLoop"] as DrawingBrush;

}
private void Select(SelectMode selectMode)
{
Expand Down

0 comments on commit a1c7b2f

Please sign in to comment.