## Summary of the Pull Request Changes the way the `useTabSwitcher` setting works. It now accepts either a boolean or a string: * `true`, `"mru"`: Use the tab switcher with MRU tab switching * `"inOrder"`: Use the tab switcher, with in-order tab switching * `false`, `"disabled"`: Don't use the tab switcher. Tabs will switch in-order. This is following the discussion chronicled in #8025, as well as the follow-up investigation in that thread. ## References * #7952 introduced MRU tab switching ## PR Checklist * [x] Closes #8025 - there's also discussion of using a parameter in an action to override this setting, but that should get punted to a follow-up task * [x] I work here * [x] Tests added/passed - YOU BET THEY WERE * [ ] Requires documentation to be updated ## Validation Steps Performed I've been switching tabs all day and all night, with different settings values, and hot-reloading the setting. I also _ran the test_ I added.
104 lines
4.2 KiB
C++
104 lines
4.2 KiB
C++
/*++
|
|
Copyright (c) Microsoft Corporation
|
|
Licensed under the MIT license.
|
|
|
|
Module Name:
|
|
- GlobalAppSettings.h
|
|
|
|
Abstract:
|
|
- This class encapsulates all of the settings that are global to the app, and
|
|
not a part of any particular profile.
|
|
|
|
Author(s):
|
|
- Mike Griese - March 2019
|
|
|
|
--*/
|
|
#pragma once
|
|
|
|
#include "GlobalAppSettings.g.h"
|
|
#include "IInheritable.h"
|
|
|
|
#include "KeyMapping.h"
|
|
#include "Command.h"
|
|
#include "ColorScheme.h"
|
|
|
|
// fwdecl unittest classes
|
|
namespace SettingsModelLocalTests
|
|
{
|
|
class DeserializationTests;
|
|
class ColorSchemeTests;
|
|
};
|
|
|
|
namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|
{
|
|
struct GlobalAppSettings : GlobalAppSettingsT<GlobalAppSettings>, IInheritable<GlobalAppSettings>
|
|
{
|
|
public:
|
|
GlobalAppSettings();
|
|
void _FinalizeInheritance() override;
|
|
com_ptr<GlobalAppSettings> Copy() const;
|
|
|
|
Windows::Foundation::Collections::IMapView<hstring, Model::ColorScheme> ColorSchemes() noexcept;
|
|
void AddColorScheme(const Model::ColorScheme& scheme);
|
|
|
|
Model::KeyMapping KeyMap() const noexcept;
|
|
|
|
static com_ptr<GlobalAppSettings> FromJson(const Json::Value& json);
|
|
void LayerJson(const Json::Value& json);
|
|
|
|
std::vector<SettingsLoadWarnings> KeybindingsWarnings() const;
|
|
|
|
Windows::Foundation::Collections::IMapView<hstring, Model::Command> Commands() noexcept;
|
|
|
|
// These are implemented manually to handle the string/GUID exchange
|
|
// by higher layers in the app.
|
|
void DefaultProfile(const guid& defaultProfile) noexcept;
|
|
guid DefaultProfile() const;
|
|
bool HasUnparsedDefaultProfile() const;
|
|
winrt::hstring UnparsedDefaultProfile() const;
|
|
void UnparsedDefaultProfile(const hstring& value);
|
|
void ClearUnparsedDefaultProfile();
|
|
|
|
GETSET_SETTING(int32_t, InitialRows, DEFAULT_ROWS);
|
|
GETSET_SETTING(int32_t, InitialCols, DEFAULT_COLS);
|
|
GETSET_SETTING(bool, AlwaysShowTabs, true);
|
|
GETSET_SETTING(bool, ShowTitleInTitlebar, true);
|
|
GETSET_SETTING(bool, ConfirmCloseAllTabs, true);
|
|
GETSET_SETTING(winrt::Windows::UI::Xaml::ElementTheme, Theme, winrt::Windows::UI::Xaml::ElementTheme::Default);
|
|
GETSET_SETTING(winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode, TabWidthMode, winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode::Equal);
|
|
GETSET_SETTING(bool, ShowTabsInTitlebar, true);
|
|
GETSET_SETTING(hstring, WordDelimiters, DEFAULT_WORD_DELIMITERS);
|
|
GETSET_SETTING(bool, CopyOnSelect, false);
|
|
GETSET_SETTING(winrt::Microsoft::Terminal::TerminalControl::CopyFormat, CopyFormatting, 0);
|
|
GETSET_SETTING(bool, WarnAboutLargePaste, true);
|
|
GETSET_SETTING(bool, WarnAboutMultiLinePaste, true);
|
|
GETSET_SETTING(Model::LaunchPosition, InitialPosition, nullptr, nullptr);
|
|
GETSET_SETTING(Model::LaunchMode, LaunchMode, LaunchMode::DefaultMode);
|
|
GETSET_SETTING(bool, SnapToGridOnResize, true);
|
|
GETSET_SETTING(bool, ForceFullRepaintRendering, false);
|
|
GETSET_SETTING(bool, SoftwareRendering, false);
|
|
GETSET_SETTING(bool, ForceVTInput, false);
|
|
GETSET_SETTING(bool, DebugFeaturesEnabled); // default value set in constructor
|
|
GETSET_SETTING(bool, StartOnUserLogin, false);
|
|
GETSET_SETTING(bool, AlwaysOnTop, false);
|
|
GETSET_SETTING(Model::TabSwitcherMode, TabSwitcherMode, Model::TabSwitcherMode::MostRecentlyUsed);
|
|
GETSET_SETTING(bool, DisableAnimations, false);
|
|
|
|
private:
|
|
guid _defaultProfile;
|
|
std::optional<hstring> _UnparsedDefaultProfile{ std::nullopt };
|
|
bool _validDefaultProfile;
|
|
|
|
com_ptr<KeyMapping> _keymap;
|
|
std::vector<SettingsLoadWarnings> _keybindingsWarnings;
|
|
|
|
Windows::Foundation::Collections::IMap<hstring, Model::ColorScheme> _colorSchemes;
|
|
Windows::Foundation::Collections::IMap<hstring, Model::Command> _commands;
|
|
|
|
std::optional<hstring> _getUnparsedDefaultProfileImpl() const;
|
|
|
|
friend class SettingsModelLocalTests::DeserializationTests;
|
|
friend class SettingsModelLocalTests::ColorSchemeTests;
|
|
};
|
|
}
|