From 37293687d07eadfa6604b90aad8a97761dc9f5a2 Mon Sep 17 00:00:00 2001 From: dbuechel Date: Wed, 23 Aug 2017 08:32:44 +0200 Subject: [PATCH] Added and replaced icons for classic UI. --- .../BrowserApplicationInfo.cs | 2 +- .../BrowserIconResource.cs | 6 +-- .../BrowserWindow.xaml | 2 +- .../BrowserWindow.xaml.cs | 17 ++++++ .../Controls/QuitButton.xaml | 3 +- .../Controls/QuitButton.xaml.cs | 11 ++++ .../Images/Battery.xaml | 11 ++++ .../Images/Keyboard.xaml | 34 ++++++++++++ .../Images/NavigateBack.xaml | 12 +++++ .../Images/NavigateForward.xaml | 12 +++++ .../Images/Reload.xaml | 10 ++++ .../Images/ShutDown.xaml | 12 +++++ .../Images/SkipBack.xaml | 11 ++++ .../Images/WiFi_0.xaml | 16 ++++++ .../Images/WiFi_100.xaml | 16 ++++++ .../Images/WiFi_33.xaml | 16 ++++++ .../Images/WiFi_66.xaml | 16 ++++++ .../Images/ZoomPageIn.xaml | 12 +++++ .../Images/ZoomPageOut.xaml | 12 +++++ ...feExamBrowser.UserInterface.Classic.csproj | 53 +++++++++++++++++++ .../Templates/Buttons.xaml | 3 +- .../Utilities/XamlIconResource.cs | 25 +++++++++ 22 files changed, 305 insertions(+), 7 deletions(-) create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/Battery.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/Keyboard.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/NavigateBack.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/NavigateForward.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/Reload.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/ShutDown.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/SkipBack.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/WiFi_0.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/WiFi_100.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/WiFi_33.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/WiFi_66.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/ZoomPageIn.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Images/ZoomPageOut.xaml create mode 100644 SafeExamBrowser.UserInterface.Classic/Utilities/XamlIconResource.cs diff --git a/SafeExamBrowser.Browser/BrowserApplicationInfo.cs b/SafeExamBrowser.Browser/BrowserApplicationInfo.cs index ea4562e0..de0daa79 100644 --- a/SafeExamBrowser.Browser/BrowserApplicationInfo.cs +++ b/SafeExamBrowser.Browser/BrowserApplicationInfo.cs @@ -12,7 +12,7 @@ namespace SafeExamBrowser.Browser { public class BrowserApplicationInfo : IApplicationInfo { - public string Name => "Chromium Browser"; + public string Name => "Safe Exam Browser"; public string Tooltip => Name; public IIconResource IconResource { get; } = new BrowserIconResource(); } diff --git a/SafeExamBrowser.Browser/BrowserIconResource.cs b/SafeExamBrowser.Browser/BrowserIconResource.cs index 5a12659b..af496011 100644 --- a/SafeExamBrowser.Browser/BrowserIconResource.cs +++ b/SafeExamBrowser.Browser/BrowserIconResource.cs @@ -13,8 +13,8 @@ namespace SafeExamBrowser.Browser { public class BrowserIconResource : IIconResource { - public Uri Uri => new Uri("pack://application:,,,/SafeExamBrowser.Browser;component/Images/ChromiumLogo.xaml"); - public bool IsBitmapResource => false; - public bool IsXamlResource => true; + public Uri Uri => new Uri("pack://application:,,,/SafeExamBrowser.UserInterface.Classic;component/Images/SafeExamBrowser.ico"); + public bool IsBitmapResource => true; + public bool IsXamlResource => false; } } diff --git a/SafeExamBrowser.UserInterface.Classic/BrowserWindow.xaml b/SafeExamBrowser.UserInterface.Classic/BrowserWindow.xaml index 1754f754..f1073082 100644 --- a/SafeExamBrowser.UserInterface.Classic/BrowserWindow.xaml +++ b/SafeExamBrowser.UserInterface.Classic/BrowserWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:SafeExamBrowser.UserInterface.Classic" mc:Ignorable="d" - Title="BrowserWindow" Background="#FFF0F0F0" Height="500" Width="500" WindowState="Maximized" Icon=".\Images\Chromium.ico"> + Title="BrowserWindow" Background="#FFF0F0F0" Height="500" Width="500" WindowState="Maximized" Icon=".\Images\SafeExamBrowser.ico"> diff --git a/SafeExamBrowser.UserInterface.Classic/BrowserWindow.xaml.cs b/SafeExamBrowser.UserInterface.Classic/BrowserWindow.xaml.cs index fa1b7114..d13b9200 100644 --- a/SafeExamBrowser.UserInterface.Classic/BrowserWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface.Classic/BrowserWindow.xaml.cs @@ -6,10 +6,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +using System; using System.Windows; using System.Windows.Input; using SafeExamBrowser.Contracts.Configuration.Settings; using SafeExamBrowser.Contracts.UserInterface; +using SafeExamBrowser.UserInterface.Classic.Utilities; namespace SafeExamBrowser.UserInterface.Classic { @@ -86,6 +88,7 @@ namespace SafeExamBrowser.UserInterface.Classic ForwardButton.Click += (o, args) => ForwardNavigationRequested?.Invoke(); ApplySettings(); + LoadIcons(); } private void BrowserWindow_KeyUp(object sender, KeyEventArgs e) @@ -125,5 +128,19 @@ namespace SafeExamBrowser.UserInterface.Classic ForwardButton.IsEnabled = settings.AllowForwardNavigation; ForwardButton.Visibility = settings.AllowForwardNavigation ? Visibility.Visible : Visibility.Collapsed; } + + private void LoadIcons() + { + var backUri = new Uri("pack://application:,,,/SafeExamBrowser.UserInterface.Classic;component/Images/NavigateBack.xaml"); + var forwardUri = new Uri("pack://application:,,,/SafeExamBrowser.UserInterface.Classic;component/Images/NavigateForward.xaml"); + var reloadUri = new Uri("pack://application:,,,/SafeExamBrowser.UserInterface.Classic;component/Images/Reload.xaml"); + var back = new XamlIconResource(backUri); + var forward = new XamlIconResource(forwardUri); + var reload = new XamlIconResource(reloadUri); + + ReloadButton.Content = IconResourceLoader.Load(reload); + BackButton.Content = IconResourceLoader.Load(back); + ForwardButton.Content = IconResourceLoader.Load(forward); + } } } diff --git a/SafeExamBrowser.UserInterface.Classic/Controls/QuitButton.xaml b/SafeExamBrowser.UserInterface.Classic/Controls/QuitButton.xaml index aa0d262e..a61bff00 100644 --- a/SafeExamBrowser.UserInterface.Classic/Controls/QuitButton.xaml +++ b/SafeExamBrowser.UserInterface.Classic/Controls/QuitButton.xaml @@ -14,6 +14,7 @@ - +