mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-21 16:33:05 +08:00
[Workspaces->launcherUI] Fix loading animation (#34442)
* WIP * Minor changes * removing spinner.gif * Removing spinner.gif usage, references * Update src/modules/Workspaces/WorkspacesLauncherUI/Models/AppLaunching.cs * xaml formatting --------- Co-authored-by: Stefan Markovic <stefan@janeasystems.com> Co-authored-by: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com>
This commit is contained in:
parent
d676064be5
commit
320182dd89
@ -34,6 +34,8 @@ namespace WorkspacesLauncherUI.Models
|
|||||||
|
|
||||||
public string AppPath { get; set; }
|
public string AppPath { get; set; }
|
||||||
|
|
||||||
|
public bool Loading => LaunchState == "waiting";
|
||||||
|
|
||||||
private Icon _icon;
|
private Icon _icon;
|
||||||
|
|
||||||
public Icon Icon
|
public Icon Icon
|
||||||
@ -76,10 +78,9 @@ namespace WorkspacesLauncherUI.Models
|
|||||||
{
|
{
|
||||||
get => LaunchState switch
|
get => LaunchState switch
|
||||||
{
|
{
|
||||||
"waiting" => "../images/spinner.gif",
|
|
||||||
"launched" => "../images/checkmark.png",
|
"launched" => "../images/checkmark.png",
|
||||||
"failed" => "../images/failed.png",
|
"failed" => "../images/failed.png",
|
||||||
_ => "../images/spinner.gif",
|
_ => "../images/failed.png",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
x:Class="WorkspacesLauncherUI.StatusWindow"
|
x:Class="WorkspacesLauncherUI.StatusWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:converters="clr-namespace:WorkspacesLauncherUI.Converters"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:WorkspacesLauncherUI"
|
xmlns:local="clr-namespace:WorkspacesLauncherUI"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
@ -21,6 +22,11 @@
|
|||||||
Topmost="True"
|
Topmost="True"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
<Window.Resources>
|
||||||
|
<BooleanToVisibilityConverter x:Key="BoolToVis" />
|
||||||
|
<converters:BooleanToInvertedVisibilityConverter x:Key="BooleanToInvertedVisibilityConverter" />
|
||||||
|
</Window.Resources>
|
||||||
|
|
||||||
<Grid Margin="5" Background="Transparent">
|
<Grid Margin="5" Background="Transparent">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="1*" />
|
<RowDefinition Height="1*" />
|
||||||
@ -55,6 +61,16 @@
|
|||||||
FontWeight="Normal"
|
FontWeight="Normal"
|
||||||
Foreground="{DynamicResource PrimaryForegroundBrush}"
|
Foreground="{DynamicResource PrimaryForegroundBrush}"
|
||||||
Text="{Binding Name, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
|
Text="{Binding Name, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||||
|
<ui:ProgressRing
|
||||||
|
x:Name="ProgressRing"
|
||||||
|
Grid.Column="2"
|
||||||
|
Width="20"
|
||||||
|
Height="20"
|
||||||
|
Margin="10"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
IsActive="True"
|
||||||
|
Visibility="{Binding Loading, Mode=OneWay, Converter={StaticResource BoolToVis}, UpdateSourceTrigger=PropertyChanged}" />
|
||||||
<Image
|
<Image
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Width="20"
|
Width="20"
|
||||||
@ -62,7 +78,8 @@
|
|||||||
Margin="10"
|
Margin="10"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Source="{Binding StateImageSource}" />
|
Source="{Binding StateImageSource}"
|
||||||
|
Visibility="{Binding Loading, Mode=OneWay, Converter={StaticResource BooleanToInvertedVisibilityConverter}, UpdateSourceTrigger=PropertyChanged}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
<None Remove="images\checkmark.png" />
|
<None Remove="images\checkmark.png" />
|
||||||
<None Remove="images\DefaultIcon.ico" />
|
<None Remove="images\DefaultIcon.ico" />
|
||||||
<None Remove="images\failed.png" />
|
<None Remove="images\failed.png" />
|
||||||
<None Remove="images\spinner.gif" />
|
|
||||||
<None Remove="images\Workspaces.ico" />
|
<None Remove="images\Workspaces.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -95,9 +94,6 @@
|
|||||||
<Resource Include="images\failed.png">
|
<Resource Include="images\failed.png">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Resource>
|
</Resource>
|
||||||
<Resource Include="images\spinner.gif">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</Resource>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Update="Properties\Resources.Designer.cs">
|
<Compile Update="Properties\Resources.Designer.cs">
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 49 KiB |
Loading…
Reference in New Issue
Block a user