Skip to content

Commit

Permalink
New updater UI using using InfoBars
Browse files Browse the repository at this point in the history
  • Loading branch information
KimihikoAkayasaki committed Mar 12, 2023
1 parent f1de5fa commit ce79935
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 194 deletions.
6 changes: 4 additions & 2 deletions Amethyst/Assets/Strings/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,13 @@
"/SharedStrings/Toasts/TrackersAutoDisabled/Title": "One or more trackers have been disabled",
"/SharedStrings/Toasts/TrackersConfigChanged": "Restart {0} for changes to take effect",
"/SharedStrings/Toasts/TrackersConfigChanged/Title": "Trackers configuration has changed",
"/SharedStrings/Updates/NewUpdateFound": "New Update Available",
"/SharedStrings/Updates/NewUpdateFound": "New Update Available!",
"/SharedStrings/Updates/NewUpdateMessage": "Amethyst v{0} is out, please make sure to update not to miss out on anything!",
"/SharedStrings/Updates/Suggestions": "Please tell us if you have any ideas\nfor the next Amethyst update.",
"/SharedStrings/Updates/UpToDate": "You're Up To Date",

"/SharedStrings/Updates/Headers/Downloading": "Downloading an update",
"/SharedStrings/Updates/Headers/Downloading": "Updating to Amethyst v{0}",
"/SharedStrings/Updates/Headers/Preparing": "Preparing for the update...",
"/SharedStrings/Updates/Headers/Status": "Status:",
"/SharedStrings/Updates/Statuses/Downloading": "Downloading - 0%",
"/SharedStrings/Updates/Statuses/Error": "Error updating Amethyst!",
Expand Down
49 changes: 41 additions & 8 deletions Amethyst/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,39 @@
</InfoBar.OpacityTransition>
</InfoBar>

<InfoBar x:Name="UpdateInfoBar" Grid.Row="0" Opacity="0.0"
IsOpen="False" IsClosable="True" Margin="3,0,3,3" Severity="Informational"
CloseButtonClick="InstallLaterButton_Click"
Title="{x:Bind util:Translator.Get.String('/SharedStrings/Updates/NewUpdateFound'), Mode=OneWay}"
Message="{x:Bind util:Translator.Get.String('/SharedStrings/Updates/NewUpdateMessage'), Mode=OneWay}">

<InfoBar.ActionButton>
<Button HorizontalAlignment="Right" Click="InstallNowButton_Click"
Content="{x:Bind util:Translator.Get.String('/SharedStrings/Buttons/Updates/Install'), Mode=OneWay}" />
</InfoBar.ActionButton>

<InfoBar.OpacityTransition>
<ScalarTransition />
</InfoBar.OpacityTransition>
</InfoBar>

<InfoBar x:Name="UpdatePendingInfoBar" Grid.Row="0" Opacity="0.0"
IsOpen="False" IsClosable="False" Margin="3,-5,3,3" Severity="Informational"
CloseButtonClick="InstallLaterButton_Click"
Title="{x:Bind util:Translator.Get.String('/SharedStrings/Updates/Headers/Downloading'), Mode=OneWay}"
Message="{x:Bind util:Translator.Get.String('/SharedStrings/Updates/Headers/Preparing'), Mode=OneWay}">

<InfoBar.Content>
<StackPanel x:Name="UpdatePendingFlyoutMainStack" Margin="-45,0,1,0"
HorizontalAlignment="Stretch" Orientation="Vertical">
</StackPanel>
</InfoBar.Content>

<InfoBar.OpacityTransition>
<ScalarTransition />
</InfoBar.OpacityTransition>
</InfoBar>

<muxc:NavigationView x:Name="NavView" Grid.Row="1"
IsTabStop="False"
Margin="0,0,0,0"
Expand Down Expand Up @@ -296,7 +329,7 @@

<muxc:NavigationView.PaneFooter>
<StackPanel Orientation="Vertical">
<NavigationViewItem x:Name="UpdateButton" Height="63"
<!--<NavigationViewItem x:Name="UpdateButton" Height="63"
FontSize="10" FontWeight="Medium"
BackgroundSizing="OuterBorderEdge"
Tapped="UpdateButton_Tapped"
Expand Down Expand Up @@ -344,7 +377,7 @@
</TextBlock>
</Viewbox>
</Grid>
</NavigationViewItem>
</NavigationViewItem>-->

<NavigationViewItem x:Name="HelpButton" Height="63"
FontSize="10" FontWeight="Medium"
Expand Down Expand Up @@ -404,13 +437,13 @@
</Grid>

<Grid.Resources>
<Storyboard x:Name="IconRotation" AutoReverse="False" Completed="OnIconRotationOnCompleted">
<!--<Storyboard x:Name="IconRotation" AutoReverse="False" Completed="OnIconRotationOnCompleted">
<DoubleAnimation Duration="0:0:1" To="360"
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)"
Storyboard.TargetName="UpdateIcon" />
</Storyboard>
</Storyboard>-->

<Flyout x:Name="UpdateFlyout"
<!--<Flyout x:Name="UpdateFlyout"
Opening="ButtonFlyout_Opening"
Closing="ButtonFlyout_Closing">
<Flyout.FlyoutPresenterStyle>
Expand Down Expand Up @@ -443,9 +476,9 @@
HorizontalAlignment="Stretch" />
</Grid>
</StackPanel>
</Flyout>
</Flyout>-->

<Flyout x:Name="UpdatePendingFlyout"
<!--<Flyout x:Name="UpdatePendingFlyout"
Opening="ButtonFlyout_Opening"
Closing="ButtonFlyout_Closing">
<Flyout.FlyoutPresenterStyle>
Expand All @@ -469,7 +502,7 @@
<TextBlock x:Name="UpdatePendingFlyoutStatusContent" Margin="0,0,0,0" />
</StackPanel>
</StackPanel>
</Flyout>
</Flyout>-->

<MenuFlyout x:Name="HelpFlyout"
Opening="HelpFlyout_Opening"
Expand Down
Loading

0 comments on commit ce79935

Please sign in to comment.