Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tab color indicator for tab switch menu (CTRL+Tab) #17820

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/cascadia/TerminalApp/CommandPalette.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@
Visibility="{x:Bind Item.(local:TabPaletteItem.TabStatus).IsInputBroadcastActive, Mode=OneWay}" />

</StackPanel>

<Ellipse Grid.Column="4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly worried that this will overlap with the scrollbar on the tab picker if there's a lot of tabs. Who knows - maybe that column was vestigial?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It kind of overlaps, but it doesn't seem like a big problem to me 😅

resim

Width="8"
Height="8"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Fill="{x:Bind mtu:Converters.ColorToBrush(Item.(local:TabPaletteItem.TabStatus).TabColorIndicator), Mode=OneWay}" />
</Grid>
</DataTemplate>

Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/TerminalApp/TerminalTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,7 @@ namespace winrt::TerminalApp::implementation
// active control in this tab. We'll just recalculate the
// current color anyways.
tab->_RecalculateAndApplyTabColor();
tab->_tabStatus.TabColorIndicator(tab->GetTabColor().value_or(Windows::UI::Colors::Transparent()));
}
});

Expand Down Expand Up @@ -1617,6 +1618,7 @@ namespace winrt::TerminalApp::implementation

_runtimeTabColor.emplace(color);
_RecalculateAndApplyTabColor();
_tabStatus.TabColorIndicator(color);
}

// Method Description:
Expand All @@ -1633,6 +1635,7 @@ namespace winrt::TerminalApp::implementation

_runtimeTabColor.reset();
_RecalculateAndApplyTabColor();
_tabStatus.TabColorIndicator(GetTabColor().value_or(Windows::UI::Colors::Transparent()));
}

winrt::Windows::UI::Xaml::Media::Brush TerminalTab::_BackgroundBrush()
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalApp/TerminalTabStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace winrt::TerminalApp::implementation
WINRT_OBSERVABLE_PROPERTY(bool, IsReadOnlyActive, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(uint32_t, ProgressValue, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(bool, IsInputBroadcastActive, PropertyChanged.raise);
WINRT_OBSERVABLE_PROPERTY(winrt::Windows::UI::Color, TabColorIndicator, PropertyChanged.raise);
};
}

Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalApp/TerminalTabStatus.idl
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ namespace TerminalApp
UInt32 ProgressValue { get; set; };
Boolean IsReadOnlyActive { get; set; };
Boolean IsInputBroadcastActive { get; set; };
Windows.UI.Color TabColorIndicator { get; set; };
}
}
1 change: 1 addition & 0 deletions src/cascadia/TerminalApp/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <winrt/Windows.UI.Xaml.Automation.Peers.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
#include <winrt/Windows.UI.Xaml.Shapes.h>
#include <winrt/Windows.UI.Xaml.Data.h>
#include <winrt/Windows.UI.Xaml.Documents.h>
#include <winrt/Windows.UI.Xaml.Input.h>
Expand Down
Loading