Added option to change the title of a tab

This commit is contained in:
FelixSe committed 2019-01-07 22:35:14 +01:00
1 parent 3cf3e0a330
commit d4aadd7dd4
9 files changed
+89 -2

No files matched your search

@@ -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)