From 3697843f4071fb1cb558d8e55322f675e6feb704 Mon Sep 17 00:00:00 2001 From: Kemal Setya Adhi Date: Sun, 28 Jul 2024 09:44:29 +0700 Subject: [PATCH] Adjust UI Layouts --- CollapseLauncher/App.xaml | 4 +- .../WindowSizeProp/WindowSizeProp.cs | 26 ++-- .../XAMLs/MainApp/Pages/HomePage.Variable.cs | 4 + .../XAMLs/MainApp/Pages/HomePage.xaml | 129 +++++++++++++----- .../XAMLs/MainApp/Pages/HomePage.xaml.cs | 8 +- Hi3Helper.Core/Lang/Locale/LangMisc.cs | 1 + Hi3Helper.Core/Lang/en_US.json | 1 + 7 files changed, 117 insertions(+), 56 deletions(-) diff --git a/CollapseLauncher/App.xaml b/CollapseLauncher/App.xaml index 3a1529922..22feccc85 100644 --- a/CollapseLauncher/App.xaml +++ b/CollapseLauncher/App.xaml @@ -420,7 +420,7 @@ + Color="#44FFFFFF"/> diff --git a/CollapseLauncher/Classes/Properties/WindowSizeProp/WindowSizeProp.cs b/CollapseLauncher/Classes/Properties/WindowSizeProp/WindowSizeProp.cs index a51548102..3c2748580 100644 --- a/CollapseLauncher/Classes/Properties/WindowSizeProp/WindowSizeProp.cs +++ b/CollapseLauncher/Classes/Properties/WindowSizeProp/WindowSizeProp.cs @@ -30,20 +30,20 @@ Dictionary WindowSizeProfiles SidePanel1Width = new GridLength(340, GridUnitType.Pixel), EventPostCarouselBounds = new Size(340, 158), PostPanelBounds = new Size(340, 120), - PostPanelBottomMargin = new Thickness(0, 0, 0, 52), + PostPanelBottomMargin = new Thickness(0, 0, 0, 24), PostPanelPaimonHeight = 138, - PostPanelPaimonMargin = new Thickness(0, -48, -32, 0), - PostPanelPaimonInnerMargin = new Thickness(0, 0, 0, 48), - PostPanelPaimonTextMargin = new Thickness(0, 0, 142, 0), + PostPanelPaimonMargin = new Thickness(0, -48, -64, 0), + PostPanelPaimonInnerMargin = new Thickness(0, 0, 0, 0), + PostPanelPaimonTextMargin = new Thickness(0, 0, 8, 28), PostPanelPaimonTextSize = 14, BannerIconWidth = 136, BannerIconWidthHYP = 110, BannerIconMargin = new Thickness(0, 0, 94, 84), - BannerIconMarginHYP = new Thickness(48, 0, 0, 28), + BannerIconMarginHYP = new Thickness(48, 232, 0, 0), BannerIconAlignHorizontal = HorizontalAlignment.Right, BannerIconAlignHorizontalHYP = HorizontalAlignment.Left, BannerIconAlignVertical = VerticalAlignment.Bottom, - BannerIconAlignVerticalHYP = VerticalAlignment.Bottom, + BannerIconAlignVerticalHYP = VerticalAlignment.Top, SettingsPanelWidth = 676 } }, @@ -56,20 +56,20 @@ Dictionary WindowSizeProfiles SidePanel1Width = new GridLength(280, GridUnitType.Pixel), EventPostCarouselBounds = new Size(280, 130), PostPanelBounds = new Size(280, 98), - PostPanelBottomMargin = new Thickness(0, 0, 0, 48), - PostPanelPaimonHeight = 128, - PostPanelPaimonMargin = new Thickness(0, -48, -32, 0), - PostPanelPaimonInnerMargin = new Thickness(0, 0, 0, 48), - PostPanelPaimonTextMargin = new Thickness(0, 0, 142, 0), + PostPanelBottomMargin = new Thickness(0, 0, 0, 12), + PostPanelPaimonHeight = 110, + PostPanelPaimonMargin = new Thickness(0, -48, -56, 0), + PostPanelPaimonInnerMargin = new Thickness(0, 0, 0, 0), + PostPanelPaimonTextMargin = new Thickness(0, 0, 0, 18), PostPanelPaimonTextSize = 11, BannerIconWidth = 100, BannerIconWidthHYP = 86, BannerIconMargin = new Thickness(0, 0, 70, 52), - BannerIconMarginHYP = new Thickness(24, 0, 0, 8), + BannerIconMarginHYP = new Thickness(24, 170, 0, 0), BannerIconAlignHorizontal = HorizontalAlignment.Right, BannerIconAlignHorizontalHYP = HorizontalAlignment.Left, BannerIconAlignVertical = VerticalAlignment.Bottom, - BannerIconAlignVerticalHYP = VerticalAlignment.Bottom, + BannerIconAlignVerticalHYP = VerticalAlignment.Top, SettingsPanelWidth = 464 } } diff --git a/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.Variable.cs b/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.Variable.cs index 6a945a486..ee5c8b6a9 100644 --- a/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.Variable.cs +++ b/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.Variable.cs @@ -30,6 +30,10 @@ public sealed partial class HomePage : Page public Visibility IsPostNoticePanelEmpty => (GameNewsData?.NewsPostTypeAnnouncement?.Count ?? 0) != 0 ? Visibility.Collapsed : Visibility.Visible; public Visibility IsPostInfoPanelVisible => (GameNewsData?.NewsPostTypeInfo?.Count ?? 0) == 0 ? Visibility.Collapsed : Visibility.Visible; public Visibility IsPostInfoPanelEmpty => (GameNewsData?.NewsPostTypeInfo?.Count ?? 0) != 0 ? Visibility.Collapsed : Visibility.Visible; + public Visibility IsPostInfoPanelAllEmpty => + IsPostEventPanelVisible == Visibility.Collapsed + && IsPostEventPanelVisible == Visibility.Collapsed + && IsPostEventPanelVisible == Visibility.Collapsed ? Visibility.Collapsed : Visibility.Visible; public int PostEmptyMascotTextWidth => Locale.Lang._HomePage.PostPanel_NoNews.Length > 30 ? 200 : 100; #nullable restore diff --git a/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml b/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml index 94c6c4011..b99349afb 100644 --- a/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml +++ b/CollapseLauncher/XAMLs/MainApp/Pages/HomePage.xaml @@ -581,30 +581,33 @@ + PointerExited="SidePanelScaleInHoveredPointerExited" + Shadow="{ThemeResource SharedShadow}" + Translation="0,0,32"> + Translation="0,0,12"> + Translation="0,0,16"> - + - @@ -699,12 +698,12 @@ - @@ -723,7 +723,7 @@ - @@ -775,12 +775,12 @@ - @@ -799,7 +800,7 @@ - @@ -851,12 +852,12 @@ - @@ -1029,7 +1031,7 @@ - + + + + + + + + @@ -1170,12 +1195,44 @@ FontWeight="Bold" Text="%" /> - + + + + + + + + + + + +