Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/llm
Browse files Browse the repository at this point in the history
  • Loading branch information
consvc committed Jan 31, 2025
2 parents 6eeeeff + d6b56ae commit ec2e2f2
Show file tree
Hide file tree
Showing 35 changed files with 187 additions and 15 deletions.
5 changes: 5 additions & 0 deletions doc/cascadia/profiles.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2533,6 +2533,11 @@
"description": "When set to true, the Terminal's tab row will display a shield icon when the Terminal is running with administrator privileges",
"type": "boolean"
},
"showTabsFullscreen": {
"default": false,
"description": "When set to true, tabs remain visible in fullscreen mode. When set to false, tabs will be hidden when entering fullscreen mode.",
"type": "boolean"
},
"useAcrylicInTabRow": {
"default": false,
"description": "When set to true, the tab row will have an acrylic material background with 50% opacity.",
Expand Down
10 changes: 6 additions & 4 deletions src/cascadia/TerminalApp/TabManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,12 @@ namespace winrt::TerminalApp::implementation
// - Handle changes in tab layout.
void TerminalPage::_UpdateTabView()
{
// Never show the tab row when we're fullscreen. Otherwise:
// Show tabs when there's more than 1, or the user has chosen to always
// show the tab bar.
const auto isVisible = (!_isFullscreen && !_isInFocusMode) &&
// The tab row should only be visible if:
// - we're not in focus mode
// - we're not in full screen, or the user has enabled fullscreen tabs
// - there is more than one tab, or the user has chosen to always show tabs
const auto isVisible = !_isInFocusMode &&
(!_isFullscreen || _showTabsFullscreen) &&
(_settings.GlobalSettings().ShowTabsInTitlebar() ||
(_tabs.Size() > 1) ||
_settings.GlobalSettings().AlwaysShowTabs());
Expand Down
34 changes: 34 additions & 0 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ namespace winrt::TerminalApp::implementation
_layoutUpdatedRevoker = _tabContent.LayoutUpdated(winrt::auto_revoke, { this, &TerminalPage::_OnFirstLayout });

_isAlwaysOnTop = _settings.GlobalSettings().AlwaysOnTop();
_showTabsFullscreen = _settings.GlobalSettings().ShowTabsFullscreen();

// DON'T set up Toasts/TeachingTips here. They should be loaded and
// initialized the first time they're opened, in whatever method opens
Expand Down Expand Up @@ -3800,6 +3801,8 @@ namespace winrt::TerminalApp::implementation
_isAlwaysOnTop = _settings.GlobalSettings().AlwaysOnTop();
AlwaysOnTopChanged.raise(*this, nullptr);

_showTabsFullscreen = _settings.GlobalSettings().ShowTabsFullscreen();

// Settings AllowDependentAnimations will affect whether animations are
// enabled application-wide, so we don't need to check it each time we
// want to create an animation.
Expand Down Expand Up @@ -4224,6 +4227,37 @@ namespace winrt::TerminalApp::implementation
return _isAlwaysOnTop;
}

// Method Description:
// - Returns true if the tab row should be visible when we're in full screen
// state.
// Arguments:
// - <none>
// Return Value:
// - true if the tab row should be visible in full screen state
bool TerminalPage::ShowTabsFullscreen() const
{
return _showTabsFullscreen;
}

// Method Description:
// - Updates the visibility of the tab row when in fullscreen state.
void TerminalPage::SetShowTabsFullscreen(bool newShowTabsFullscreen)
{
if (_showTabsFullscreen == newShowTabsFullscreen)
{
return;
}

_showTabsFullscreen = newShowTabsFullscreen;

// if we're currently in fullscreen, update tab view to make
// sure tabs are given the correct visibility
if (_isFullscreen)
{
_UpdateTabView();
}
}

void TerminalPage::SetFullscreen(bool newFullscreen)
{
if (_isFullscreen == newFullscreen)
Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/TerminalApp/TerminalPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ namespace winrt::TerminalApp::implementation
bool FocusMode() const;
bool Fullscreen() const;
bool AlwaysOnTop() const;
bool ShowTabsFullscreen() const;
void SetShowTabsFullscreen(bool newShowTabsFullscreen);
void SetFullscreen(bool);
void SetFocusMode(const bool inFocusMode);
void Maximized(bool newMaximized);
Expand Down Expand Up @@ -230,6 +232,7 @@ namespace winrt::TerminalApp::implementation
bool _isFullscreen{ false };
bool _isMaximized{ false };
bool _isAlwaysOnTop{ false };
bool _showTabsFullscreen{ false };

std::optional<uint32_t> _loadFromPersistedLayoutIdx{};

Expand Down
10 changes: 10 additions & 0 deletions src/cascadia/TerminalApp/TerminalWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ namespace winrt::TerminalApp::implementation
return _settings.GlobalSettings().AlwaysOnTop();
}

bool TerminalWindow::GetInitialShowTabsFullscreen()
{
return _settings.GlobalSettings().ShowTabsFullscreen();
}

bool TerminalWindow::GetMinimizeToNotificationArea()
{
return _settings.GlobalSettings().MinimizeToNotificationArea();
Expand Down Expand Up @@ -981,6 +986,11 @@ namespace winrt::TerminalApp::implementation
return _root ? _root->AlwaysOnTop() : false;
}

bool TerminalWindow::ShowTabsFullscreen() const
{
return _root ? _root->ShowTabsFullscreen() : false;
}

void TerminalWindow::SetSettingsStartupArgs(const std::vector<ActionAndArgs>& actions)
{
for (const auto& action : actions)
Expand Down
2 changes: 2 additions & 0 deletions src/cascadia/TerminalApp/TerminalWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ namespace winrt::TerminalApp::implementation
bool Fullscreen() const;
void Maximized(bool newMaximized);
bool AlwaysOnTop() const;
bool ShowTabsFullscreen() const;
bool AutoHideWindow();
void IdentifyWindow();

Expand All @@ -106,6 +107,7 @@ namespace winrt::TerminalApp::implementation
Microsoft::Terminal::Settings::Model::LaunchMode GetLaunchMode();
bool GetShowTabsInTitlebar();
bool GetInitialAlwaysOnTop();
bool GetInitialShowTabsFullscreen();
float CalcSnappedDimension(const bool widthOrHeight, const float dimension) const;

Windows::UI::Xaml::UIElement GetRoot() noexcept;
Expand Down
2 changes: 2 additions & 0 deletions src/cascadia/TerminalApp/TerminalWindow.idl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ namespace TerminalApp
void Maximized(Boolean newMaximized);
Boolean AlwaysOnTop { get; };
Boolean AutoHideWindow { get; };
Boolean ShowTabsFullscreen { get; };

void IdentifyWindow();
void SetPersistedLayoutIdx(UInt32 idx);
Expand All @@ -82,6 +83,7 @@ namespace TerminalApp
Microsoft.Terminal.Settings.Model.LaunchMode GetLaunchMode();
Boolean GetShowTabsInTitlebar();
Boolean GetInitialAlwaysOnTop();
Boolean GetInitialShowTabsFullscreen();
Single CalcSnappedDimension(Boolean widthOrHeight, Single dimension);
void TitlebarClicked();
void CloseWindow();
Expand Down
7 changes: 7 additions & 0 deletions src/cascadia/TerminalApp/TitlebarControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#include "TitlebarControl.g.cpp"

using namespace winrt::Windows::UI::Xaml;

namespace winrt::TerminalApp::implementation
{
TitlebarControl::TitlebarControl(uint64_t handle) :
Expand Down Expand Up @@ -77,6 +79,11 @@ namespace winrt::TerminalApp::implementation
}
}

void TitlebarControl::FullscreenChanged(const bool fullscreen)
{
MinMaxCloseControl().Visibility(fullscreen ? Visibility::Collapsed : Visibility::Visible);
}

void TitlebarControl::_OnMaximizeOrRestore(byte flag)
{
POINT point1 = {};
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalApp/TitlebarControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace winrt::TerminalApp::implementation

void SetWindowVisualState(WindowVisualState visualState);
void Root_SizeChanged(const IInspectable& sender, const Windows::UI::Xaml::SizeChangedEventArgs& e);
void FullscreenChanged(const bool fullscreen);

void Minimize_Click(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::RoutedEventArgs& e);
void Maximize_Click(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::RoutedEventArgs& e);
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalApp/TitlebarControl.idl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace TerminalApp
{
TitlebarControl(UInt64 parentWindowHandle);
void SetWindowVisualState(WindowVisualState visualState);
void FullscreenChanged(Boolean fullscreen);

void HoverButton(CaptionButton button);
void PressButton(CaptionButton button);
Expand Down
4 changes: 2 additions & 2 deletions src/cascadia/TerminalSettingsEditor/Appearances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
else
{
// Append vertical alignment to the resource key
switch (alignment & static_cast<ConvergedAlignment>(0x0F))
switch (alignment & static_cast<ConvergedAlignment>(0xF0))
{
case ConvergedAlignment::Vertical_Bottom:
alignmentResourceKey = alignmentResourceKey + L"Bottom";
Expand All @@ -938,7 +938,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
}

// Append horizontal alignment to the resource key
switch (alignment & static_cast<ConvergedAlignment>(0xF0))
switch (alignment & static_cast<ConvergedAlignment>(0x0F))
{
case ConvergedAlignment::Horizontal_Left:
alignmentResourceKey = alignmentResourceKey + L"Left";
Expand Down
6 changes: 6 additions & 0 deletions src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>

<!-- Show tabs in full screen -->
<local:SettingContainer x:Uid="Globals_ShowTabsFullscreen">
<ToggleSwitch IsOn="{x:Bind ViewModel.ShowTabsFullscreen, Mode=TwoWay}"
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
</local:SettingContainer>

<!-- Show Acrylic in Tab Row -->
<local:SettingContainer x:Uid="Globals_AcrylicTabRow">
<ToggleSwitch IsOn="{x:Bind ViewModel.UseAcrylicInTabRow, Mode=TwoWay}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
void ShowTitlebarToggled(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::RoutedEventArgs& args);

PERMANENT_OBSERVABLE_PROJECTED_SETTING(_GlobalSettings, AlwaysShowTabs);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(_GlobalSettings, ShowTabsFullscreen);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(_GlobalSettings, ShowTabsInTitlebar);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(_GlobalSettings, UseAcrylicInTabRow);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(_GlobalSettings, ShowTitleInTitlebar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace Microsoft.Terminal.Settings.Editor
void ShowTitlebarToggled(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args);

PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, AlwaysShowTabs);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ShowTabsFullscreen);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ShowTabsInTitlebar);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, UseAcrylicInTabRow);
PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ShowTitleInTitlebar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@
<value>DECRQCRA zulassen (Prüfsumme des rechteckigen Bereichs anfordern, Request Checksum of Rectangular Area)</value>
<comment>{Locked="DECRQCRA"}{Locked="Request Checksum of Rectangular Area"}Header for a control to toggle support for the DECRQCRA control sequence.</comment>
</data>
<data name="Profile_AllowVtClipboardWrite.Header" xml:space="preserve">
<value>Schreiben in die Zwischenablage durch OSC 52 (Manipulate Selection Data) zulassen</value>
<comment>{Locked="OSC 52"}{Locked="Manipulate Selection Data"}Header for a control to toggle support for applications to change the contents of the Windows system clipboard.</comment>
</data>
<data name="Globals_AllowHeadless.Header" xml:space="preserve">
<value>Ausführung von Windows Terminal im Hintergrund zulassen</value>
<comment>Header for a control to toggle support for Windows Terminal to run in the background.</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2444,6 +2444,14 @@
<value>Display a shield in the title bar when Windows Terminal is running as Administrator</value>
<comment>Header for a control to toggle displaying a shield in the title bar of the app. "Admin" refers to elevated sessions like "run as Admin"</comment>
</data>
<data name="Globals_ShowTabsFullscreen.Header" xml:space="preserve">
<value>Show tabs in full screen</value>
<comment>Header for a control to toggle if the app should show the tabs when in full screen state.</comment>
</data>
<data name="Globals_ShowTabsFullscreen.HelpText" xml:space="preserve">
<value>When enabled, the tab bar will be visible when the app is full screen.</value>
<comment>A description for what the "show tabs in full screen" setting does.</comment>
</data>
<data name="Profile_PathTranslationStyle.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Path translation</value>
<comment>Name for a control to select how file and directory paths are translated.</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@
<value>Permitir DECRQCRA (Request Checksum of Rectangular Area)</value>
<comment>{Locked="DECRQCRA"}{Locked="Request Checksum of Rectangular Area"}Header for a control to toggle support for the DECRQCRA control sequence.</comment>
</data>
<data name="Profile_AllowVtClipboardWrite.Header" xml:space="preserve">
<value>Permitir que OSC 52 (Manipulate Selection Data) escriban en el Portapapeles</value>
<comment>{Locked="OSC 52"}{Locked="Manipulate Selection Data"}Header for a control to toggle support for applications to change the contents of the Windows system clipboard.</comment>
</data>
<data name="Globals_AllowHeadless.Header" xml:space="preserve">
<value>Permitir que Terminal Windows se ejecuten en segundo plano</value>
<comment>Header for a control to toggle support for Windows Terminal to run in the background.</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@
<value>Autoriser les DECRQCRA (Request Checksum of Rectangular Area)</value>
<comment>{Locked="DECRQCRA"}{Locked="Request Checksum of Rectangular Area"}Header for a control to toggle support for the DECRQCRA control sequence.</comment>
</data>
<data name="Profile_AllowVtClipboardWrite.Header" xml:space="preserve">
<value>Autoriser OSC 52 (Manipulate Selection Data) à écrire dans le Presse-papiers</value>
<comment>{Locked="OSC 52"}{Locked="Manipulate Selection Data"}Header for a control to toggle support for applications to change the contents of the Windows system clipboard.</comment>
</data>
<data name="Globals_AllowHeadless.Header" xml:space="preserve">
<value>Autoriser Terminal Windows à s’exécuter en arrière-plan</value>
<comment>Header for a control to toggle support for Windows Terminal to run in the background.</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@
<value>Consenti DECRQCRA (Request Checksum of Rectangular Area)</value>
<comment>{Locked="DECRQCRA"}{Locked="Request Checksum of Rectangular Area"}Header for a control to toggle support for the DECRQCRA control sequence.</comment>
</data>
<data name="Profile_AllowVtClipboardWrite.Header" xml:space="preserve">
<value>Consenti OSC 52 (Manipulate Selection Data) di scrivere negli Appunti</value>
<comment>{Locked="OSC 52"}{Locked="Manipulate Selection Data"}Header for a control to toggle support for applications to change the contents of the Windows system clipboard.</comment>
</data>
<data name="Globals_AllowHeadless.Header" xml:space="preserve">
<value>Consenti l'esecuzione di Terminale Windows in background</value>
<comment>Header for a control to toggle support for Windows Terminal to run in the background.</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@
<value>DECRQCRA を許可する (Request Checksum of Rectangular Area)</value>
<comment>{Locked="DECRQCRA"}{Locked="Request Checksum of Rectangular Area"}Header for a control to toggle support for the DECRQCRA control sequence.</comment>
</data>
<data name="Profile_AllowVtClipboardWrite.Header" xml:space="preserve">
<value>OSC 52 (Manipulate Selection Data) を使用したクリップボードへの書き込みを許可する</value>
<comment>{Locked="OSC 52"}{Locked="Manipulate Selection Data"}Header for a control to toggle support for applications to change the contents of the Windows system clipboard.</comment>
</data>
<data name="Globals_AllowHeadless.Header" xml:space="preserve">
<value>Windows ターミナルのバックグラウンドでの実行を許可する</value>
<comment>Header for a control to toggle support for Windows Terminal to run in the background.</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@
<value>DECRQCRA 허용(Request Checksum of Rectangular Area)</value>
<comment>{Locked="DECRQCRA"}{Locked="Request Checksum of Rectangular Area"}Header for a control to toggle support for the DECRQCRA control sequence.</comment>
</data>
<data name="Profile_AllowVtClipboardWrite.Header" xml:space="preserve">
<value>OSC 52(Manipulate Selection Data)가 클립보드에 쓸 수 있도록 허용</value>
<comment>{Locked="OSC 52"}{Locked="Manipulate Selection Data"}Header for a control to toggle support for applications to change the contents of the Windows system clipboard.</comment>
</data>
<data name="Globals_AllowHeadless.Header" xml:space="preserve">
<value>Windows 터미널 백그라운드에서 실행하도록 허용</value>
<comment>Header for a control to toggle support for Windows Terminal to run in the background.</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@
<value>Permitir DECRQCRA (Request Checksum of Rectangular Area)</value>
<comment>{Locked="DECRQCRA"}{Locked="Request Checksum of Rectangular Area"}Header for a control to toggle support for the DECRQCRA control sequence.</comment>
</data>
<data name="Profile_AllowVtClipboardWrite.Header" xml:space="preserve">
<value>Permitir OSC 52 (Manipulate Selection Data) para gravar na área de transferência</value>
<comment>{Locked="OSC 52"}{Locked="Manipulate Selection Data"}Header for a control to toggle support for applications to change the contents of the Windows system clipboard.</comment>
</data>
<data name="Globals_AllowHeadless.Header" xml:space="preserve">
<value>Permitir Terminal do Windows ser executado em segundo plano</value>
<comment>Header for a control to toggle support for Windows Terminal to run in the background.</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@
<value>Àłℓöω DECRQCRA (Request Checksum of Rectangular Area) !!! !!! !!! !!! !!! </value>
<comment>{Locked="DECRQCRA"}{Locked="Request Checksum of Rectangular Area"}Header for a control to toggle support for the DECRQCRA control sequence.</comment>
</data>
<data name="Profile_AllowVtClipboardWrite.Header" xml:space="preserve">
<value>Ãľļōẅ OSC 52 (Manipulate Selection Data) ŧõ щѓιţе ŧő тĥē ćℓįрвöăѓđ !!! !!! !!! !!! !!! !!! !</value>
<comment>{Locked="OSC 52"}{Locked="Manipulate Selection Data"}Header for a control to toggle support for applications to change the contents of the Windows system clipboard.</comment>
</data>
<data name="Globals_AllowHeadless.Header" xml:space="preserve">
<value>Ǻℓĺŏщ Ẁιйđòώѕ Тёŗмїⁿàļ тǿ řϋŋ ϊň тђě ьąςќġѓőůήď !!! !!! !!! !!! !!</value>
<comment>Header for a control to toggle support for Windows Terminal to run in the background.</comment>
Expand Down
Loading

0 comments on commit ec2e2f2

Please sign in to comment.