Skip to content

Commit d7a6b18

Browse files
committed
re-add the visibility hack; add a play button that does nothing
1 parent 365c068 commit d7a6b18

File tree

3 files changed

+14
-27
lines changed

3 files changed

+14
-27
lines changed

src/cascadia/TerminalApp/TasksPaneContent.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ namespace winrt::TerminalApp::implementation
4040
// UpdateSettings(settings);
4141
}
4242

43-
4443
MUX::Controls::TreeViewNode _buildTreeViewNode(const Model::Command& task)
4544
{
4645
MUX::Controls::TreeViewNode item{};
@@ -74,22 +73,6 @@ namespace winrt::TerminalApp::implementation
7473
_treeView().ItemsSource(itemSource);
7574
}
7675

77-
void TasksPaneContent::_containerContentChanging(
78-
const Windows::UI::Xaml::Controls::ListViewBase& /*sender*/,
79-
const Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs& args)
80-
{
81-
const auto itemContainer = args.ItemContainer();
82-
if (args.InRecycleQueue() && itemContainer && itemContainer.ContentTemplate())
83-
{
84-
// _listViewItemsCache[itemContainer.ContentTemplate()].insert(itemContainer);
85-
itemContainer.DataContext(nullptr);
86-
}
87-
else
88-
{
89-
itemContainer.DataContext(args.Item());
90-
}
91-
}
92-
9376
winrt::Windows::UI::Xaml::FrameworkElement TasksPaneContent::GetRoot()
9477
{
9578
return *this;

src/cascadia/TerminalApp/TasksPaneContent.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,14 @@ namespace winrt::TerminalApp::implementation
3939

4040
private:
4141
friend struct TasksPaneContentT<TasksPaneContent>; // for Xaml to bind events
42-
43-
// winrt::Windows::UI::Xaml::Controls::Grid _root{ nullptr };
44-
// winrt::Microsoft::UI::Xaml::Controls::TreeView _treeView{ nullptr };
45-
46-
void _containerContentChanging(const Windows::UI::Xaml::Controls::ListViewBase& sender, const Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs& args);
4742
};
4843

4944
struct TaskViewModel : TaskViewModelT<TaskViewModel>
5045
{
5146
TaskViewModel(const winrt::Microsoft::Terminal::Settings::Model::Command& command) :
5247
_command{ command }
5348
{
49+
// The Children() method must always return a non-null vector
5450
_children = winrt::single_threaded_observable_vector<TerminalApp::TaskViewModel>();
5551
if (_command.HasNestedCommands())
5652
{

src/cascadia/TerminalApp/TasksPaneContent.xaml

+13-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
</DataTemplate>
3333
<DataTemplate x:Key="TaskItemTemplate"
3434
x:DataType="local:TaskViewModel">
35-
<mux:TreeViewItem ItemsSource="{x:Bind Children}">
35+
<mux:TreeViewItem x:Name="rootItem"
36+
ItemsSource="{x:Bind Children}">
3637
<Grid>
3738
<Grid.RowDefinitions>
3839
<RowDefinition Height="*" />
@@ -56,6 +57,12 @@
5657
VerticalAlignment="Center"
5758
HorizontalAlignment="Center"
5859
Fill="{ThemeResource SystemControlBackgroundBaseMediumBrush}"/>-->
60+
<Button Grid.Row="0"
61+
Grid.Column="0">
62+
<FontIcon FontFamily="Segoe Fluent Icons, Segoe MDL2 Assets"
63+
FontSize="12"
64+
Glyph="&#xE768;" />
65+
</Button>
5966
<TextBlock Grid.Column="1"
6067
Margin="12,6,0,0"
6168
Style="{ThemeResource BaseTextBlockStyle}"
@@ -65,14 +72,15 @@
6572
Margin="12,0,0,6"
6673
MaxLines="1"
6774
Style="{ThemeResource BodyTextBlockStyle}"
68-
Text="{x:Bind Input}" />
75+
Text="{x:Bind Input}"
76+
Visibility="{Binding ElementName=rootItem, Path=IsSelected}" />
6977
</Grid>
7078
</mux:TreeViewItem>
7179
</DataTemplate>
7280
</ResourceDictionary>
7381
</UserControl.Resources>
7482

75-
<Grid Background="Red">
83+
<Grid>
7684
<Grid.RowDefinitions>
7785
<RowDefinition Height="Auto" />
7886
<RowDefinition Height="Auto" />
@@ -87,11 +95,11 @@
8795

8896
<TextBox x:Name="_filterBox"
8997
Grid.Row="1"
90-
Margin="8" />
98+
Margin="8"
99+
PlaceholderText="Filter tasks..." />
91100

92101
<mux:TreeView x:Name="_treeView"
93102
Grid.Row="2"
94-
Background="Blue"
95103
CanDragItems="False"
96104
CanReorderItems="False"
97105
ItemTemplate="{StaticResource TaskItemTemplate}" />

0 commit comments

Comments
 (0)