public AboutDialog(ISettingsService settingsService, IUpdateService updateService)
        {
            this.InitializeComponent();
            var currentTheme = settingsService.GetCurrentTheme();

            RequestedTheme = ContrastHelper.GetIdealThemeForBackgroundColor(currentTheme.Colors.Background);

            CreatedBy.Inlines.Add(new Run {
                Text = "Created by "
            });
            CreatedBy.Inlines.Add(new Italic {
                Inlines = { new Run {
                                Text = "felixse "
                            } }
            });
            CreatedBy.Inlines.Add(new Run {
                Text = "and "
            });
            CreatedBy.Inlines.Add(new Hyperlink {
                Inlines = { new Run {
                                Text = "contributors"
                            } }, NavigateUri = new Uri("https://github.com/felixse/FluentTerminal/graphs/contributors")
            });

            CurrentVersion.Text = updateService.GetCurrentVersion().ToString();
            ReleaseNotesHyperlink.NavigateUri = new Uri("https://github.com/felixse/FluentTerminal/releases/tag/" + CurrentVersion.Text);
        }
Ejemplo n.º 2
0
        public SshInfoDialog(ISettingsService settingsService, ISshHelperService sshHelperService,
                             ITrayProcessCommunicationService trayProcessCommunicationService)
        {
            _sshHelperService = sshHelperService;
            _trayProcessCommunicationService = trayProcessCommunicationService;
            InitializeComponent();
            PrimaryButtonText   = I18N.Translate("OK");
            SecondaryButtonText = I18N.Translate("Cancel");
            var currentTheme = settingsService.GetCurrentTheme();

            RequestedTheme = ContrastHelper.GetIdealThemeForBackgroundColor(currentTheme.Colors.Background);

            TabThemes = new ObservableCollection <TabTheme>(settingsService.GetTabThemes());

            TerminalThemes = new ObservableCollection <TerminalTheme>
            {
                new TerminalTheme
                {
                    Id   = Guid.Empty,
                    Name = "Default"
                }
            };
            foreach (var theme in settingsService.GetThemes())
            {
                TerminalThemes.Add(theme);
            }
        }
Ejemplo n.º 3
0
        public SshInfoDialog(ISettingsService settingsService)
        {
            InitializeComponent();
            var currentTheme = settingsService.GetCurrentTheme();

            RequestedTheme = ContrastHelper.GetIdealThemeForBackgroundColor(currentTheme.Colors.Background);
        }
        private void OnSelectedThemeBackgroundColorChanged(object sender, string e)
        {
            var theme = ContrastHelper.GetIdealThemeForBackgroundColor(e);

            SetTheme(theme);

            SetGridBackground(e, ViewModel.SelectedTheme.BackgroundThemeFile);
        }
        public ShellProfileSelectionDialog(ISettingsService settingsService)
        {
            Profiles        = settingsService.GetShellProfiles();
            SelectedProfile = Profiles.First();
            this.InitializeComponent();
            var currentTheme = settingsService.GetCurrentTheme();

            RequestedTheme = ContrastHelper.GetIdealThemeForBackgroundColor(currentTheme.Colors.Background);
        }
Ejemplo n.º 6
0
        public InputDialog(ISettingsService settingsService)
        {
            this.InitializeComponent();
            this.PrimaryButtonText = I18N.Translate("OK");
            this.CloseButtonText   = I18N.Translate("Cancel");
            var currentTheme = settingsService.GetCurrentTheme();

            RequestedTheme = ContrastHelper.GetIdealThemeForBackgroundColor(currentTheme.Colors.Background);
        }
Ejemplo n.º 7
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (e.Parameter is ThemesPageViewModel viewModel)
     {
         ViewModel = viewModel;
         viewModel.SelectedThemeBackgroundColorChanged += OnSelectedThemeBackgroundColorChanged;
         var theme = ContrastHelper.GetIdealThemeForBackgroundColor(ViewModel.SelectedTheme.Background);
         SetTheme(theme);
     }
 }
Ejemplo n.º 8
0
        public SshInfoDialog(ISettingsService settingsService, ISshHelperService sshHelperService,
                             ITrayProcessCommunicationService trayProcessCommunicationService)
        {
            _sshHelperService = sshHelperService;
            _trayProcessCommunicationService = trayProcessCommunicationService;
            InitializeComponent();
            PrimaryButtonText   = I18N.Translate("OK");
            SecondaryButtonText = I18N.Translate("Cancel");
            var currentTheme = settingsService.GetCurrentTheme();

            RequestedTheme = ContrastHelper.GetIdealThemeForBackgroundColor(currentTheme.Colors.Background);
        }
        public ShellProfileSelectionDialog(ISettingsService settingsService)
        {
            Profiles = new ObservableCollection <ShellProfile>(settingsService.GetAllProfiles().OrderBy(p => p.Name));

            SelectedProfile = Profiles.First();

            InitializeComponent();

            PrimaryButtonText   = I18N.TranslateWithFallback("OK", "OK");
            SecondaryButtonText = I18N.TranslateWithFallback("Cancel", "Cancel");

            var currentTheme = settingsService.GetCurrentTheme();

            RequestedTheme = ContrastHelper.GetIdealThemeForBackgroundColor(currentTheme.Colors.Background);
        }
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            Color color;

            if (value is string colorString)
            {
                color = colorString.ToColor();
            }
            else if (value is Color)
            {
                color = (Color)value;
            }

            return(ContrastHelper.GetIdealThemeForBackgroundColor(color));
        }
        public CustomCommandDialog(ISettingsService settingsService, IApplicationView applicationView,
                                   ITrayProcessCommunicationService trayProcessCommunicationService, ApplicationDataContainers containers)
        {
            _settingsService = settingsService;
            _applicationView = applicationView;
            _trayProcessCommunicationService = trayProcessCommunicationService;
            _historyContainer = containers.HistoryContainer;

            InitializeComponent();

            PrimaryButtonText   = I18N.Translate("OK");
            SecondaryButtonText = I18N.Translate("Cancel");

            var currentTheme = settingsService.GetCurrentTheme();

            RequestedTheme = ContrastHelper.GetIdealThemeForBackgroundColor(currentTheme.Colors.Background);
        }
Ejemplo n.º 12
0
        public SshProfileSelectionDialog(ISettingsService settingsService, IDialogService dialogService)
        {
            _dialogService = dialogService;
            Profiles       = new ObservableCollection <SshProfile>(settingsService.GetSshProfiles().OrderBy(p => p.Name));

            var selectedProfile = settingsService.GetDefaultSshProfile();

            if (selectedProfile != null)
            {
                selectedProfile = Profiles.FirstOrDefault(p => p.Id.Equals(selectedProfile.Id));
            }

            SelectedProfile = selectedProfile ?? Profiles.FirstOrDefault();

            this.InitializeComponent();
            var currentTheme = settingsService.GetCurrentTheme();

            RequestedTheme = ContrastHelper.GetIdealThemeForBackgroundColor(currentTheme.Colors.Background);
        }
Ejemplo n.º 13
0
        public SshInfoDialog(ISettingsService settingsService, IApplicationView applicationView,
                             IFileSystemService fileSystemService, ITrayProcessCommunicationService trayProcessCommunicationService)
        {
            _settingsService   = settingsService;
            _applicationView   = applicationView;
            _fileSystemService = fileSystemService;
            _trayProcessCommunicationService = trayProcessCommunicationService;

            InitializeComponent();

            BrowseIdentityFileCommand = new AsyncCommand(BrowseIdentityFile);
            SaveLinkCommand           = new AsyncCommand(SaveLink);

            PrimaryButtonText   = I18N.Translate("OK");
            SecondaryButtonText = I18N.Translate("Cancel");

            var currentTheme = settingsService.GetCurrentTheme();

            RequestedTheme = ContrastHelper.GetIdealThemeForBackgroundColor(currentTheme.Colors.Background);
        }
Ejemplo n.º 14
0
        private void OnSelectedThemeBackgroundColorChanged(object sender, Color e)
        {
            var theme = ContrastHelper.GetIdealThemeForBackgroundColor(e);

            SetTheme(theme);
        }