Repository: microsoft/terminal (language: cpp)

Issue:
"Always show tabs" doesn't (seem to) do anything when "Hide the title bar" is enabled (the default)
### Windows Terminal version

1.11.3471.0

### Windows build number

10

### Other Software

_No response_

### Steps to reproduce

"Always show tabs" doesn't (seem to) do anything when "Hide the title bar" is enabled (the default), so maybe the option should be grayed out.

![image](https://user-images.githubusercontent.com/2218936/162564818-d61941ef-4646-4de0-865c-cc8d842dde83.png)


### Expected Behavior

"Always show tabs" should be grayed out

### Actual Behavior

"Always show tabs" not grayed out


Discussion / hints:
Thats... probably a good point yea. And probably put it underneath Hide the title bar too, to help show the cause and effect more. Thanks!
Does it even make sense to not hide the title bar?
Meh, some people really like that vintage console look. I'm not one of them, but they do exist 😝 

Fix patch:
diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml
index 53ea257ea68..700cfc61754 100644
--- a/src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml
+++ b/src/cascadia/TerminalSettingsEditor/GlobalAppearance.xaml
@@ -54,12 +54,6 @@
                 </ComboBox>
             </local:SettingContainer>
 
-            <!--  Always show tabs  -->
-            <local:SettingContainer x:Uid="Globals_AlwaysShowTabs">
-                <ToggleSwitch IsOn="{x:Bind ViewModel.AlwaysShowTabs, Mode=TwoWay}"
-                              Style="{StaticResource ToggleSwitchInExpanderStyle}" />
-            </local:SettingContainer>
-
             <!--  Position of new tab  -->
             <local:SettingContainer x:Uid="Globals_NewTabPosition">
                 <ComboBox AutomationProperties.AccessibilityView="Content"
@@ -72,6 +66,14 @@
             <!--  Show Titlebar  -->
             <local:SettingContainer x:Uid="Globals_ShowTitlebar">
                 <ToggleSwitch IsOn="{x:Bind ViewModel.ShowTabsInTitlebar, Mode=TwoWay}"
+                              Style="{StaticResource ToggleSwitchInExpanderStyle}"
+                              Toggled="{x:Bind ViewModel.ShowTitlebarToggled}" />
+            </local:SettingContainer>
+
+            <!--  Always show tabs  -->
+            <local:SettingContainer x:Uid="Globals_AlwaysShowTabs">
+                <ToggleSwitch IsEnabled="{x:Bind local:Converters.InvertBoolean(ViewModel.ShowTabsInTitlebar), Mode=OneWay}"
+                              IsOn="{x:Bind ViewModel.AlwaysShowTabs, Mode=TwoWay}"
                               Style="{StaticResource ToggleSwitchInExpanderStyle}" />
             </local:SettingContainer>
 
diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.cpp b/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.cpp
index 072a7f83501..f0509f1f871 100644
--- a/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.cpp
+++ b/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.cpp
@@ -260,4 +260,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
     {
         _GlobalSettings.DisableAnimations(!value);
     }
+
+    void GlobalAppearanceViewModel::ShowTitlebarToggled(const winrt::Windows::Foundation::IInspectable& /* sender */, const RoutedEventArgs& /* args */)
+    {
+        // Set AlwaysShowTabs to true if ShowTabsInTitlebar was toggled OFF -> ON
+        if (!ShowTabsInTitlebar())
+        {
+            AlwaysShowTabs(true);
+        }
+    }
 }
diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.h b/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.h
index 3826afcb1eb..71c40dc6e96 100644
--- a/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.h
+++ b/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.h
@@ -37,6 +37,8 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
         bool InvertedDisableAnimations();
         void InvertedDisableAnimations(bool value);
 
+        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, ShowTabsInTitlebar);
         PERMANENT_OBSERVABLE_PROJECTED_SETTING(_GlobalSettings, UseAcrylicInTabRow);
diff --git a/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.idl b/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.idl
index 06053e7e528..8dd700edc3d 100644
--- a/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.idl
+++ b/src/cascadia/TerminalSettingsEditor/GlobalAppearanceViewModel.idl
@@ -28,6 +28,8 @@ namespace Microsoft.Terminal.Settings.Editor
 
         Boolean InvertedDisableAnimations;
 
+        void ShowTitlebarToggled(IInspectable sender, Windows.UI.Xaml.RoutedEventArgs args);
+
         PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, AlwaysShowTabs);
         PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, ShowTabsInTitlebar);
         PERMANENT_OBSERVABLE_PROJECTED_SETTING(Boolean, UseAcrylicInTabRow);


Test patch: