Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8131140cb0 | ||
|
|
304314230c | ||
|
|
0ce605f122 | ||
|
|
d4aadd7dd4 | ||
|
|
3cf3e0a330 | ||
|
|
ff2cfc36b6 |
No files matched your search
@@ -23,7 +23,7 @@ namespace FluentTerminal.App.Services.Test
|
||||
public void ShowCreateKeyBindingDialog_Default_UsesCreateKeyBindingDialog()
|
||||
{
|
||||
var createKeyBindingDialog = new Mock<ICreateKeyBindingDialog>();
|
||||
var dialogService = new DialogService(Mock.Of<IShellProfileSelectionDialog>, Mock.Of<IMessageDialog>, () => createKeyBindingDialog.Object);
|
||||
var dialogService = new DialogService(Mock.Of<IShellProfileSelectionDialog>, Mock.Of<IMessageDialog>, () => createKeyBindingDialog.Object, Mock.Of<IInputDialog>);
|
||||
|
||||
dialogService.ShowCreateKeyBindingDialog();
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace FluentTerminal.App.Services.Test
|
||||
var title = string.Empty;
|
||||
var content = _fixture.Create<string>();
|
||||
var buttons = _fixture.CreateMany<DialogButton>(2);
|
||||
var dialogService = new DialogService(Mock.Of<IShellProfileSelectionDialog>, Mock.Of<IMessageDialog>, Mock.Of<ICreateKeyBindingDialog>);
|
||||
var dialogService = new DialogService(Mock.Of<IShellProfileSelectionDialog>, Mock.Of<IMessageDialog>, Mock.Of<ICreateKeyBindingDialog>, Mock.Of<IInputDialog>);
|
||||
|
||||
Func<Task<DialogButton>> showMessageDialogAsnyc = () => dialogService.ShowMessageDialogAsnyc(title, content, buttons.ElementAt(0), buttons.ElementAt(1));
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace FluentTerminal.App.Services.Test
|
||||
var title = _fixture.Create<string>();
|
||||
var content = string.Empty;
|
||||
var buttons = _fixture.CreateMany<DialogButton>(2);
|
||||
var dialogService = new DialogService(Mock.Of<IShellProfileSelectionDialog>, Mock.Of<IMessageDialog>, Mock.Of<ICreateKeyBindingDialog>);
|
||||
var dialogService = new DialogService(Mock.Of<IShellProfileSelectionDialog>, Mock.Of<IMessageDialog>, Mock.Of<ICreateKeyBindingDialog>, Mock.Of<IInputDialog>);
|
||||
|
||||
Func<Task<DialogButton>> showMessageDialogAsnyc = () => dialogService.ShowMessageDialogAsnyc(title, content, buttons.ElementAt(0), buttons.ElementAt(1));
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace FluentTerminal.App.Services.Test
|
||||
{
|
||||
var title = _fixture.Create<string>();
|
||||
var content = _fixture.Create<string>();
|
||||
var dialogService = new DialogService(Mock.Of<IShellProfileSelectionDialog>, Mock.Of<IMessageDialog>, Mock.Of<ICreateKeyBindingDialog>);
|
||||
var dialogService = new DialogService(Mock.Of<IShellProfileSelectionDialog>, Mock.Of<IMessageDialog>, Mock.Of<ICreateKeyBindingDialog>, Mock.Of<IInputDialog>);
|
||||
|
||||
Func<Task<DialogButton>> showMessageDialogAsnyc = () => dialogService.ShowMessageDialogAsnyc(title, content);
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace FluentTerminal.App.Services.Test
|
||||
var content = _fixture.Create<string>();
|
||||
var buttons = _fixture.CreateMany<DialogButton>(2);
|
||||
var messageDialog = new Mock<IMessageDialog>();
|
||||
var dialogService = new DialogService(Mock.Of<IShellProfileSelectionDialog>, () => messageDialog.Object, Mock.Of<ICreateKeyBindingDialog>);
|
||||
var dialogService = new DialogService(Mock.Of<IShellProfileSelectionDialog>, () => messageDialog.Object, Mock.Of<ICreateKeyBindingDialog>, Mock.Of<IInputDialog>);
|
||||
|
||||
dialogService.ShowMessageDialogAsnyc(title, content, buttons.ElementAt(0), buttons.ElementAt(1));
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace FluentTerminal.App.Services.Test
|
||||
public void ShowProfileSelectionDialogAsync_Default_UsesShellProfileSelectionDialog()
|
||||
{
|
||||
var shellProfileSelectionDialog = new Mock<IShellProfileSelectionDialog>();
|
||||
var dialogService = new DialogService(() => shellProfileSelectionDialog.Object, Mock.Of<IMessageDialog>, Mock.Of<ICreateKeyBindingDialog>);
|
||||
var dialogService = new DialogService(() => shellProfileSelectionDialog.Object, Mock.Of<IMessageDialog>, Mock.Of<ICreateKeyBindingDialog>, Mock.Of<IInputDialog>);
|
||||
|
||||
dialogService.ShowProfileSelectionDialogAsync();
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FluentTerminal.App.Services.Dialogs
|
||||
{
|
||||
public interface IInputDialog
|
||||
{
|
||||
void SetTitle(string title);
|
||||
Task<string> GetInput();
|
||||
}
|
||||
}
|
||||
@@ -16,5 +16,6 @@ namespace FluentTerminal.App.Services
|
||||
Task<ShellProfile> ShowProfileSelectionDialogAsync();
|
||||
|
||||
Task<KeyBinding> ShowCreateKeyBindingDialog();
|
||||
Task<string> ShowInputDialogAsync(string title);
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,14 @@ namespace FluentTerminal.App.Services.Implementation
|
||||
private readonly Func<IShellProfileSelectionDialog> _shellProfileSelectionDialogFactory;
|
||||
private readonly Func<IMessageDialog> _messageDialogFactory;
|
||||
private readonly Func<ICreateKeyBindingDialog> _createKeyBindingDialogFactory;
|
||||
private readonly Func<IInputDialog> _inputDialogFactory;
|
||||
|
||||
public DialogService(Func<IShellProfileSelectionDialog> shellProfileSelectionDialogFactory, Func<IMessageDialog> messageDialogFactory, Func<ICreateKeyBindingDialog> createKeyBindingDialogFactory)
|
||||
public DialogService(Func<IShellProfileSelectionDialog> shellProfileSelectionDialogFactory, Func<IMessageDialog> messageDialogFactory, Func<ICreateKeyBindingDialog> createKeyBindingDialogFactory, Func<IInputDialog> inputDialogFactory)
|
||||
{
|
||||
_shellProfileSelectionDialogFactory = shellProfileSelectionDialogFactory;
|
||||
_messageDialogFactory = messageDialogFactory;
|
||||
_createKeyBindingDialogFactory = createKeyBindingDialogFactory;
|
||||
_inputDialogFactory = inputDialogFactory;
|
||||
}
|
||||
|
||||
public Task<KeyBinding> ShowCreateKeyBindingDialog()
|
||||
@@ -54,6 +56,14 @@ namespace FluentTerminal.App.Services.Implementation
|
||||
return dialog.ShowAsync();
|
||||
}
|
||||
|
||||
public Task<string> ShowInputDialogAsync(string title)
|
||||
{
|
||||
var dialog = _inputDialogFactory.Invoke();
|
||||
dialog.SetTitle(title);
|
||||
|
||||
return dialog.GetInput();
|
||||
}
|
||||
|
||||
public Task<ShellProfile> ShowProfileSelectionDialogAsync()
|
||||
{
|
||||
var dialog = _shellProfileSelectionDialogFactory();
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace FluentTerminal.App.ViewModels.Settings
|
||||
|
||||
CreateThemeCommand = new RelayCommand(CreateTheme);
|
||||
ImportThemeCommand = new RelayCommand(ImportTheme);
|
||||
CloneCommand = new RelayCommand<ThemeViewModel>(CloneTheme);
|
||||
|
||||
_settingsService.TerminalOptionsChanged += OnTerminalOptionsChanged;
|
||||
|
||||
@@ -55,6 +56,7 @@ namespace FluentTerminal.App.ViewModels.Settings
|
||||
|
||||
public RelayCommand CreateThemeCommand { get; }
|
||||
public RelayCommand ImportThemeCommand { get; }
|
||||
public RelayCommand<ThemeViewModel> CloneCommand { get; set; }
|
||||
|
||||
public double BackgroundOpacity
|
||||
{
|
||||
@@ -81,6 +83,18 @@ namespace FluentTerminal.App.ViewModels.Settings
|
||||
|
||||
public ObservableCollection<ThemeViewModel> Themes { get; } = new ObservableCollection<ThemeViewModel>();
|
||||
|
||||
private void CloneTheme(ThemeViewModel theme)
|
||||
{
|
||||
var cloned = new TerminalTheme(theme.Model)
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
PreInstalled = false,
|
||||
Name = $"Copy of {theme.Name}"
|
||||
};
|
||||
|
||||
AddTheme(cloned);
|
||||
}
|
||||
|
||||
private void CreateTheme()
|
||||
{
|
||||
var defaultTheme = _settingsService.GetTheme(_defaultValueProvider.GetDefaultThemeId());
|
||||
@@ -92,13 +106,7 @@ namespace FluentTerminal.App.ViewModels.Settings
|
||||
Colors = new TerminalColors(defaultTheme.Colors)
|
||||
};
|
||||
|
||||
_settingsService.SaveTheme(theme, true);
|
||||
|
||||
var viewModel = new ThemeViewModel(theme, _settingsService, _dialogService, _fileSystemService);
|
||||
viewModel.Activated += OnThemeActivated;
|
||||
viewModel.Deleted += OnThemeDeleted;
|
||||
Themes.Add(viewModel);
|
||||
SelectedTheme = viewModel;
|
||||
AddTheme(theme);
|
||||
}
|
||||
|
||||
private async void ImportTheme()
|
||||
@@ -118,13 +126,7 @@ namespace FluentTerminal.App.ViewModels.Settings
|
||||
{
|
||||
var theme = await parser.Parse(file.Name, file.Content).ConfigureAwait(true);
|
||||
|
||||
_settingsService.SaveTheme(theme, true);
|
||||
|
||||
var viewModel = new ThemeViewModel(theme, _settingsService, _dialogService, _fileSystemService);
|
||||
viewModel.Activated += OnThemeActivated;
|
||||
viewModel.Deleted += OnThemeDeleted;
|
||||
Themes.Add(viewModel);
|
||||
SelectedTheme = viewModel;
|
||||
AddTheme(theme);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -133,6 +135,17 @@ namespace FluentTerminal.App.ViewModels.Settings
|
||||
}
|
||||
}
|
||||
|
||||
private void AddTheme(TerminalTheme theme)
|
||||
{
|
||||
_settingsService.SaveTheme(theme, true);
|
||||
|
||||
var viewModel = new ThemeViewModel(theme, _settingsService, _dialogService, _fileSystemService);
|
||||
viewModel.Activated += OnThemeActivated;
|
||||
viewModel.Deleted += OnThemeDeleted;
|
||||
Themes.Add(viewModel);
|
||||
SelectedTheme = viewModel;
|
||||
}
|
||||
|
||||
private void OnThemeActivated(object sender, EventArgs e)
|
||||
{
|
||||
if (sender is ThemeViewModel activatedTheme)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Fleck;
|
||||
using FluentTerminal.App.Services;
|
||||
using FluentTerminal.App.ViewModels.Infrastructure;
|
||||
using FluentTerminal.Models;
|
||||
using FluentTerminal.Models.Enums;
|
||||
using GalaSoft.MvvmLight;
|
||||
@@ -77,6 +78,7 @@ namespace FluentTerminal.App.ViewModels
|
||||
FindPreviousCommand = new RelayCommand(async () => await FindPrevious().ConfigureAwait(false));
|
||||
CloseSearchPanelCommand = new RelayCommand(CloseSearchPanel);
|
||||
SelectTabThemeCommand = new RelayCommand<string>(SelectTabTheme);
|
||||
EditTitleCommand = new AsyncCommand(EditTitle);
|
||||
}
|
||||
|
||||
public event EventHandler Closed;
|
||||
@@ -108,6 +110,8 @@ namespace FluentTerminal.App.ViewModels
|
||||
|
||||
public RelayCommand FindPreviousCommand { get; }
|
||||
|
||||
public IAsyncCommand EditTitleCommand { get; }
|
||||
|
||||
public bool Initialized { get; private set; }
|
||||
|
||||
public bool IsSelected
|
||||
@@ -402,6 +406,15 @@ namespace FluentTerminal.App.ViewModels
|
||||
TabTheme = TabThemes.FirstOrDefault(t => t.Name == name);
|
||||
}
|
||||
|
||||
private async Task EditTitle()
|
||||
{
|
||||
var result = await _dialogService.ShowInputDialogAsync("Edit Title");
|
||||
if (result != null)
|
||||
{
|
||||
Title = result;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task TryClose()
|
||||
{
|
||||
if (ApplicationSettings.ConfirmClosingTabs)
|
||||
|
||||
@@ -40,7 +40,6 @@ namespace FluentTerminal.App.ViewModels
|
||||
private string _name;
|
||||
private string _red;
|
||||
private string _selection;
|
||||
private readonly TerminalTheme _theme;
|
||||
private string _white;
|
||||
private string _yellow;
|
||||
private readonly IFileSystemService _fileSystemService;
|
||||
@@ -49,38 +48,38 @@ namespace FluentTerminal.App.ViewModels
|
||||
|
||||
public ThemeViewModel(TerminalTheme theme, ISettingsService settingsService, IDialogService dialogService, IFileSystemService fileSystemService)
|
||||
{
|
||||
_theme = theme;
|
||||
Model = theme;
|
||||
_settingsService = settingsService;
|
||||
_dialogService = dialogService;
|
||||
_fileSystemService = fileSystemService;
|
||||
|
||||
Name = _theme.Name;
|
||||
Author = _theme.Author;
|
||||
Id = _theme.Id;
|
||||
Name = Model.Name;
|
||||
Author = Model.Author;
|
||||
Id = Model.Id;
|
||||
|
||||
Black = _theme.Colors.Black;
|
||||
Red = _theme.Colors.Red;
|
||||
Green = _theme.Colors.Green;
|
||||
Yellow = _theme.Colors.Yellow;
|
||||
Blue = _theme.Colors.Blue;
|
||||
Magenta = _theme.Colors.Magenta;
|
||||
Cyan = _theme.Colors.Cyan;
|
||||
White = _theme.Colors.White;
|
||||
Black = Model.Colors.Black;
|
||||
Red = Model.Colors.Red;
|
||||
Green = Model.Colors.Green;
|
||||
Yellow = Model.Colors.Yellow;
|
||||
Blue = Model.Colors.Blue;
|
||||
Magenta = Model.Colors.Magenta;
|
||||
Cyan = Model.Colors.Cyan;
|
||||
White = Model.Colors.White;
|
||||
|
||||
BrightBlack = _theme.Colors.BrightBlack;
|
||||
BrightRed = _theme.Colors.BrightRed;
|
||||
BrightGreen = _theme.Colors.BrightGreen;
|
||||
BrightYellow = _theme.Colors.BrightYellow;
|
||||
BrightBlue = _theme.Colors.BrightBlue;
|
||||
BrightMagenta = _theme.Colors.BrightMagenta;
|
||||
BrightCyan = _theme.Colors.BrightCyan;
|
||||
BrightWhite = _theme.Colors.BrightWhite;
|
||||
BrightBlack = Model.Colors.BrightBlack;
|
||||
BrightRed = Model.Colors.BrightRed;
|
||||
BrightGreen = Model.Colors.BrightGreen;
|
||||
BrightYellow = Model.Colors.BrightYellow;
|
||||
BrightBlue = Model.Colors.BrightBlue;
|
||||
BrightMagenta = Model.Colors.BrightMagenta;
|
||||
BrightCyan = Model.Colors.BrightCyan;
|
||||
BrightWhite = Model.Colors.BrightWhite;
|
||||
|
||||
Background = _theme.Colors.Background;
|
||||
Foreground = _theme.Colors.Foreground;
|
||||
Cursor = _theme.Colors.Cursor;
|
||||
CursorAccent = _theme.Colors.CursorAccent;
|
||||
Selection = _theme.Colors.Selection;
|
||||
Background = Model.Colors.Background;
|
||||
Foreground = Model.Colors.Foreground;
|
||||
Cursor = Model.Colors.Cursor;
|
||||
CursorAccent = Model.Colors.CursorAccent;
|
||||
Selection = Model.Colors.Selection;
|
||||
|
||||
SetActiveCommand = new RelayCommand(SetActive);
|
||||
DeleteCommand = new RelayCommand(async () => await Delete().ConfigureAwait(false), NotPreInstalled);
|
||||
@@ -94,6 +93,8 @@ namespace FluentTerminal.App.ViewModels
|
||||
|
||||
public event EventHandler Deleted;
|
||||
|
||||
public TerminalTheme Model { get; }
|
||||
|
||||
public string Author
|
||||
{
|
||||
get => _author;
|
||||
@@ -268,34 +269,34 @@ namespace FluentTerminal.App.ViewModels
|
||||
|
||||
public void SaveChanges()
|
||||
{
|
||||
_theme.Name = Name;
|
||||
_theme.Author = Author;
|
||||
Model.Name = Name;
|
||||
Model.Author = Author;
|
||||
|
||||
_theme.Colors.Black = Black;
|
||||
_theme.Colors.Red = Red;
|
||||
_theme.Colors.Green = Green;
|
||||
_theme.Colors.Yellow = Yellow;
|
||||
_theme.Colors.Blue = Blue;
|
||||
_theme.Colors.Magenta = Magenta;
|
||||
_theme.Colors.Cyan = Cyan;
|
||||
_theme.Colors.White = White;
|
||||
Model.Colors.Black = Black;
|
||||
Model.Colors.Red = Red;
|
||||
Model.Colors.Green = Green;
|
||||
Model.Colors.Yellow = Yellow;
|
||||
Model.Colors.Blue = Blue;
|
||||
Model.Colors.Magenta = Magenta;
|
||||
Model.Colors.Cyan = Cyan;
|
||||
Model.Colors.White = White;
|
||||
|
||||
_theme.Colors.BrightBlack = BrightBlack;
|
||||
_theme.Colors.BrightRed = BrightRed;
|
||||
_theme.Colors.BrightGreen = BrightGreen;
|
||||
_theme.Colors.BrightYellow = BrightYellow;
|
||||
_theme.Colors.BrightBlue = BrightBlue;
|
||||
_theme.Colors.BrightMagenta = BrightMagenta;
|
||||
_theme.Colors.BrightCyan = BrightCyan;
|
||||
_theme.Colors.BrightWhite = BrightWhite;
|
||||
Model.Colors.BrightBlack = BrightBlack;
|
||||
Model.Colors.BrightRed = BrightRed;
|
||||
Model.Colors.BrightGreen = BrightGreen;
|
||||
Model.Colors.BrightYellow = BrightYellow;
|
||||
Model.Colors.BrightBlue = BrightBlue;
|
||||
Model.Colors.BrightMagenta = BrightMagenta;
|
||||
Model.Colors.BrightCyan = BrightCyan;
|
||||
Model.Colors.BrightWhite = BrightWhite;
|
||||
|
||||
_theme.Colors.Background = Background;
|
||||
_theme.Colors.Foreground = Foreground;
|
||||
_theme.Colors.Cursor = Cursor;
|
||||
_theme.Colors.CursorAccent = CursorAccent;
|
||||
_theme.Colors.Selection = Selection;
|
||||
Model.Colors.Background = Background;
|
||||
Model.Colors.Foreground = Foreground;
|
||||
Model.Colors.Cursor = Cursor;
|
||||
Model.Colors.CursorAccent = CursorAccent;
|
||||
Model.Colors.Selection = Selection;
|
||||
|
||||
_settingsService.SaveTheme(_theme);
|
||||
_settingsService.SaveTheme(Model);
|
||||
|
||||
InEditMode = false;
|
||||
}
|
||||
@@ -339,7 +340,7 @@ namespace FluentTerminal.App.ViewModels
|
||||
|
||||
private bool NotPreInstalled()
|
||||
{
|
||||
return !_theme.PreInstalled;
|
||||
return !Model.PreInstalled;
|
||||
}
|
||||
|
||||
private async Task Delete()
|
||||
@@ -354,7 +355,7 @@ namespace FluentTerminal.App.ViewModels
|
||||
|
||||
private void Edit()
|
||||
{
|
||||
_fallBackColors = new TerminalColors(_theme.Colors);
|
||||
_fallBackColors = new TerminalColors(Model.Colors);
|
||||
_fallBackName = Name;
|
||||
_fallBackAuthor = Author;
|
||||
InEditMode = true;
|
||||
@@ -367,7 +368,7 @@ namespace FluentTerminal.App.ViewModels
|
||||
|
||||
private Task Export()
|
||||
{
|
||||
var content = JsonConvert.SerializeObject(_theme, Formatting.Indented, new JsonSerializerSettings { ContractResolver = new TerminalThemeContractResolver() });
|
||||
var content = JsonConvert.SerializeObject(Model, Formatting.Indented, new JsonSerializerSettings { ContractResolver = new TerminalThemeContractResolver() });
|
||||
return _fileSystemService.SaveTextFile(Name, "Fluent Terminal Theme", ".flutecolors", content);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace FluentTerminal.App
|
||||
builder.RegisterType<SystemFontService>().As<ISystemFontService>().SingleInstance();
|
||||
builder.RegisterType<ShellProfileSelectionDialog>().As<IShellProfileSelectionDialog>().InstancePerDependency();
|
||||
builder.RegisterType<CreateKeyBindingDialog>().As<ICreateKeyBindingDialog>().InstancePerDependency();
|
||||
builder.RegisterType<InputDialog>().As<IInputDialog>().InstancePerDependency();
|
||||
builder.RegisterType<MessageDialogAdapter>().As<IMessageDialog>().InstancePerDependency();
|
||||
builder.RegisterType<ApplicationViewAdapter>().As<IApplicationView>().InstancePerDependency();
|
||||
builder.RegisterType<DispatcherTimerAdapter>().As<IDispatcherTimer>().InstancePerDependency();
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<ContentDialog
|
||||
x:Class="FluentTerminal.App.Dialogs.InputDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||
CloseButtonText="Cancel"
|
||||
PrimaryButtonText="OK"
|
||||
mc:Ignorable="d">
|
||||
<TextBox VerticalAlignment="Center" Text="{x:Bind Input, Mode=TwoWay}" />
|
||||
</ContentDialog>
|
||||
@@ -0,0 +1,32 @@
|
||||
using FluentTerminal.App.Services.Dialogs;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using System;
|
||||
|
||||
namespace FluentTerminal.App.Dialogs
|
||||
{
|
||||
public sealed partial class InputDialog : ContentDialog, IInputDialog
|
||||
{
|
||||
public string Input { get; private set; }
|
||||
|
||||
public InputDialog()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
public async Task<string> GetInput()
|
||||
{
|
||||
var result = await ShowAsync();
|
||||
if (result == ContentDialogResult.Primary)
|
||||
{
|
||||
return Input;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void SetTitle(string title)
|
||||
{
|
||||
Title = title;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,6 +125,9 @@
|
||||
<Compile Include="Converters\ToolTipValueToPixelConverter.cs" />
|
||||
<Compile Include="Converters\TrueToVisibleConverter.cs" />
|
||||
<Compile Include="Adapters\MessageDialogAdapter.cs" />
|
||||
<Compile Include="Dialogs\InputDialog.xaml.cs">
|
||||
<DependentUpon>InputDialog.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Dialogs\ShellProfileSelectionDialog.xaml.cs">
|
||||
<DependentUpon>ShellProfileSelectionDialog.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -275,6 +278,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Dialogs\InputDialog.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Dialogs\ShellProfileSelectionDialog.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" IgnorableNamespaces="uap mp desktop rescap">
|
||||
<Identity Name="53621FSApps.FluentTerminal" Publisher="CN=BDC72197-B634-438A-B863-16DCB7D90C85" Version="0.3.0.0" />
|
||||
<Identity Name="53621FSApps.FluentTerminal" Publisher="CN=BDC72197-B634-438A-B863-16DCB7D90C85" Version="0.3.1.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="f7225014-f405-4342-ad2e-ebf6ac60ea2c" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>Fluent Terminal</DisplayName>
|
||||
|
||||
@@ -63,6 +63,12 @@
|
||||
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" />
|
||||
</AppBarButton.Icon>
|
||||
</AppBarButton>
|
||||
<AppBarButton
|
||||
Name="CloneButton"
|
||||
Command="{x:Bind ViewModel.CloneCommand, Mode=OneWay}"
|
||||
CommandParameter="{x:Bind ViewModel.SelectedTheme, Mode=OneWay}"
|
||||
Icon="Copy"
|
||||
Label="Clone" />
|
||||
<AppBarButton
|
||||
Name="EditButton"
|
||||
Command="{x:Bind ViewModel.SelectedTheme.EditCommand, Mode=OneWay}"
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace FluentTerminal.App.Views.SettingsPages
|
||||
SaveButton.RequestedTheme = theme;
|
||||
CancelButton.RequestedTheme = theme;
|
||||
ExportButton.RequestedTheme = theme;
|
||||
CloneButton.RequestedTheme = theme;
|
||||
|
||||
ContrastHelper.SetTitleBarButtonsForTheme(theme);
|
||||
}
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
</ToggleMenuFlyoutItem.Icon>
|
||||
</ToggleMenuFlyoutItem>
|
||||
</MenuFlyoutSubItem>
|
||||
<MenuFlyoutItem Command="{x:Bind EditTitleCommand}" Text="Edit Title" />
|
||||
<MenuFlyoutSeparator />
|
||||
<MenuFlyoutItem Command="{x:Bind CloseCommand}" Text="Close" />
|
||||
</MenuFlyout>
|
||||
@@ -176,7 +177,7 @@
|
||||
<Grid
|
||||
x:Name="CloseButton"
|
||||
Grid.Column="2"
|
||||
Width="32"
|
||||
Width="32"
|
||||
RelativePanel.AlignRightWithPanel="True">
|
||||
<Button
|
||||
HorizontalAlignment="Center"
|
||||
|
||||
Generated
+3
-3
@@ -4305,9 +4305,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"xterm": {
|
||||
"version": "3.9.1",
|
||||
"resolved": "https://registry.npmjs.org/xterm/-/xterm-3.9.1.tgz",
|
||||
"integrity": "sha512-5AZlhP0jvH/Sskx1UvvNFMqDRHVFqapl59rjV3RRpTJmveoharJplxPfzSThk85I4+AZo2xvD0X0nh0AAzkeZQ=="
|
||||
"version": "3.10.1",
|
||||
"resolved": "https://registry.npmjs.org/xterm/-/xterm-3.10.1.tgz",
|
||||
"integrity": "sha512-RHaUwJ8zwLiICu1QsXoxUHP+R2Pp8Rc8yVoNali/nKw3CVXwmXxT/4mgbk7U22psuNgOqLyI4Sg9nlQfYeTRQw=="
|
||||
},
|
||||
"y18n": {
|
||||
"version": "4.0.0",
|
||||
|
||||
@@ -14,6 +14,6 @@
|
||||
"webpack-cli": "^3.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"xterm": "^3.9.1"
|
||||
"xterm": "^3.10.1"
|
||||
}
|
||||
}
|
||||
@@ -84,15 +84,15 @@ function createTerminal(options, theme, keyBindings) {
|
||||
&& keyBinding.shift == e.shiftKey
|
||||
&& keyBinding.key == e.keyCode) {
|
||||
if (document.visibilityState == 'visible') {
|
||||
if (keyBinding.command == 'copy' && term.getSelection() == '') {
|
||||
if (keyBinding.command == 'Copy' && term.getSelection() == '') {
|
||||
return true;
|
||||
}
|
||||
if (keyBinding.command == 'clear') {
|
||||
if (keyBinding.command == 'Clear') {
|
||||
term.clearSelection();
|
||||
term.clear();
|
||||
return false;
|
||||
}
|
||||
if (keyBinding.command == 'selectAll') {
|
||||
if (keyBinding.command == 'SelectAll') {
|
||||
term.selectAll();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,19 @@ namespace FluentTerminal.Models
|
||||
{
|
||||
public class TerminalTheme
|
||||
{
|
||||
public TerminalTheme()
|
||||
{
|
||||
}
|
||||
|
||||
public TerminalTheme(TerminalTheme other)
|
||||
{
|
||||
Id = other.Id;
|
||||
Name = other.Name;
|
||||
Author = other.Author;
|
||||
PreInstalled = other.PreInstalled;
|
||||
Colors = new TerminalColors(other.Colors);
|
||||
}
|
||||
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Author { get; set; }
|
||||
|
||||
Reference in new issue
Block a user