SEBWIN-428: Fixed bug where visibility of reload button wasn't according to the active settings.
This commit is contained in:
parent
c6853f9239
commit
66e7c50a8e
5 changed files with 21 additions and 6 deletions
|
@ -147,6 +147,9 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
|
|||
case Keys.Browser.ResetOnQuitUrl:
|
||||
MapResetOnQuitUrl(settings, value);
|
||||
break;
|
||||
case Keys.Browser.ShowReloadButton:
|
||||
MapShowReloadButton(settings, value);
|
||||
break;
|
||||
case Keys.Browser.ShowToolbar:
|
||||
MapShowToolbar(settings, value);
|
||||
break;
|
||||
|
@ -436,6 +439,15 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
|
|||
}
|
||||
}
|
||||
|
||||
private void MapShowReloadButton(AppSettings settings, object value)
|
||||
{
|
||||
if (value is bool show)
|
||||
{
|
||||
settings.Browser.AdditionalWindow.ShowReloadButton = show;
|
||||
settings.Browser.MainWindow.ShowReloadButton = show;
|
||||
}
|
||||
}
|
||||
|
||||
private void MapRequestFilter(IDictionary<string, object> rawData, AppSettings settings)
|
||||
{
|
||||
var processMainRequests = rawData.TryGetValue(Keys.Browser.Filter.EnableMainRequestFilter, out var value) && value as bool? == true;
|
||||
|
|
|
@ -29,14 +29,12 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
|||
|
||||
private void AllowBrowserToolbarForReloading(IDictionary<string, object> rawData, AppSettings settings)
|
||||
{
|
||||
var showReloadButton = rawData.TryGetValue(Keys.Browser.ShowReloadButton, out var v) && v is bool show && show;
|
||||
|
||||
if (settings.Browser.AdditionalWindow.AllowReloading && showReloadButton)
|
||||
if (settings.Browser.AdditionalWindow.AllowReloading && settings.Browser.AdditionalWindow.ShowReloadButton)
|
||||
{
|
||||
settings.Browser.AdditionalWindow.ShowToolbar = true;
|
||||
}
|
||||
|
||||
if (settings.Browser.MainWindow.AllowReloading && showReloadButton)
|
||||
if (settings.Browser.MainWindow.AllowReloading && settings.Browser.MainWindow.ShowReloadButton)
|
||||
{
|
||||
settings.Browser.MainWindow.ShowToolbar = true;
|
||||
}
|
||||
|
|
|
@ -76,6 +76,11 @@ namespace SafeExamBrowser.Settings.Browser
|
|||
/// </summary>
|
||||
public bool ShowHomeButton { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the reload button is visible.
|
||||
/// </summary>
|
||||
public bool ShowReloadButton { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the user will need to confirm every reload attempt.
|
||||
/// </summary>
|
||||
|
|
|
@ -343,7 +343,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
|
|||
HomeButton.Visibility = WindowSettings.ShowHomeButton ? Visibility.Visible : Visibility.Collapsed;
|
||||
MenuButton.IsEnabled = settings.AllowPageZoom || WindowSettings.AllowDeveloperConsole;
|
||||
ReloadButton.IsEnabled = WindowSettings.AllowReloading;
|
||||
ReloadButton.Visibility = WindowSettings.AllowReloading ? Visibility.Visible : Visibility.Collapsed;
|
||||
ReloadButton.Visibility = WindowSettings.ShowReloadButton ? Visibility.Visible : Visibility.Collapsed;
|
||||
Toolbar.Visibility = WindowSettings.ShowToolbar ? Visibility.Visible : Visibility.Collapsed;
|
||||
UrlTextBox.Visibility = WindowSettings.AllowAddressBar ? Visibility.Visible : Visibility.Hidden;
|
||||
ZoomMenuItem.Visibility = settings.AllowPageZoom ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
|
|
@ -343,7 +343,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
|
|||
HomeButton.Visibility = WindowSettings.ShowHomeButton ? Visibility.Visible : Visibility.Collapsed;
|
||||
MenuButton.IsEnabled = settings.AllowPageZoom || WindowSettings.AllowDeveloperConsole;
|
||||
ReloadButton.IsEnabled = WindowSettings.AllowReloading;
|
||||
ReloadButton.Visibility = WindowSettings.AllowReloading ? Visibility.Visible : Visibility.Collapsed;
|
||||
ReloadButton.Visibility = WindowSettings.ShowReloadButton ? Visibility.Visible : Visibility.Collapsed;
|
||||
Toolbar.Visibility = WindowSettings.ShowToolbar ? Visibility.Visible : Visibility.Collapsed;
|
||||
UrlTextBox.Visibility = WindowSettings.AllowAddressBar ? Visibility.Visible : Visibility.Hidden;
|
||||
ZoomMenuItem.Visibility = settings.AllowPageZoom ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
|
Loading…
Reference in a new issue