Skip to content

Commit 449842f

Browse files
committed
Add chevron to close next to the textbox
1 parent f1455e6 commit 449842f

14 files changed

+603
-217
lines changed

Source/NETworkManager/Resources/Styles/ExpanderStyles.xaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,37 +64,33 @@
6464
</Style>
6565

6666
<Style x:Key="ProfileExpanderOpen" BasedOn="{StaticResource MahApps.Styles.ToggleButton.ExpanderHeader.Down}" TargetType="{x:Type ToggleButton}">
67-
<Setter Property="Template">
67+
<Setter Property="Template" Value="{x:Null}">
68+
<!--
6869
<Setter.Value>
6970
<ControlTemplate TargetType="{x:Type ToggleButton}">
71+
7072
<Border Padding="{TemplateBinding Padding}"
7173
Background="{TemplateBinding Background}"
7274
BorderBrush="{StaticResource MahApps.Brushes.Gray8}"
7375
BorderThickness="0,0,0,1">
7476
<Grid Background="Transparent" SnapsToDevicePixels="False" Height="27">
75-
<!--
76-
<Grid.ColumnDefinitions>
77-
<ColumnDefinition Width="*" />
78-
<ColumnDefinition Width="Auto" />
79-
</Grid.ColumnDefinitions>
80-
-->
81-
<!--<TextBlock Grid.Column="0" Text="{TemplateBinding Content}" Style="{StaticResource HeaderTextBlock}" FontSize="18" Margin="10,0" />-->
82-
<!--<Rectangle Grid.Column="1" x:Name="Chevron" Width="16" Height="16" Fill="{DynamicResource MahApps.Brushes.Gray3}" Margin="0,0,10,0" VerticalAlignment="Center" HorizontalAlignment="Center">-->
8377
<Rectangle Grid.Column="0" x:Name="Chevron" Width="16" Height="16" Fill="{DynamicResource MahApps.Brushes.Gray3}" Margin="0,0,10,0" VerticalAlignment="Center" HorizontalAlignment="Center">
8478
<Rectangle.OpacityMask>
8579
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Entypo Kind=ChevronThinLeft}" />
8680
</Rectangle.OpacityMask>
8781
</Rectangle>
8882
</Grid>
8983
</Border>
84+
9085
<ControlTemplate.Triggers>
9186
<Trigger Property="IsMouseOver" Value="True">
9287
<Setter TargetName="Chevron" Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}"/>
9388
</Trigger>
9489
</ControlTemplate.Triggers>
9590
</ControlTemplate>
9691
</Setter.Value>
97-
</Setter>
92+
-->
93+
</Setter>
9894
</Style>
9995

10096
<Style x:Key="ProfileExpanderClosed" BasedOn="{StaticResource MahApps.Styles.ToggleButton.ExpanderHeader.Right}" TargetType="{x:Type ToggleButton}">

Source/NETworkManager/Views/DNSLookupHostView.xaml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,46 @@
112112
</Grid.RowDefinitions>
113113
<Grid Grid.Column="0" Grid.Row="0">
114114
<Grid.ColumnDefinitions>
115+
<ColumnDefinition Width="Auto" />
116+
<ColumnDefinition Width="10" />
115117
<ColumnDefinition Width="*" />
116118
<ColumnDefinition Width="10" />
117119
<ColumnDefinition Width="Auto" />
118120
</Grid.ColumnDefinitions>
119-
<TextBox x:Name="TextBoxSearch" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SearchTextBox}">
121+
<ToggleButton Grid.Column="0" Grid.Row="0" IsChecked="{Binding ExpandProfileView}">
122+
<ToggleButton.Style>
123+
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
124+
<Setter Property="Template">
125+
<Setter.Value>
126+
<ControlTemplate TargetType="{x:Type ToggleButton}">
127+
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
128+
</ControlTemplate>
129+
</Setter.Value>
130+
</Setter>
131+
</Style>
132+
</ToggleButton.Style>
133+
<Rectangle Width="16" Height="16">
134+
<Rectangle.OpacityMask>
135+
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Entypo Kind=ChevronThinLeft}" />
136+
</Rectangle.OpacityMask>
137+
<Rectangle.Style>
138+
<Style TargetType="{x:Type Rectangle}">
139+
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" />
140+
<Style.Triggers>
141+
<Trigger Property="IsMouseOver" Value="True">
142+
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}" />
143+
</Trigger>
144+
</Style.Triggers>
145+
</Style>
146+
</Rectangle.Style>
147+
</Rectangle>
148+
</ToggleButton>
149+
<TextBox x:Name="TextBoxSearch" Grid.Column="2" Grid.Row="0" VerticalAlignment="Center" Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SearchTextBox}">
120150
<TextBox.InputBindings>
121151
<KeyBinding Command="{Binding LookupProfileCommand}" Key="Enter" />
122152
</TextBox.InputBindings>
123153
</TextBox>
124-
<Button Grid.Column="2" Grid.Row="0" Style="{StaticResource CleanButton}" Command="{Binding AddProfileCommand}" ToolTip="{x:Static localization:Strings.AddProfileDots}">
154+
<Button Grid.Column="4" Grid.Row="0" Style="{StaticResource CleanButton}" Command="{Binding AddProfileCommand}" ToolTip="{x:Static localization:Strings.AddProfileDots}">
125155
<Rectangle Width="16" Height="16">
126156
<Rectangle.OpacityMask>
127157
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Plus}" />

Source/NETworkManager/Views/IPScannerHostView.xaml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,46 @@
112112
</Grid.RowDefinitions>
113113
<Grid Grid.Column="0" Grid.Row="0">
114114
<Grid.ColumnDefinitions>
115+
<ColumnDefinition Width="Auto" />
116+
<ColumnDefinition Width="10" />
115117
<ColumnDefinition Width="*" />
116118
<ColumnDefinition Width="10" />
117119
<ColumnDefinition Width="Auto" />
118120
</Grid.ColumnDefinitions>
119-
<TextBox x:Name="TextBoxSearch" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SearchTextBox}">
121+
<ToggleButton Grid.Column="0" Grid.Row="0" IsChecked="{Binding ExpandProfileView}">
122+
<ToggleButton.Style>
123+
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
124+
<Setter Property="Template">
125+
<Setter.Value>
126+
<ControlTemplate TargetType="{x:Type ToggleButton}">
127+
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
128+
</ControlTemplate>
129+
</Setter.Value>
130+
</Setter>
131+
</Style>
132+
</ToggleButton.Style>
133+
<Rectangle Width="16" Height="16">
134+
<Rectangle.OpacityMask>
135+
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Entypo Kind=ChevronThinLeft}" />
136+
</Rectangle.OpacityMask>
137+
<Rectangle.Style>
138+
<Style TargetType="{x:Type Rectangle}">
139+
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" />
140+
<Style.Triggers>
141+
<Trigger Property="IsMouseOver" Value="True">
142+
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}" />
143+
</Trigger>
144+
</Style.Triggers>
145+
</Style>
146+
</Rectangle.Style>
147+
</Rectangle>
148+
</ToggleButton>
149+
<TextBox x:Name="TextBoxSearch" Grid.Column="2" Grid.Row="0" VerticalAlignment="Center" Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SearchTextBox}">
120150
<TextBox.InputBindings>
121151
<KeyBinding Command="{Binding ScanProfileCommand}" Key="Enter" />
122152
</TextBox.InputBindings>
123153
</TextBox>
124-
<Button Grid.Column="2" Grid.Row="0" Style="{StaticResource CleanButton}" Command="{Binding AddProfileCommand}" ToolTip="{x:Static localization:Strings.AddProfileDots}">
154+
<Button Grid.Column="4" Grid.Row="0" Style="{StaticResource CleanButton}" Command="{Binding AddProfileCommand}" ToolTip="{x:Static localization:Strings.AddProfileDots}">
125155
<Rectangle Width="16" Height="16">
126156
<Rectangle.OpacityMask>
127157
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Plus}" />

Source/NETworkManager/Views/NetworkInterfaceView.xaml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,12 +890,42 @@
890890
</Grid.RowDefinitions>
891891
<Grid Grid.Row="0">
892892
<Grid.ColumnDefinitions>
893+
<ColumnDefinition Width="Auto" />
894+
<ColumnDefinition Width="10" />
893895
<ColumnDefinition Width="*" />
894896
<ColumnDefinition Width="10" />
895897
<ColumnDefinition Width="Auto" />
896898
</Grid.ColumnDefinitions>
897-
<TextBox x:Name="TextBoxSearch" VerticalAlignment="Center" Grid.Column="0" Grid.Row="0" Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SearchTextBox}"/>
898-
<Button Grid.Column="2" Grid.Row="0" Style="{StaticResource CleanButton}" Command="{Binding AddProfileCommand}" ToolTip="{x:Static localization:Strings.AddProfileDots}">
899+
<ToggleButton Grid.Column="0" Grid.Row="0" IsChecked="{Binding ExpandProfileView}">
900+
<ToggleButton.Style>
901+
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
902+
<Setter Property="Template">
903+
<Setter.Value>
904+
<ControlTemplate TargetType="{x:Type ToggleButton}">
905+
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
906+
</ControlTemplate>
907+
</Setter.Value>
908+
</Setter>
909+
</Style>
910+
</ToggleButton.Style>
911+
<Rectangle Width="16" Height="16">
912+
<Rectangle.OpacityMask>
913+
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Entypo Kind=ChevronThinLeft}" />
914+
</Rectangle.OpacityMask>
915+
<Rectangle.Style>
916+
<Style TargetType="{x:Type Rectangle}">
917+
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" />
918+
<Style.Triggers>
919+
<Trigger Property="IsMouseOver" Value="True">
920+
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}" />
921+
</Trigger>
922+
</Style.Triggers>
923+
</Style>
924+
</Rectangle.Style>
925+
</Rectangle>
926+
</ToggleButton>
927+
<TextBox x:Name="TextBoxSearch" VerticalAlignment="Center" Grid.Column="2" Grid.Row="0" Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SearchTextBox}"/>
928+
<Button Grid.Column="4" Grid.Row="0" Style="{StaticResource CleanButton}" Command="{Binding AddProfileCommand}" ToolTip="{x:Static localization:Strings.AddProfileDots}">
899929
<Rectangle Width="16" Height="16">
900930
<Rectangle.OpacityMask>
901931
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Plus}" />

Source/NETworkManager/Views/PingMonitorHostView.xaml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,46 @@
159159
</Grid.RowDefinitions>
160160
<Grid Grid.Column="0" Grid.Row="0">
161161
<Grid.ColumnDefinitions>
162+
<ColumnDefinition Width="Auto" />
163+
<ColumnDefinition Width="10" />
162164
<ColumnDefinition Width="*" />
163165
<ColumnDefinition Width="10" />
164166
<ColumnDefinition Width="Auto" />
165167
</Grid.ColumnDefinitions>
166-
<TextBox x:Name="TextBoxSearch" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SearchTextBox}">
168+
<ToggleButton Grid.Column="0" Grid.Row="0" IsChecked="{Binding ExpandProfileView}">
169+
<ToggleButton.Style>
170+
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
171+
<Setter Property="Template">
172+
<Setter.Value>
173+
<ControlTemplate TargetType="{x:Type ToggleButton}">
174+
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
175+
</ControlTemplate>
176+
</Setter.Value>
177+
</Setter>
178+
</Style>
179+
</ToggleButton.Style>
180+
<Rectangle Width="16" Height="16">
181+
<Rectangle.OpacityMask>
182+
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Entypo Kind=ChevronThinLeft}" />
183+
</Rectangle.OpacityMask>
184+
<Rectangle.Style>
185+
<Style TargetType="{x:Type Rectangle}">
186+
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray3}" />
187+
<Style.Triggers>
188+
<Trigger Property="IsMouseOver" Value="True">
189+
<Setter Property="Fill" Value="{DynamicResource MahApps.Brushes.Gray5}" />
190+
</Trigger>
191+
</Style.Triggers>
192+
</Style>
193+
</Rectangle.Style>
194+
</Rectangle>
195+
</ToggleButton>
196+
<TextBox x:Name="TextBoxSearch" Grid.Column="2" Grid.Row="0" VerticalAlignment="Center" Text="{Binding Search, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource SearchTextBox}">
167197
<TextBox.InputBindings>
168198
<KeyBinding Command="{Binding AddHostProfileCommand}" Key="Enter" />
169199
</TextBox.InputBindings>
170200
</TextBox>
171-
<Button Grid.Column="2" Grid.Row="0" Style="{StaticResource CleanButton}" Command="{Binding AddProfileCommand}" ToolTip="{x:Static localization:Strings.AddProfileDots}">
201+
<Button Grid.Column="4" Grid.Row="0" Style="{StaticResource CleanButton}" Command="{Binding AddProfileCommand}" ToolTip="{x:Static localization:Strings.AddProfileDots}">
172202
<Rectangle Width="16" Height="16">
173203
<Rectangle.OpacityMask>
174204
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=Plus}" />

0 commit comments

Comments
 (0)