Update Dashboard

TabSelect is now a single method, dashboard entries are centered and wrap properly
This commit is contained in:
Chev 2021-01-21 01:25:10 -08:00
parent a1a83285f8
commit 335d7bedf1
2 changed files with 43 additions and 35 deletions

View file

@ -10,36 +10,38 @@
<TabControl x:Name="TabController" Margin="10,10,10,41"> <TabControl x:Name="TabController" Margin="10,10,10,41">
<TabItem Header="Dashboard"> <TabItem Header="Dashboard">
<Grid Background="#2C343E"> <Grid Background="#2C343E">
<Label Content="Dashboard" Margin="10,10,10,0" VerticalAlignment="Top" Height="48" FontSize="28" VerticalContentAlignment="Center" FontFamily="Segoe UI Light"/> <Label Content="Dashboard" Margin="10,10,10,0" VerticalAlignment="Top" Height="48" FontSize="28" VerticalContentAlignment="Center" FontFamily="Segoe UI Light" HorizontalAlignment="Center"/>
<Border x:Name="DashboardButtonTSCB" BorderBrush="White" HorizontalAlignment="Left" Margin="10,63,0,0" VerticalAlignment="Top" Width="250" Height="165"> <WrapPanel Margin="10,0,10,10" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid MouseLeftButtonUp="TabSelect_TSCB"> <Border MouseLeftButtonUp="TabSelect" x:Name="DashboardButtonTSCB" BorderBrush="White" HorizontalAlignment="Left" VerticalAlignment="Top" Width="250" Height="165" Margin="5,5">
<Image Source="/Resources/Icons/mountain.png" Margin="10,10,190,0" Width="48" Height="48" VerticalAlignment="Top"/> <Grid>
<Label Margin="63,10,10,0" VerticalContentAlignment="Center" FontSize="24" Height="48" VerticalAlignment="Top" Content="TSCB"/> <Image Source="/Resources/Icons/mountain.png" Margin="10,10,190,0" Width="48" Height="48" VerticalAlignment="Top"/>
<TextBlock Text="Edits terrain scene binary files." Margin="10,63,10,10" TextWrapping="Wrap"></TextBlock> <Label Margin="63,10,10,0" VerticalContentAlignment="Center" FontSize="24" Height="48" VerticalAlignment="Top" Content="TSCB"/>
</Grid> <TextBlock Text="Edits terrain scene binary files." Margin="10,63,10,10" TextWrapping="Wrap"></TextBlock>
</Border> </Grid>
<Border x:Name="DashboardButtonYaz0" BorderBrush="White" HorizontalAlignment="Left" Margin="265,63,0,0" VerticalAlignment="Top" Width="250" Height="165"> </Border>
<Grid MouseLeftButtonUp="TabSelect_Yaz0"> <Border MouseLeftButtonUp="TabSelect" x:Name="DashboardButtonYaz0" BorderBrush="White" HorizontalAlignment="Left" VerticalAlignment="Top" Width="250" Height="165" Margin="5,5">
<Image Source="/Resources/Icons/letter-z.png" Margin="10,10,190,0" Width="48" Height="48" VerticalAlignment="Top"/> <Grid>
<Label Margin="63,10,10,0" VerticalContentAlignment="Center" FontSize="24" Height="48" VerticalAlignment="Top" Content="Yaz0"/> <Image Source="/Resources/Icons/letter-z.png" Margin="10,10,190,0" Width="48" Height="48" VerticalAlignment="Top"/>
<TextBlock Text="Allows compression/decompression using Yaz0 encoding." Margin="10,63,10,10" TextWrapping="Wrap"></TextBlock> <Label Margin="63,10,10,0" VerticalContentAlignment="Center" FontSize="24" Height="48" VerticalAlignment="Top" Content="Yaz0"/>
</Grid> <TextBlock Text="Allows compression/decompression using Yaz0 encoding." Margin="10,63,10,10" TextWrapping="Wrap"></TextBlock>
</Border> </Grid>
<Border x:Name="DashboardButtonSARC" BorderBrush="White" HorizontalAlignment="Left" Margin="520,63,0,0" VerticalAlignment="Top" Width="250" Height="165"> </Border>
<Grid MouseLeftButtonUp="TabSelect_SARC"> <Border MouseLeftButtonUp="TabSelect" x:Name="DashboardButtonSARC" BorderBrush="White" HorizontalAlignment="Left" VerticalAlignment="Top" Width="250" Height="165" Margin="5,5">
<Image Source="/Resources/Icons/package.png" Margin="10,10,190,0" Width="48" Height="48" VerticalAlignment="Top"/> <Grid>
<Label Margin="63,10,10,0" VerticalContentAlignment="Center" FontSize="24" Height="48" VerticalAlignment="Top" Content="SARC"/> <Image Source="/Resources/Icons/package.png" Margin="10,10,190,0" Width="48" Height="48" VerticalAlignment="Top"/>
<TextBlock Text="Tools to unpack and pack SARC files." Margin="10,63,10,10" TextWrapping="Wrap"></TextBlock> <Label Margin="63,10,10,0" VerticalContentAlignment="Center" FontSize="24" Height="48" VerticalAlignment="Top" Content="SARC"/>
</Grid> <TextBlock Text="Tools to unpack and pack SARC files." Margin="10,63,10,10" TextWrapping="Wrap"></TextBlock>
</Border> </Grid>
<Border x:Name="DashboardButtonRSTB" BorderBrush="White" HorizontalAlignment="Left" Margin="775,63,0,0" VerticalAlignment="Top" Width="250" Height="165"> </Border>
<Grid MouseLeftButtonUp="TabSelect_RSTB"> <Border MouseLeftButtonUp="TabSelect" x:Name="DashboardButtonRSTB" BorderBrush="White" HorizontalAlignment="Left" VerticalAlignment="Top" Width="250" Height="165" Margin="5,5">
<Image Source="/Resources/Icons/text-file.png" Margin="10,10,190,0" Width="48" Height="48" VerticalAlignment="Top"/> <Grid>
<Label Margin="63,10,10,0" VerticalContentAlignment="Center" FontSize="24" Height="48" VerticalAlignment="Top" Content="RSTB"/> <Image Source="/Resources/Icons/text-file.png" Margin="10,10,190,0" Width="48" Height="48" VerticalAlignment="Top"/>
<TextBlock Text="Allows edits to the resource table." Margin="10,63,10,10" TextWrapping="Wrap"></TextBlock> <Label Margin="63,10,10,0" VerticalContentAlignment="Center" FontSize="24" Height="48" VerticalAlignment="Top" Content="RSTB"/>
</Grid> <TextBlock Text="Allows edits to the resource table." Margin="10,63,10,10" TextWrapping="Wrap"></TextBlock>
</Border> </Grid>
</Border>
</WrapPanel>
</Grid> </Grid>
</TabItem> </TabItem>
<TabItem x:Name="tabItemTSCB" Header="TSCB"> <TabItem x:Name="tabItemTSCB" Header="TSCB">

View file

@ -2,6 +2,7 @@
using System; using System;
using System.Reflection; using System.Reflection;
using System.Windows; using System.Windows;
using System.Windows.Controls;
namespace BOTWToolset namespace BOTWToolset
{ {
@ -23,12 +24,17 @@ namespace BOTWToolset
LabelVersion.Content = $"Version v{VERSION}"; LabelVersion.Content = $"Version v{VERSION}";
} }
private void TabSelect_TSCB(object sender, System.Windows.Input.MouseButtonEventArgs e) => tabItemTSCB.IsSelected = true; private void TabSelect(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
var sender_border = (Border)sender;
private void TabSelect_Yaz0(object sender, System.Windows.Input.MouseButtonEventArgs e) => tabItemYaz0.IsSelected = true; switch (sender_border.Name)
{
private void TabSelect_SARC(object sender, System.Windows.Input.MouseButtonEventArgs e) => tabItemSARC.IsSelected = true; case "DashboardButtonTSCB": tabItemTSCB.IsSelected = true; break;
case "DashboardButtonYaz0": tabItemYaz0.IsSelected = true; break;
private void TabSelect_RSTB(object sender, System.Windows.Input.MouseButtonEventArgs e) => tabItemRSTB.IsSelected = true; case "DashboardButtonSARC": tabItemSARC.IsSelected = true; break;
case "DashboardButtonRSTB": tabItemRSTB.IsSelected = true; break;
}
}
} }
} }