Skip to content

Commit 2dc16e4

Browse files
committed
the cool thing with the hovering
1 parent 32234ca commit 2dc16e4

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

src/cascadia/TerminalApp/TasksPaneContent.xaml

+91
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,92 @@
2020
<UserControl.Resources>
2121
<ResourceDictionary>
2222

23+
<Style x:Key="PlayButtonTemplate"
24+
TargetType="Button">
25+
<Setter Property="Margin" Value="0" />
26+
<Setter Property="Padding" Value="4" />
27+
<Setter Property="BorderBrush" Value="Transparent" />
28+
<Setter Property="Background" Value="Transparent" />
29+
30+
<Setter Property="Template">
31+
<Setter.Value>
32+
<ControlTemplate TargetType="Button">
33+
<Border x:Name="ButtonBaseElement"
34+
Padding="{TemplateBinding Padding}"
35+
AutomationProperties.AccessibilityView="Raw"
36+
Background="{TemplateBinding Background}"
37+
BackgroundSizing="{TemplateBinding BackgroundSizing}"
38+
BorderBrush="{TemplateBinding BorderBrush}"
39+
BorderThickness="{TemplateBinding BorderThickness}"
40+
CornerRadius="{TemplateBinding CornerRadius}">
41+
<Viewbox Width="20"
42+
Height="20">
43+
<Grid>
44+
<FontIcon x:Name="ButtonBackgroundIcon"
45+
FontFamily="Segoe UI, Segoe Fluent Icons, Segoe MDL2 Assets"
46+
Foreground="{ThemeResource PlayButtonHoveredColor}"
47+
Glyph="&#xF5b0;"
48+
Visibility="Collapsed" />
49+
<FontIcon x:Name="ButtonOutlineIcon"
50+
FontFamily="Segoe UI, Segoe Fluent Icons, Segoe MDL2 Assets"
51+
Foreground="{ThemeResource PlayButtonNormalColor}"
52+
Glyph="&#xE768;" />
53+
</Grid>
54+
<!-- TODO! FontFamily="{ThemeResource SymbolThemeFontFamily}" -->
55+
</Viewbox>
56+
57+
<VisualStateManager.VisualStateGroups>
58+
<VisualStateGroup x:Name="CommonStates">
59+
60+
<VisualState x:Name="Normal">
61+
<VisualState.Setters>
62+
<Setter Target="ButtonBackgroundIcon.Visibility" Value="Collapsed" />
63+
</VisualState.Setters>
64+
</VisualState>
65+
66+
<VisualState x:Name="PointerOver">
67+
<VisualState.Setters>
68+
<Setter Target="ButtonBackgroundIcon.Visibility" Value="Visible" />
69+
</VisualState.Setters>
70+
</VisualState>
71+
72+
<VisualState x:Name="Disabled" />
73+
</VisualStateGroup>
74+
75+
<VisualStateGroup x:Name="PlayButtonStates">
76+
<VisualState x:Name="Ready">
77+
<VisualState.Setters>
78+
<Setter Target="ButtonBackgroundIcon.Glyph" Value="&#xF5b0;" />
79+
<Setter Target="ButtonOutlineIcon.Glyph" Value="&#xE768;" />
80+
<Setter Target="StatusProgress.IsActive" Value="False" />
81+
</VisualState.Setters>
82+
</VisualState>
83+
<!--
84+
<VisualState x:Name="Running">
85+
<VisualState.Setters>
86+
<Setter Target="ButtonBackgroundIcon.Glyph" Value=" " />
87+
<Setter Target="ButtonOutlineIcon.Glyph" Value=" " />
88+
<Setter Target="StatusProgress.IsActive" Value="True" />
89+
</VisualState.Setters>
90+
</VisualState>
91+
92+
<VisualState x:Name="AlreadyRan">
93+
<VisualState.Setters>
94+
<Setter Target="ButtonBackgroundIcon.Glyph" Value="&#xe72c;" />
95+
<Setter Target="ButtonOutlineIcon.Glyph" Value="&#xe72c;" />
96+
<Setter Target="StatusProgress.IsActive" Value="False" />
97+
</VisualState.Setters>
98+
</VisualState>-->
99+
</VisualStateGroup>
100+
101+
</VisualStateManager.VisualStateGroups>
102+
</Border>
103+
</ControlTemplate>
104+
</Setter.Value>
105+
</Setter>
106+
107+
</Style>
108+
23109
<DataTemplate x:Key="TaskItemTemplate"
24110
x:DataType="local:FilteredTask">
25111
<mux:TreeViewItem x:Name="rootItem"
@@ -52,6 +138,7 @@
52138
Background="Transparent"
53139
BorderBrush="Transparent"
54140
Click="_runCommandButtonClicked"
141+
Style="{StaticResource PlayButtonTemplate}"
55142
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(HasChildren), Mode=OneWay}">
56143

57144
<Button.Content>
@@ -118,9 +205,13 @@
118205
<!-- same as in MainPage, this is SolidBackgroundFillColorTertiary -->
119206
<ResourceDictionary x:Key="Dark">
120207
<Color x:Key="PageBackground">#282828</Color>
208+
<Color x:Key="PlayButtonHoveredColor">#90ef90</Color>
209+
<Color x:Key="PlayButtonNormalColor">#8888</Color>
121210
</ResourceDictionary>
122211
<ResourceDictionary x:Key="Light">
123212
<Color x:Key="PageBackground">#F9F9F9</Color>
213+
<Color x:Key="PlayButtonHoveredColor">#257f01</Color>
214+
<Color x:Key="PlayButtonNormalColor">#88222222</Color>
124215
</ResourceDictionary>
125216
<ResourceDictionary x:Key="HighContrast">
126217
<!-- Define resources for HighContrast mode here -->

0 commit comments

Comments
 (0)