Skip to content

Commit

Permalink
optimize main page
Browse files Browse the repository at this point in the history
  • Loading branch information
Scighost committed Dec 31, 2023
1 parent 8ea84ee commit 22fb717
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 135 deletions.
20 changes: 13 additions & 7 deletions src/Starward/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,6 @@ public static bool IgnoreRunningGame
}


public static GameBiz SelectGameBiz
{
get => GetValue<GameBiz>();
set => SetValue(value);
}


public static bool ShowNoviceGacha
{
get => GetValue<bool>();
Expand Down Expand Up @@ -655,4 +648,17 @@ public static void DeleteAllSettings()
#endregion




#region Temp Variable



public static bool IsPlayingVideo { get; set; }



#endregion


}
2 changes: 1 addition & 1 deletion src/Starward/Pages/LauncherPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ partial void OnCanStartGameChanged(bool value)

private void UpdateStartGameButtonStyle()
{
if (MainPage.Current.IsPlayingVideo)
if (AppConfig.IsPlayingVideo)
{
Button_StartGame.Style = Application.Current.Resources["DefaultButtonStyle"] as Style;
AnimatedIcon_GameSetting.Foreground = Application.Current.Resources["TextFillColorPrimaryBrush"] as Brush;
Expand Down
40 changes: 16 additions & 24 deletions src/Starward/Pages/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<Page x:Class="Starward.Pages.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:lang="using:Starward.Language"
xmlns:local="using:Starward.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:s="using:Starward"
xmlns:sct="using:Starward.Controls.TitleBarGameIcon"
x:DefaultBindMode="OneWay"
Loaded="Page_Loaded"
SizeChanged="Page_SizeChanged"
Unloaded="Page_Unloaded"
mc:Ignorable="d">
<local:PageBase x:Class="Starward.Pages.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:lang="using:Starward.Language"
xmlns:local="using:Starward.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:s="using:Starward"
xmlns:sct="using:Starward.Controls.TitleBarGameIcon"
x:DefaultBindMode="OneWay"
SizeChanged="Page_SizeChanged"
mc:Ignorable="d">


<Grid>
Expand Down Expand Up @@ -166,27 +164,24 @@
<Grid Name="Grid_SelectGame"
HorizontalAlignment="Center"
SizeChanged="Grid_SelectGame_SizeChanged">

<StackPanel HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">

<sct:TitleBarGameIconBH3 x:Name="GameIcon_BH3"
Width="36"
Height="36"
Margin="4,0,4,0"
Command="{x:Bind ChangeGameBiz1Command}" />
Command="{x:Bind ChangeGameBizCommand}" />
<sct:TitleBarGameIconYS x:Name="GameIcon_YS"
Width="36"
Height="36"
Margin="4,0,4,0"
Command="{x:Bind ChangeGameBiz1Command}" />
Command="{x:Bind ChangeGameBizCommand}" />
<sct:TitleBarGameIconSR x:Name="GameIcon_SR"
Width="36"
Height="36"
Margin="4,0,4,0"
Command="{x:Bind ChangeGameBiz1Command}" />

Command="{x:Bind ChangeGameBizCommand}" />
<Border Height="32"
Margin="4,0,4,0"
Background="{ThemeResource DateTimePickerFlyoutButtonBackgroundPointerOver}"
Expand Down Expand Up @@ -217,13 +212,10 @@
</Button.Flyout>
</Button>
</Border>


</StackPanel>

</Grid>



</Grid>
</Page>
</local:PageBase>
Loading

0 comments on commit 22fb717

Please sign in to comment.