Skip to content

Commit 33e36ca

Browse files
committed
Move update banner into the top bar so that the bottom toolbar can still be used when an update is available
1 parent 856d906 commit 33e36ca

File tree

4 files changed

+44
-17
lines changed

4 files changed

+44
-17
lines changed

CompactGUI.Watcher/CompactGUI.Watcher.vbproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1212
</PackageReference>
1313
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
14-
<PackageReference Include="PropertyChanged.Fody" Version="3.4.1" />
14+
<PackageReference Include="PropertyChanged.Fody" Version="3.4.1" PrivateAssets="All"/>
1515
</ItemGroup>
1616

1717
<ItemGroup>

CompactGUI/CompactGUI.vbproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4545
</PackageReference>
4646
<PackageReference Include="Gameloop.Vdf" Version="0.6.2" />
47-
<PackageReference Include="MethodTimer.Fody" Version="3.2.0" />
47+
<PackageReference Include="MethodTimer.Fody" Version="3.2.0" PrivateAssets="All"/>
4848
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
4949
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
5050
<PackageReference Include="ModernWpfUis" Version="1.4.0" />
5151
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
52-
<PackageReference Include="PropertyChanged.Fody" Version="3.4.1" />
52+
<PackageReference Include="PropertyChanged.Fody" Version="3.4.1" PrivateAssets="All" />
5353
<PackageReference Include="System.Management" Version="6.0.0" />
5454
<PackageReference Include="ValueConverters" Version="2.2.10" />
5555
</ItemGroup>

CompactGUI/Views/MainWindow.xaml

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -530,28 +530,53 @@
530530

531531
</VisualStateManager.VisualStateGroups>
532532

533-
<Grid x:Name="titleBar" Height="{Binding ElementName=MainWindow, Path=(ui:TitleBar.Height)}" Panel.ZIndex="2" VerticalAlignment="Top" >
533+
<Grid x:Name="titleBar"
534+
Height="{Binding ElementName=MainWindow, Path=(ui:TitleBar.Height)}" Panel.ZIndex="2" VerticalAlignment="Top" >
534535
<Grid.ColumnDefinitions>
535-
<ColumnDefinition Width="auto" />
536536
<ColumnDefinition Width="*" />
537537
</Grid.ColumnDefinitions>
538538

539-
<ui:TitleBarButton x:Name="uiBtnOptions" Margin="10,5,0,0"
540-
Grid.Column="0" HoverForeground="White" InactiveForeground="#80FFFFFF" HoverBackground="#00000000" PressedBackground="#00000000" PressedForeground="#40FFFFFF"
539+
<ui:TitleBarButton x:Name="uiBtnOptions"
540+
Margin="10,2,0,0"
541+
Panel.ZIndex="2" HorizontalAlignment="Left"
542+
Grid.Column="0" HoverForeground="White" InactiveForeground="#80FFFFFF" HoverBackground="#00000000" PressedBackground="#00000000" PressedForeground="#40FFFFFF"
541543
Content="&#xE713;" FontSize="16" Width="20"
542544
ContentTemplate="{x:Null}" />
543-
</Grid>
544545

545-
<!--Update Banner-->
546-
<Grid x:Name="uiUpdateBanner" VerticalAlignment="Bottom" Height="30" Panel.ZIndex="2" Background="#FF468E56" Visibility="{Binding UpdateAvailable.Item1, Converter={StaticResource BoolToVisConverter}}" Cursor="Hand" MouseUp="uiUpdateBanner_MouseUp">
547-
<Grid.Effect>
548-
<DropShadowEffect Direction="90" Opacity="0.15" BlurRadius="6"/>
549-
</Grid.Effect>
546+
<ui:TitleBarButton x:Name="uiUpdateText" Panel.ZIndex="5"
547+
d:Content="update available - v3.0a2"
548+
Content="{Binding UpdateAvailable.Item2}"
549+
FontSize="14"
550+
FontFamily="Segoe UI"
551+
Width="200"
552+
Visibility="{Binding UpdateAvailable.Item1, Converter={StaticResource BoolToVisConverter}}"
553+
Click="uiUpdateBanner_MouseUp"
554+
HorizontalAlignment="Center"
555+
VerticalAlignment="Center"
556+
Foreground="White"
557+
InactiveForeground="#80FFFFFF"
558+
HoverBackground="#00000000" HoverForeground="#40FFFFFF"
559+
PressedBackground="#00000000"
560+
PressedForeground="#20FFFFFF" />
561+
<!--Update Banner-->
562+
<Grid x:Name="uiUpdateBanner"
563+
VerticalAlignment="Top" HorizontalAlignment="Stretch"
564+
Height="{Binding ElementName=MainWindow, Path=(ui:TitleBar.Height)}" IsHitTestVisible="False"
565+
Background="#AA468E56"
566+
Visibility="{Binding UpdateAvailable.Item1, Converter={StaticResource BoolToVisConverter}}"
567+
Cursor="Hand">
568+
<Grid.Effect>
569+
<DropShadowEffect Direction="90"
570+
Opacity="0.15"
571+
BlurRadius="6" />
572+
</Grid.Effect>
573+
574+
</Grid>
575+
</Grid>
550576

551-
<TextBlock x:Name="uiUpdateText" d:Text="update available - v3.0a2" Text="{Binding UpdateAvailable.Item2}" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
552-
</Grid>
577+
553578

554-
<!--Main information section / results of analysis-->
579+
<!--Main information section / results of analysis-->
555580
<Grid x:Name="mainSection" VerticalAlignment="Top" Panel.ZIndex="1">
556581
<Grid.Background>
557582
<LinearGradientBrush MappingMode="RelativeToBoundingBox" >

CompactGUI/Views/MainWindow.xaml.vb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ Class MainWindow
2323
ViewModel.SelectFolder()
2424
End Sub
2525

26-
Private Sub uiUpdateBanner_MouseUp(sender As Object, e As MouseButtonEventArgs)
26+
Private Sub uiUpdateBanner_MouseUp(sender As Object, e As RoutedEventArgs)
27+
28+
2729
Process.Start(New ProcessStartInfo("https://github.com/IridiumIO/CompactGUI/releases/") With {.UseShellExecute = True})
2830
End Sub
2931

0 commit comments

Comments
 (0)