Skip to content

Commit 21ab9c2

Browse files
committed
Interface improved
1 parent 4e24b3d commit 21ab9c2

16 files changed

Lines changed: 88 additions & 94 deletions

Source/NETworkManager/MainWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,9 @@
595595
<ColumnDefinition Width="Auto" />
596596
<ColumnDefinition Width="*" />
597597
</Grid.ColumnDefinitions>
598-
<Rectangle Grid.Column="0" Width="24" Height="24">
598+
<Rectangle Grid.Column="0" Width="20" Height="20">
599599
<Rectangle.OpacityMask>
600-
<VisualBrush Stretch="Uniform" Visual="{IconPacks:MaterialLight Kind=ArrowLeftCircle}" />
600+
<VisualBrush Stretch="Uniform" Visual="{IconPacks:MaterialLight Kind=ArrowLeft}" />
601601
</Rectangle.OpacityMask>
602602
<Rectangle.Style>
603603
<Style TargetType="{x:Type Rectangle}">

Source/NETworkManager/Models/Network/DNSLookup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void LookupAsync(List<string> hosts, DNSLookupOptions dnsLookupOptions)
5454
foreach (string host in hosts)
5555
{
5656
// Default
57-
string name = host.Trim();
57+
string name = host;
5858

5959
string dnsSuffix = string.Empty;
6060

Source/NETworkManager/Resources/Localization/Resources.de-DE.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@
246246
<system:String x:Key="String_TheFollwingParametersCanNotBeProcesses">Die folgenden Parameter können nicht verarbeitet werden:</system:String>
247247
<system:String x:Key="String_TheFollowingParametersAreAvailable">Folgende Parameter stehen zur Verfügung:</system:String>
248248
<system:String x:Key="String_Open">Offen</system:String>
249-
<system:String x:Key="String_CustomDNSServerIsEmptyCheckYourSettingsUseWindowsOwnDNSServer">Benutzerdefinierte DNS-Server ist leer. Überprüfe deine Einstellungen! (Verwende Windows eigenen DNS-Server...)</system:String>
250249
<system:String x:Key="String_EnterNameForProfile">Geben Sie einen Namen ein, unter dem das Profil gespeichert werden soll.</system:String>
251250
<system:String x:Key="String_DeleteProfileMessage">Das ausgewählte Profil wird unwiderruflich gelöscht.</system:String>
252251
<system:String x:Key="String_DeleteSessionMessage">Die ausgewählte Sitzung wird unwiderruflich gelöscht.</system:String>

Source/NETworkManager/Resources/Localization/Resources.en-US.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@
246246
<system:String x:Key="String_TheFollwingParametersCanNotBeProcesses">The following parameters can not be processed:</system:String>
247247
<system:String x:Key="String_TheFollowingParametersAreAvailable">The following parameters are available:</system:String>
248248
<system:String x:Key="String_Open">Open</system:String>
249-
<system:String x:Key="String_CustomDNSServerIsEmptyCheckYourSettingsUseWindowsOwnDNSServer">Custom DNS server is empty. Check your settings! (Use windows own DNS server...)</system:String>
250249
<system:String x:Key="String_EnterNameForProfile">Enter a name under which you want to save the profile.</system:String>
251250
<system:String x:Key="String_DeleteProfileMessage">The selected profile will be deleted permanently.</system:String>
252251
<system:String x:Key="String_DeleteSessionMessage">The selected session will be deleted permanently.</system:String>

Source/NETworkManager/Resources/Styles/ExpanderStyles.xaml

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
BorderThickness="{TemplateBinding BorderThickness}">
1313
<Grid Background="Transparent" SnapsToDevicePixels="False">
1414
<Grid.ColumnDefinitions>
15-
<ColumnDefinition Width="*" />
1615
<ColumnDefinition Width="Auto" />
16+
<ColumnDefinition Width="*" />
1717
</Grid.ColumnDefinitions>
18-
<Rectangle Grid.Column="1" x:Name="Chevron" Width="16" Height="16" Fill="{DynamicResource GrayBrush3}" VerticalAlignment="Center">
18+
<Rectangle Grid.Column="0" x:Name="Chevron" Width="20" Height="20" Fill="{DynamicResource GrayBrush3}" VerticalAlignment="Center">
1919
<Rectangle.OpacityMask>
2020
<VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ChevronDown}" />
2121
</Rectangle.OpacityMask>
2222
</Rectangle>
23-
<Controls:ContentControlEx Grid.Column="0"
24-
Margin="0"
23+
<Controls:ContentControlEx Grid.Column="1"
24+
Margin="10,0,0,0"
2525
HorizontalAlignment="Stretch"
2626
Padding="{TemplateBinding Padding}"
2727
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
@@ -55,12 +55,73 @@
5555

5656
<Style x:Key="DefaultExpander" TargetType="{x:Type Expander}" BasedOn="{StaticResource MetroExpander}">
5757
<Setter Property="BorderThickness" Value="0" />
58+
<Setter Property="Padding" Value="0" />
5859
<Setter Property="Background" Value="Transparent" />
5960
<Setter Property="Controls:GroupBoxHelper.HeaderForeground" Value="{DynamicResource GrayBrush3}" />
6061
<Setter Property="Controls:ControlsHelper.ContentCharacterCasing" Value="Normal" />
6162
<Setter Property="Controls:ExpanderHelper.HeaderDownStyle" Value="{DynamicResource ExpanderDownHeader}" />
6263
</Style>
6364

65+
<Style x:Key="ExpanderDownHeaderReverse" BasedOn="{StaticResource ExpanderDownHeaderStyle}" TargetType="{x:Type ToggleButton}">
66+
<Setter Property="Template">
67+
<Setter.Value>
68+
<ControlTemplate TargetType="{x:Type ToggleButton}">
69+
<Border Padding="{TemplateBinding Padding}"
70+
Background="{TemplateBinding Background}"
71+
BorderBrush="{TemplateBinding BorderBrush}"
72+
BorderThickness="{TemplateBinding BorderThickness}">
73+
<Grid Background="Transparent" SnapsToDevicePixels="False">
74+
<Grid.ColumnDefinitions>
75+
<ColumnDefinition Width="*" />
76+
<ColumnDefinition Width="Auto" />
77+
</Grid.ColumnDefinitions>
78+
<Controls:ContentControlEx Grid.Column="0"
79+
Margin="0,0,10,0"
80+
HorizontalAlignment="Stretch"
81+
Padding="{TemplateBinding Padding}"
82+
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
83+
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
84+
Content="{TemplateBinding Content}"
85+
ContentCharacterCasing="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.ContentCharacterCasing)}"
86+
ContentStringFormat="{TemplateBinding ContentStringFormat}"
87+
ContentTemplate="{TemplateBinding ContentTemplate}"
88+
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
89+
RecognizesAccessKey="True"
90+
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
91+
</Controls:ContentControlEx>
92+
<Rectangle Grid.Column="1" x:Name="Chevron" Width="20" Height="20" Fill="{DynamicResource GrayBrush3}" VerticalAlignment="Center">
93+
<Rectangle.OpacityMask>
94+
<VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ChevronDown}" />
95+
</Rectangle.OpacityMask>
96+
</Rectangle>
97+
</Grid>
98+
</Border>
99+
<ControlTemplate.Triggers>
100+
<Trigger Property="IsChecked" Value="True">
101+
<Setter TargetName="Chevron" Property="OpacityMask">
102+
<Setter.Value>
103+
<VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ChevronUp}" />
104+
</Setter.Value>
105+
</Setter>
106+
</Trigger>
107+
<Trigger Property="IsMouseOver" Value="True">
108+
<Setter TargetName="Chevron" Property="Fill" Value="{DynamicResource GrayBrush5}"/>
109+
</Trigger>
110+
</ControlTemplate.Triggers>
111+
</ControlTemplate>
112+
</Setter.Value>
113+
</Setter>
114+
</Style>
115+
116+
<Style x:Key="HeaderExpander" TargetType="{x:Type Expander}" BasedOn="{StaticResource MetroExpander}">
117+
<Setter Property="BorderThickness" Value="0" />
118+
<Setter Property="Margin" Value="-4" />
119+
<Setter Property="Background" Value="Transparent" />
120+
<Setter Property="Controls:GroupBoxHelper.HeaderForeground" Value="{DynamicResource GrayBrush3}" />
121+
<Setter Property="Controls:ControlsHelper.ContentCharacterCasing" Value="Normal" />
122+
<Setter Property="Controls:ExpanderHelper.HeaderDownStyle" Value="{DynamicResource ExpanderDownHeaderReverse}" />
123+
</Style>
124+
64125
<Style x:Key="RightExpanderOpen" BasedOn="{StaticResource ExpanderDownHeaderStyle}" TargetType="{x:Type ToggleButton}">
65126
<Setter Property="Template">
66127
<Setter.Value>
@@ -75,7 +136,7 @@
75136
<ColumnDefinition Width="Auto" />
76137
</Grid.ColumnDefinitions>
77138
<TextBlock Grid.Column="0" Text="{TemplateBinding Content}" Style="{StaticResource HeaderTextBlock}" Margin="10,10,10,0" />
78-
<Rectangle Grid.Column="1" x:Name="Chevron" Width="16" Height="16" Fill="{DynamicResource GrayBrush3}" Margin="0,10,10,0" VerticalAlignment="Center" HorizontalAlignment="Center">
139+
<Rectangle Grid.Column="1" x:Name="Chevron" Width="20" Height="20" Fill="{DynamicResource GrayBrush3}" Margin="0,10,10,0" VerticalAlignment="Center" HorizontalAlignment="Center">
79140
<Rectangle.OpacityMask>
80141
<VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ChevronLeft}" />
81142
</Rectangle.OpacityMask>
@@ -105,7 +166,7 @@
105166
<RowDefinition Height="Auto" />
106167
<RowDefinition Height="*" />
107168
</Grid.RowDefinitions>
108-
<Rectangle Grid.Row="0" x:Name="Chevron" Width="16" Height="16" Fill="{DynamicResource GrayBrush3}" Margin="10,16.5,10,10" VerticalAlignment="Center" HorizontalAlignment="Center">
169+
<Rectangle Grid.Row="0" x:Name="Chevron" Width="20" Height="20" Fill="{DynamicResource GrayBrush3}" Margin="10,14.5,10,10" VerticalAlignment="Center" HorizontalAlignment="Center">
109170
<Rectangle.OpacityMask>
110171
<VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ChevronRight}" />
111172
</Rectangle.OpacityMask>
@@ -126,7 +187,7 @@
126187
</Setter.Value>
127188
</Setter>
128189
</Style>
129-
190+
130191
<Style x:Key="RightExpander" TargetType="{x:Type Expander}" BasedOn="{StaticResource MetroExpander}">
131192
<Setter Property="BorderThickness" Value="0" />
132193
<Setter Property="Background" Value="Transparent" />

Source/NETworkManager/ViewModels/Applications/DNSLookupViewModel.cs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -363,26 +363,6 @@ private void CopySelectedResultAction()
363363
{
364364
Clipboard.SetText(SelectedLookupResult.Result);
365365
}
366-
367-
public ICommand CopySelectedDNSServerCommand
368-
{
369-
get { return new RelayCommand(p => CopySelectedDNSServerAction()); }
370-
}
371-
372-
private void CopySelectedDNSServerAction()
373-
{
374-
Clipboard.SetText(SelectedLookupResult.DNSServer);
375-
}
376-
377-
public ICommand CopySelectedPortCommand
378-
{
379-
get { return new RelayCommand(p => CopySelectedPortAction()); }
380-
}
381-
382-
private void CopySelectedPortAction()
383-
{
384-
Clipboard.SetText(SelectedLookupResult.Port.ToString());
385-
}
386366
#endregion
387367

388368
#region Methods
@@ -417,7 +397,7 @@ private void StartLookup()
417397
if (SettingsManager.Current.DNSLookup_UseCustomDNSServer)
418398
{
419399
dnsLookupOptions.UseCustomDNSServer = SettingsManager.Current.DNSLookup_UseCustomDNSServer;
420-
dnsLookupOptions.CustomDNSServers = SettingsManager.Current.DNSLookup_CustomDNSServer;
400+
dnsLookupOptions.CustomDNSServers = SettingsManager.Current.DNSLookup_CustomDNSServer.Select(x => x.Trim()).ToList();
421401
dnsLookupOptions.Port = SettingsManager.Current.DNSLookup_Port;
422402
}
423403

@@ -444,7 +424,7 @@ private void StartLookup()
444424
DNSLookup.LookupError += DNSLookup_LookupError;
445425
DNSLookup.LookupComplete += DNSLookup_LookupComplete; ;
446426

447-
DNSLookup.LookupAsync(Host.Split(';').ToList(), dnsLookupOptions);
427+
DNSLookup.LookupAsync(Host.Split(';').Select(x => x.Trim()).ToList(), dnsLookupOptions);
448428
}
449429

450430
private void LookupFinished()

0 commit comments

Comments
 (0)