Skip to content

Commit

Permalink
re-add the visibility hack; add a play button that does nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Feb 20, 2024
1 parent 365c068 commit d7a6b18
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 27 deletions.
17 changes: 0 additions & 17 deletions src/cascadia/TerminalApp/TasksPaneContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ namespace winrt::TerminalApp::implementation
// UpdateSettings(settings);
}


MUX::Controls::TreeViewNode _buildTreeViewNode(const Model::Command& task)
{
MUX::Controls::TreeViewNode item{};
Expand Down Expand Up @@ -74,22 +73,6 @@ namespace winrt::TerminalApp::implementation
_treeView().ItemsSource(itemSource);
}

void TasksPaneContent::_containerContentChanging(
const Windows::UI::Xaml::Controls::ListViewBase& /*sender*/,
const Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs& args)
{
const auto itemContainer = args.ItemContainer();
if (args.InRecycleQueue() && itemContainer && itemContainer.ContentTemplate())
{
// _listViewItemsCache[itemContainer.ContentTemplate()].insert(itemContainer);
itemContainer.DataContext(nullptr);
}
else
{
itemContainer.DataContext(args.Item());
}
}

winrt::Windows::UI::Xaml::FrameworkElement TasksPaneContent::GetRoot()
{
return *this;
Expand Down
6 changes: 1 addition & 5 deletions src/cascadia/TerminalApp/TasksPaneContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,14 @@ namespace winrt::TerminalApp::implementation

private:
friend struct TasksPaneContentT<TasksPaneContent>; // for Xaml to bind events

// winrt::Windows::UI::Xaml::Controls::Grid _root{ nullptr };
// winrt::Microsoft::UI::Xaml::Controls::TreeView _treeView{ nullptr };

void _containerContentChanging(const Windows::UI::Xaml::Controls::ListViewBase& sender, const Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs& args);
};

struct TaskViewModel : TaskViewModelT<TaskViewModel>
{
TaskViewModel(const winrt::Microsoft::Terminal::Settings::Model::Command& command) :
_command{ command }
{
// The Children() method must always return a non-null vector
_children = winrt::single_threaded_observable_vector<TerminalApp::TaskViewModel>();
if (_command.HasNestedCommands())
{
Expand Down
18 changes: 13 additions & 5 deletions src/cascadia/TerminalApp/TasksPaneContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
</DataTemplate>
<DataTemplate x:Key="TaskItemTemplate"
x:DataType="local:TaskViewModel">
<mux:TreeViewItem ItemsSource="{x:Bind Children}">
<mux:TreeViewItem x:Name="rootItem"
ItemsSource="{x:Bind Children}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
Expand All @@ -56,6 +57,12 @@
VerticalAlignment="Center"
HorizontalAlignment="Center"
Fill="{ThemeResource SystemControlBackgroundBaseMediumBrush}"/>-->
<Button Grid.Row="0"
Grid.Column="0">
<FontIcon FontFamily="Segoe Fluent Icons, Segoe MDL2 Assets"
FontSize="12"
Glyph="&#xE768;" />
</Button>
<TextBlock Grid.Column="1"
Margin="12,6,0,0"
Style="{ThemeResource BaseTextBlockStyle}"
Expand All @@ -65,14 +72,15 @@
Margin="12,0,0,6"
MaxLines="1"
Style="{ThemeResource BodyTextBlockStyle}"
Text="{x:Bind Input}" />
Text="{x:Bind Input}"
Visibility="{Binding ElementName=rootItem, Path=IsSelected}" />
</Grid>
</mux:TreeViewItem>
</DataTemplate>
</ResourceDictionary>
</UserControl.Resources>

<Grid Background="Red">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
Expand All @@ -87,11 +95,11 @@

<TextBox x:Name="_filterBox"
Grid.Row="1"
Margin="8" />
Margin="8"
PlaceholderText="Filter tasks..." />

<mux:TreeView x:Name="_treeView"
Grid.Row="2"
Background="Blue"
CanDragItems="False"
CanReorderItems="False"
ItemTemplate="{StaticResource TaskItemTemplate}" />
Expand Down

0 comments on commit d7a6b18

Please sign in to comment.