diff --git a/src/modules/Hosts/Hosts/MainWindow.xaml b/src/modules/Hosts/Hosts/MainWindow.xaml index 99e7aeee85..f04b4e8832 100644 --- a/src/modules/Hosts/Hosts/MainWindow.xaml +++ b/src/modules/Hosts/Hosts/MainWindow.xaml @@ -17,22 +17,30 @@ - + - - - - - + + + + + + + + + + diff --git a/src/modules/Hosts/Hosts/MainWindow.xaml.cs b/src/modules/Hosts/Hosts/MainWindow.xaml.cs index a8b4f97c73..1e66190f68 100644 --- a/src/modules/Hosts/Hosts/MainWindow.xaml.cs +++ b/src/modules/Hosts/Hosts/MainWindow.xaml.cs @@ -2,7 +2,10 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System; using Hosts.Helpers; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Media; using WinUIEx; namespace Hosts @@ -13,15 +16,26 @@ namespace Hosts { InitializeComponent(); - SetTitleBar(); - - BringToForeground(); - } - - private void SetTitleBar() - { ExtendsContentIntoTitleBar = true; SetTitleBar(titleBar); + AppWindow.SetIcon("Assets/Hosts.ico"); + Title = Windows.ApplicationModel.Resources.ResourceLoader.GetForViewIndependentUse().GetString("WindowTitle"); + + BringToForeground(); + + Activated += MainWindow_Activated; + } + + private void MainWindow_Activated(object sender, WindowActivatedEventArgs args) + { + if (args.WindowActivationState == WindowActivationState.Deactivated) + { + AppTitleTextBlock.Foreground = (SolidColorBrush)App.Current.Resources["WindowCaptionForegroundDisabled"]; + } + else + { + AppTitleTextBlock.Foreground = (SolidColorBrush)App.Current.Resources["WindowCaptionForeground"]; + } } private void BringToForeground() diff --git a/src/modules/Hosts/Hosts/Strings/en-us/Resources.resw b/src/modules/Hosts/Hosts/Strings/en-us/Resources.resw index 7023bdd5e7..1eb20bc5db 100644 --- a/src/modules/Hosts/Hosts/Strings/en-us/Resources.resw +++ b/src/modules/Hosts/Hosts/Strings/en-us/Resources.resw @@ -133,7 +133,7 @@ New entry - New entry (CTRL+N) + New entry (Ctrl+N) Add an entry @@ -213,7 +213,7 @@ Cancel - Hosts file has changed by another application. Do you want to reload it? + Hosts file was modified externally. "Hosts" refers to the system hosts file, do not loc @@ -273,16 +273,13 @@ Show only duplicates - Only 9 hosts per entry are supported + Only 9 hosts per entry are supported. The affected entries have been split. This will take effect on next change. "Hosts" refers to the system hosts file, do not loc - Entries with too many hosts found + Entries contain too many hosts "Hosts" refers to the system hosts file, do not loc - - The affected entries have been splitted. This will take effect on next change. - Update @@ -302,7 +299,7 @@ Warning - + Hosts File Editor "Hosts File Editor" is the name of the utility. "Hosts" refers to the system hosts file, do not loc diff --git a/src/modules/Hosts/Hosts/Views/MainPage.xaml b/src/modules/Hosts/Hosts/Views/MainPage.xaml index 1ed9c48848..d70e732665 100644 --- a/src/modules/Hosts/Hosts/Views/MainPage.xaml +++ b/src/modules/Hosts/Hosts/Views/MainPage.xaml @@ -37,25 +37,23 @@ TrueValue="Collapsed" /> - + - - - + + - + + Orientation="Horizontal" + Spacing="4"> - - - - - -