|
| 1 | +<!-- |
| 2 | + Copyright (c) Microsoft Corporation. All rights reserved. Licensed under |
| 3 | + the MIT License. See LICENSE in the project root for license information. |
| 4 | +--> |
| 5 | +<UserControl x:Class="TerminalApp.TasksPaneContent" |
| 6 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 7 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 8 | + xmlns:SettingsModel="using:Microsoft.Terminal.Settings.Model" |
| 9 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 10 | + xmlns:local="using:TerminalApp" |
| 11 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 12 | + xmlns:model="using:Microsoft.Terminal.Settings.Model" |
| 13 | + xmlns:mux="using:Microsoft.UI.Xaml.Controls" |
| 14 | + AllowFocusOnInteraction="True" |
| 15 | + IsTabStop="True" |
| 16 | + TabNavigation="Cycle" |
| 17 | + mc:Ignorable="d"> |
| 18 | + |
| 19 | + <UserControl.Resources> |
| 20 | + <ResourceDictionary> |
| 21 | + <model:IconPathConverter x:Key="IconSourceConverter" /> |
| 22 | + |
| 23 | + <DataTemplate x:Key="ListItemTemplate" |
| 24 | + x:DataType="local:FilteredCommand"> |
| 25 | + <ListViewItem Height="32" |
| 26 | + MinHeight="0" |
| 27 | + Padding="16,0,12,0" |
| 28 | + HorizontalContentAlignment="Stretch" |
| 29 | + AutomationProperties.AcceleratorKey="{x:Bind Item.KeyChordText, Mode=OneWay}" |
| 30 | + AutomationProperties.Name="{x:Bind Item.Name, Mode=OneWay}" |
| 31 | + FontSize="12" /> |
| 32 | + </DataTemplate> |
| 33 | + <DataTemplate x:Key="TaskItemTemplate" |
| 34 | + x:DataType="local:TaskViewModel"> |
| 35 | + <mux:TreeViewItem x:Name="rootItem" |
| 36 | + ItemsSource="{x:Bind Children}"> |
| 37 | + <Grid> |
| 38 | + <Grid.RowDefinitions> |
| 39 | + <RowDefinition Height="*" /> |
| 40 | + <RowDefinition Height="*" /> |
| 41 | + </Grid.RowDefinitions> |
| 42 | + <Grid.ColumnDefinitions> |
| 43 | + <ColumnDefinition Width="Auto" /> |
| 44 | + <ColumnDefinition Width="*" /> |
| 45 | + </Grid.ColumnDefinitions> |
| 46 | + <ContentPresenter Grid.Column="0"> |
| 47 | + <IconSourceElement Width="16" |
| 48 | + Height="16" |
| 49 | + IconSource="{x:Bind IconPath, Converter={StaticResource IconSourceConverter}}" |
| 50 | + Visibility="Collapsed" /> |
| 51 | + </ContentPresenter> |
| 52 | + <!-- <Ellipse x:Name="Ellipse" |
| 53 | + Grid.RowSpan="2" |
| 54 | + Width ="32" |
| 55 | + Height="32" |
| 56 | + Margin="6" |
| 57 | + VerticalAlignment="Center" |
| 58 | + HorizontalAlignment="Center" |
| 59 | + Fill="{ThemeResource SystemControlBackgroundBaseMediumBrush}"/>--> |
| 60 | + <Button Grid.Row="0" |
| 61 | + Grid.Column="0" |
| 62 | + Click="_runCommandButtonClicked"> |
| 63 | + |
| 64 | + <Button.Content> |
| 65 | + <FontIcon FontFamily="Segoe Fluent Icons, Segoe MDL2 Assets" |
| 66 | + FontSize="12" |
| 67 | + Glyph="" /> |
| 68 | + </Button.Content> |
| 69 | + |
| 70 | + <Button.Resources> |
| 71 | + <ResourceDictionary> |
| 72 | + <ResourceDictionary.ThemeDictionaries> |
| 73 | + <ResourceDictionary x:Key="Light"> |
| 74 | + <SolidColorBrush x:Key="ButtonForegroundPointerOver" |
| 75 | + Color="{StaticResource SystemAccentColor}" /> |
| 76 | + <SolidColorBrush x:Key="ButtonForegroundPressed" |
| 77 | + Color="{StaticResource SystemAccentColor}" /> |
| 78 | + </ResourceDictionary> |
| 79 | + <ResourceDictionary x:Key="Dark"> |
| 80 | + <SolidColorBrush x:Key="ButtonForegroundPointerOver" |
| 81 | + Color="{StaticResource SystemAccentColor}" /> |
| 82 | + <SolidColorBrush x:Key="ButtonForegroundPressed" |
| 83 | + Color="{StaticResource SystemAccentColor}" /> |
| 84 | + </ResourceDictionary> |
| 85 | + <ResourceDictionary x:Key="HighContrast"> |
| 86 | + <SolidColorBrush x:Key="ButtonBackground" |
| 87 | + Color="{ThemeResource SystemColorButtonFaceColor}" /> |
| 88 | + <SolidColorBrush x:Key="ButtonBackgroundPointerOver" |
| 89 | + Color="{ThemeResource SystemColorHighlightColor}" /> |
| 90 | + <SolidColorBrush x:Key="ButtonBackgroundPressed" |
| 91 | + Color="{ThemeResource SystemColorHighlightColor}" /> |
| 92 | + <SolidColorBrush x:Key="ButtonForeground" |
| 93 | + Color="{ThemeResource SystemColorButtonTextColor}" /> |
| 94 | + <SolidColorBrush x:Key="ButtonForegroundPointerOver" |
| 95 | + Color="{ThemeResource SystemColorHighlightTextColor}" /> |
| 96 | + <SolidColorBrush x:Key="ButtonForegroundPressed" |
| 97 | + Color="{ThemeResource SystemColorHighlightTextColor}" /> |
| 98 | + </ResourceDictionary> |
| 99 | + </ResourceDictionary.ThemeDictionaries> |
| 100 | + </ResourceDictionary> |
| 101 | + </Button.Resources> |
| 102 | + </Button> |
| 103 | + |
| 104 | + <TextBlock Grid.Column="1" |
| 105 | + Margin="12,6,0,0" |
| 106 | + Style="{ThemeResource BaseTextBlockStyle}" |
| 107 | + Text="{x:Bind Name, Mode=OneWay}" /> |
| 108 | + <TextBlock Grid.Row="1" |
| 109 | + Grid.Column="1" |
| 110 | + Margin="12,0,0,6" |
| 111 | + MaxLines="1" |
| 112 | + Style="{ThemeResource BodyTextBlockStyle}" |
| 113 | + Text="{x:Bind Input}" |
| 114 | + Visibility="{Binding ElementName=rootItem, Path=IsSelected}" /> |
| 115 | + </Grid> |
| 116 | + </mux:TreeViewItem> |
| 117 | + </DataTemplate> |
| 118 | + </ResourceDictionary> |
| 119 | + </UserControl.Resources> |
| 120 | + |
| 121 | + <Grid> |
| 122 | + <Grid.RowDefinitions> |
| 123 | + <RowDefinition Height="Auto" /> |
| 124 | + <RowDefinition Height="Auto" /> |
| 125 | + <RowDefinition Height="*" /> |
| 126 | + </Grid.RowDefinitions> |
| 127 | + |
| 128 | + <TextBlock x:Name="_title" |
| 129 | + Grid.Row="0" |
| 130 | + Margin="9" |
| 131 | + FontSize="24" |
| 132 | + Text="Tasks" /> |
| 133 | + |
| 134 | + <TextBox x:Name="_filterBox" |
| 135 | + Grid.Row="1" |
| 136 | + Margin="8" |
| 137 | + PlaceholderText="Filter tasks..." /> |
| 138 | + |
| 139 | + <mux:TreeView x:Name="_treeView" |
| 140 | + Grid.Row="2" |
| 141 | + CanDragItems="False" |
| 142 | + CanReorderItems="False" |
| 143 | + ItemTemplate="{StaticResource TaskItemTemplate}" /> |
| 144 | + </Grid> |
| 145 | + |
| 146 | +</UserControl> |
0 commit comments