Skip to content

Commit e31ef74

Browse files
committed
Chore: Adjust some colors & validations
1 parent ac78c64 commit e31ef74

File tree

5 files changed

+87
-68
lines changed

5 files changed

+87
-68
lines changed

Source/NETworkManager.Utilities.WPF/BindingProxy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ protected override Freezable CreateInstanceCore()
1717
{
1818
return new BindingProxy();
1919
}
20-
}
20+
}

Source/NETworkManager/MainWindow.xaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,25 @@
238238
</StackPanel>
239239
</Button>
240240
<Button Command="{Binding OpenWebsiteCommand}"
241-
ToolTip="{x:Static localization:Strings.ToolTip_SupportThisProjectWithADonation}"
242-
CommandParameter="{x:Static resources:Resources.NETworkManager_DonateUrl}"
243-
Cursor="Hand"
244-
Focusable="False">
241+
ToolTip="{x:Static localization:Strings.ToolTip_SupportThisProjectWithADonation}"
242+
CommandParameter="{x:Static resources:Resources.NETworkManager_DonateUrl}"
243+
Cursor="Hand"
244+
Focusable="False">
245245
<StackPanel Orientation="Horizontal">
246-
<Rectangle Width="20" Height="20"
247-
Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
246+
<Rectangle Width="20" Height="20">
248247
<Rectangle.OpacityMask>
249248
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Heart}" />
250249
</Rectangle.OpacityMask>
250+
<Rectangle.Style>
251+
<Style TargetType="Rectangle">
252+
<Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}" />
253+
<Style.Triggers>
254+
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=IsMouseOver}" Value="True">
255+
<Setter Property="Fill" Value="#b95353" />
256+
</DataTrigger>
257+
</Style.Triggers>
258+
</Style>
259+
</Rectangle.Style>
251260
</Rectangle>
252261
</StackPanel>
253262
</Button>

Source/NETworkManager/Resources/Styles/RectangleStyles.xaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<Style.Resources>
4141
<Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource DefaultToolTip}" />
4242
</Style.Resources>
43-
<Setter Property="Fill" Value="Orange" />
43+
<Setter Property="Fill" Value="#f1b856" />
4444
<Setter Property="OpacityMask">
4545
<Setter.Value>
4646
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=AlertOutline}" />
@@ -54,7 +54,7 @@
5454
<Style.Resources>
5555
<Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource DefaultToolTip}" />
5656
</Style.Resources>
57-
<Setter Property="Fill" Value="Red" />
57+
<Setter Property="Fill" Value="#b95353" />
5858
<Setter Property="OpacityMask">
5959
<Setter.Value>
6060
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=AlertOctagonOutline}" />
@@ -82,7 +82,7 @@
8282
<Style.Resources>
8383
<Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource DefaultToolTip}" />
8484
</Style.Resources>
85-
<Setter Property="Fill" Value="Orange" />
85+
<Setter Property="Fill" Value="#f1b856" />
8686
<Setter Property="OpacityMask">
8787
<Setter.Value>
8888
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=AlertOutline}" />
@@ -95,7 +95,7 @@
9595
<Style.Resources>
9696
<Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource DefaultToolTip}" />
9797
</Style.Resources>
98-
<Setter Property="Fill" Value="Red" />
98+
<Setter Property="Fill" Value="#b95353" />
9999
<Setter Property="OpacityMask">
100100
<Setter.Value>
101101
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Close}" />
@@ -155,7 +155,7 @@
155155
<Style.Resources>
156156
<Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource DefaultToolTip}" />
157157
</Style.Resources>
158-
<Setter Property="Fill" Value="Red" />
158+
<Setter Property="Fill" Value="#b95353" />
159159
<Setter Property="OpacityMask">
160160
<Setter.Value>
161161
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=LanDisconnect}" />
@@ -181,7 +181,7 @@
181181
<Style.Resources>
182182
<Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource DefaultToolTip}" />
183183
</Style.Resources>
184-
<Setter Property="Fill" Value="Red" />
184+
<Setter Property="Fill" Value="#b95353" />
185185
<Setter Property="OpacityMask">
186186
<Setter.Value>
187187
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Modern Kind=NetworkPortDisconnect}" />

Source/NETworkManager/Resources/Templates/ValidationErrorTemplates.xaml

Lines changed: 60 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,73 @@
55
<converters:BooleansOrConverter x:Key="BooleansOrConverter" />
66

77
<ControlTemplate x:Key="DefaultErrorTemplate">
8-
<StackPanel Orientation="Horizontal">
9-
<Grid>
10-
<Polygon x:Name="toolTipCorner" Grid.ZIndex="2" Margin="0" Points="8,8 8,0 0,0"
11-
Fill="{DynamicResource MahApps.Brushes.Accent}" HorizontalAlignment="Right"
8+
<!--
9+
<Grid>
10+
<Border BorderBrush="#b95353" BorderThickness="1">
11+
-->
12+
<Grid>
13+
<Polygon x:Name="ToolTipCorner" Grid.ZIndex="1" Margin="0" Points="12,12 12,0 0,0"
14+
Fill="#b95353" HorizontalAlignment="Right"
1215
VerticalAlignment="Top" IsHitTestVisible="True" />
13-
<AdornedElementPlaceholder x:Name="adorner" />
14-
<Popup PlacementTarget="{Binding ElementName=adorner}" PopupAnimation="Fade" HorizontalOffset="5">
15-
<Popup.Style>
16-
<Style TargetType="{x:Type Popup}">
17-
<Style.Triggers>
18-
<DataTrigger
19-
Binding="{Binding ElementName=adorner, Path=AdornedElement.IsKeyboardFocusWithin}"
16+
17+
<AdornedElementPlaceholder x:Name="Adorner" />
18+
<Popup PlacementTarget="{Binding ElementName=Adorner}" PopupAnimation="Fade" HorizontalOffset="5">
19+
<Popup.Style>
20+
<Style TargetType="{x:Type Popup}">
21+
<Style.Triggers>
22+
<DataTrigger
23+
Binding="{Binding ElementName=Adorner, Path=AdornedElement.IsKeyboardFocusWithin}"
2024
Value="True">
21-
<Setter Property="PlacementTarget" Value="{Binding ElementName=adorner}" />
22-
<Setter Property="Placement" Value="Right" />
23-
</DataTrigger>
24-
<DataTrigger Binding="{Binding ElementName=toolTipCorner, Path=IsMouseOver}"
25+
<Setter Property="PlacementTarget" Value="{Binding ElementName=Adorner}" />
26+
<Setter Property="Placement" Value="Right" />
27+
</DataTrigger>
28+
<DataTrigger Binding="{Binding ElementName=ToolTipCorner, Path=IsMouseOver}"
2529
Value="True">
26-
<Setter Property="PlacementTarget" Value="{Binding ElementName=toolTipCorner}" />
27-
<Setter Property="Placement" Value="Mouse" />
28-
</DataTrigger>
29-
<DataTrigger Value="True">
30-
<DataTrigger.Binding>
31-
<MultiBinding Converter="{StaticResource BooleansOrConverter}">
32-
<Binding ElementName="adorner" Path="AdornedElement.IsKeyboardFocusWithin" />
33-
<Binding ElementName="toolTipCorner" Path="IsMouseOver" />
34-
</MultiBinding>
35-
</DataTrigger.Binding>
36-
<Setter Property="IsOpen" Value="True" />
37-
</DataTrigger>
38-
</Style.Triggers>
39-
</Style>
40-
</Popup.Style>
41-
<StackPanel>
42-
<Border MaxWidth="300" Background="{DynamicResource MahApps.Brushes.Window.Background}"
30+
<Setter Property="PlacementTarget" Value="{Binding ElementName=ToolTipCorner}" />
31+
<Setter Property="Placement" Value="Mouse" />
32+
</DataTrigger>
33+
<DataTrigger Value="True">
34+
<DataTrigger.Binding>
35+
<MultiBinding Converter="{StaticResource BooleansOrConverter}">
36+
<Binding ElementName="Adorner" Path="AdornedElement.IsKeyboardFocusWithin" />
37+
<Binding ElementName="ToolTipCorner" Path="IsMouseOver" />
38+
</MultiBinding>
39+
</DataTrigger.Binding>
40+
<Setter Property="IsOpen" Value="True" />
41+
</DataTrigger>
42+
</Style.Triggers>
43+
</Style>
44+
</Popup.Style>
45+
<StackPanel>
46+
<Border MaxWidth="300" Background="{DynamicResource MahApps.Brushes.Window.Background}"
4347
BorderBrush="{DynamicResource MahApps.Brushes.Gray8}" BorderThickness="1" Padding="5">
44-
<Grid>
45-
<Grid.ColumnDefinitions>
46-
<ColumnDefinition Width="Auto" />
47-
<ColumnDefinition Width="*" />
48-
</Grid.ColumnDefinitions>
49-
<Rectangle Grid.Column="0" Width="20" Height="20"
48+
<Grid>
49+
<Grid.ColumnDefinitions>
50+
<ColumnDefinition Width="Auto" />
51+
<ColumnDefinition Width="*" />
52+
</Grid.ColumnDefinitions>
53+
<Rectangle Grid.Column="0" Width="20" Height="20"
5054
Fill="{DynamicResource MahApps.Brushes.Gray3}">
51-
<Rectangle.OpacityMask>
52-
<VisualBrush Stretch="Uniform"
55+
<Rectangle.OpacityMask>
56+
<VisualBrush Stretch="Uniform"
5357
Visual="{iconPacks:Material Kind=InformationVariant}" />
54-
</Rectangle.OpacityMask>
55-
</Rectangle>
56-
<TextBlock Grid.Column="1" Text="{Binding Path=/ErrorContent}"
58+
</Rectangle.OpacityMask>
59+
</Rectangle>
60+
<TextBlock Grid.Column="1" Text="{Binding Path=/ErrorContent}"
5761
Foreground="{DynamicResource MahApps.Brushes.Text}" FontSize="14"
5862
TextWrapping="Wrap" VerticalAlignment="Center" Margin="10,0,0,0" />
59-
</Grid>
60-
</Border>
61-
</StackPanel>
62-
</Popup>
63-
</Grid>
64-
</StackPanel>
63+
</Grid>
64+
</Border>
65+
</StackPanel>
66+
</Popup>
67+
</Grid>
68+
<!--
69+
</Border>
70+
</Grid>
71+
-->
72+
</ControlTemplate>
73+
74+
<ControlTemplate x:Key="ErrorTemplateOffset">
75+
6576
</ControlTemplate>
6677
</ResourceDictionary>

Source/NETworkManager/Views/ProfileChildWindow.xaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
ShowTitleBar="True"
2323
TitleBarBackground="Transparent"
2424
TitleBarNonActiveBackground="Transparent"
25-
TitleFontSize="18"
26-
Loaded="UserControl_Loaded"
27-
TitleForeground="{DynamicResource MahApps.Brushes.Gray3}"
28-
CloseByEscape="False"
29-
Padding="20"
30-
OverlayBrush="{DynamicResource ResourceKey=MahApps.Brushes.Gray.SemiTransparent}"
25+
ShowCloseButton="True"
26+
Loaded="UserControl_Loaded"
27+
TitleForeground="{DynamicResource MahApps.Brushes.Gray3}"
28+
CloseByEscape="False"
29+
OverlayBrush="{DynamicResource ResourceKey=MahApps.Brushes.Gray.SemiTransparent}"
3130
mc:Ignorable="d" d:DataContext="{d:DesignInstance viewModels:ProfileViewModel}">
3231
<simpleChildWindow:ChildWindow.Resources>
3332
<converters:BooleanReverseConverter x:Key="BooleanReverseConverter" />

0 commit comments

Comments
 (0)