* Update settings window layout with consistent margins Updated the layout of the different views of the settings window so that there is always margin at the bottom. In some cases this was achieved using <StackPanels> for clarity and extensibility, grouping e.g. a title and some radio options together with one unified margin. Also made some small consistency changes to the .xaml files. * Add width to Themes text input * Normalize margins in settings * Add default display values in Terminal settings ... for Arguments and Working Directory * Generalize TemplateSelector for empty strings * Add default display value for profile keybindings * Update margins and fontsize in theme preview * Update 'loading...' message in About ... to "Checking for updates..." and a spinner as suggested by @skipmeister123 * No popup when cancelling profile edit no changes * Delete profile when new and cancelled * Open new and cloned themes in edit mode ... and make it so canceling deletes the theme. * No popup when cancelling theme edit no changes * Add resources for margin definitions * Check for null Author in TerminalTheme * Add resource for header margin definition * Moved createdBy text to code behind
27 lines
817 B
C#
27 lines
817 B
C#
using FluentTerminal.App.ViewModels.Settings;
|
|
using Windows.UI.Xaml;
|
|
using Windows.UI.Xaml.Controls;
|
|
|
|
namespace FluentTerminal.App.Views
|
|
{
|
|
public class TerminalKeybindTemplateSelector : DataTemplateSelector
|
|
{
|
|
public DataTemplate DefaultTemplate { get; set; }
|
|
public DataTemplate KeyBindingsTemplate { get; set; }
|
|
|
|
protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
|
|
{
|
|
return SelectTemplateCore(item);
|
|
}
|
|
|
|
protected override DataTemplate SelectTemplateCore(object item)
|
|
{
|
|
if (item is KeyBindingsViewModel keyBindings)
|
|
{
|
|
return keyBindings.KeyBindings.Count == 0 ? DefaultTemplate : KeyBindingsTemplate;
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
}
|