* Added icon to "Recent >" menu item. * Refactored app menu implementation, and implemented keyboard accelerators. Still doesn't work though. * Few things fixed, but still doesn't work. * Clicking menu items works. * Fixing an issue with resources. * New menu binding implemented. Still doesn't work though. * Menu displayed properly, except for "Settings". * Menu works, but it doesn't refresh. * Works. But needs to be polished. * All known issues with the new app menu solved. * Significantly simplifying app menu binding. * Removing some obsolete classes. * Menu binding mechanism additionally optimized for performances. * Removing unused translations. * Further refactoring app menu binding, in order to make it more general. * Renaming menu items in order to make them usable for both new tab and new window commands. * Changing menu item keyboard accelerators based on new tab / window settings. * Menu item keyboard accelerators are dynamically changing with chainging terminals in new tabs/windows option. * New tab / window settings honored for top level menu items. * New window mechanism simplified. Terminal-launching code refactored to be more readable. A bug with "SSH Info" fixed. * Merging the latest changed. * Fixing some after-merge issues. * Minor refactoring. * Minor refactoring. * Default profile menu item now contains the profile name. Still doesn't update though. * Default profile name in the menu item now updates. * Updating resources from POEditor. * New tab/window cascading menues implemented. * Reverting translations back to the correct (the latest) version. * Undoing translation changes from the last commit. I've made these by mistake. * Configurable tab/window cascading menu. * "Application menu type" settings value added. * Minor spelling fix. * Fixing some after-merge issues.
43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using System;
|
|
using Windows.UI.Xaml.Data;
|
|
// ReSharper disable LocalizableElement
|
|
|
|
namespace FluentTerminal.App.Converters
|
|
{
|
|
public class BooleanNegationConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, string language)
|
|
{
|
|
if (targetType == typeof(bool))
|
|
{
|
|
if (value is bool isValue)
|
|
{
|
|
return !isValue;
|
|
}
|
|
|
|
throw new ArgumentException($"{nameof(value)} argument has to be of type bool.", nameof(value));
|
|
}
|
|
|
|
if (targetType == typeof(bool?))
|
|
{
|
|
if (value == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
if (value is bool isValue)
|
|
{
|
|
return !isValue;
|
|
}
|
|
|
|
throw new ArgumentException($"{nameof(value)} argument has to be of type bool or Nullable<bool>.", nameof(value));
|
|
}
|
|
|
|
throw new ArgumentException($"{nameof(targetType)} argument has to {typeof(bool)}.",
|
|
nameof(targetType));
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, string language) =>
|
|
Convert(value, targetType, parameter, language);
|
|
}
|
|
} |