From cb0e612b9819e693c64d074962157a76b0a3e417 Mon Sep 17 00:00:00 2001 From: vocoder712 <100213316+vocoder712@users.noreply.github.com> Date: Mon, 27 Jul 2026 20:18:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E9=A1=B9=E7=AE=A1=E7=90=86=E7=95=8C=E9=9D=A2UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .agent/DECISIONS.md | 12 ++ OpenUtauMobile/App.axaml.cs | 3 +- .../OpenUtauMobile/OpenUtauMobileTheme.axaml | 5 +- .../Runtime/ThemeStaticTokens.cs | 38 +++- .../OpenUtauMobile/Styles/TabItem.axaml | 76 ++++++++ .../OpenUtauMobile/Styles/TextBox.axaml | 143 ++++++++++++++ .../OpenUtauMobile/Styles/TextInput.axaml | 35 ---- .../Styles/Views/DependencyManagerView.axaml | 61 +++++- .../Views/DependencyManagerView.axaml | 174 +++++++----------- 9 files changed, 398 insertions(+), 149 deletions(-) create mode 100644 OpenUtauMobile/Themes/OpenUtauMobile/Styles/TabItem.axaml create mode 100644 OpenUtauMobile/Themes/OpenUtauMobile/Styles/TextBox.axaml delete mode 100644 OpenUtauMobile/Themes/OpenUtauMobile/Styles/TextInput.axaml diff --git a/.agent/DECISIONS.md b/.agent/DECISIONS.md index c7c1f51..14764ac 100644 --- a/.agent/DECISIONS.md +++ b/.agent/DECISIONS.md @@ -84,3 +84,15 @@ Record meaningful technical decisions here. Use one entry per decision. - Alternatives considered: Launch the system Storage Access Framework picker; request permissions through an application context. - Impacted areas: Android 10 and earlier storage permission checks, runtime permission requests, and raw external-storage access. +- Date: 2026-07-25 +- Decision: Give the dependency manager a page-scoped MD3 component token set and render its tabs with a compact custom state-layer template. +- Rationale: The default desktop tab indicator, unconstrained count badges, and filled hover treatment produced inconsistent geometry and excessive contrast. Page-scoped tokens keep responsive spacing, badge shape, state opacity, and the short pill indicator consistent across generated color themes. +- Alternatives considered: Modify the global Avalonia TabItem theme; continue using per-control literal values. +- Impacted areas: Dependency manager layout and styles; shared static theme tokens. + +- Date: 2026-07-27 +- Decision: Supersede the dependency-manager-specific tab header template with a global MD3 secondary TabItem style. +- Rationale: Secondary tabs are a shared component pattern. A global style gives every TabItem the same 48dp container, Title Small label, state layer, semantic colors, and full-width 2dp active indicator while allowing each view to supply arbitrary header content. +- Alternatives considered: Keep the dependency manager's page-scoped short pill indicator; duplicate the secondary-tab template in each view. +- Impacted areas: Global OpenUtau Mobile TabItem headers; dependency manager tab header markup and tokens. + diff --git a/OpenUtauMobile/App.axaml.cs b/OpenUtauMobile/App.axaml.cs index a51b27b..41fe07d 100644 --- a/OpenUtauMobile/App.axaml.cs +++ b/OpenUtauMobile/App.axaml.cs @@ -1,6 +1,7 @@ using Avalonia; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Markup.Xaml; +using Avalonia.Media; using Avalonia.Styling; using OpenUtau.Core.Util; using OpenUtauMobile.Helpers; @@ -31,7 +32,7 @@ public override void OnFrameworkInitializationCompleted() // Initialize runtime theme resources before creating UI. ThemeManagerV2.Initialize(); - var seed = ThemeSeedResolver.ResolveSeed( + Color seed = ThemeSeedResolver.ResolveSeed( ServiceHub.SystemAccentColorProvider, out _, out _); diff --git a/OpenUtauMobile/Themes/OpenUtauMobile/OpenUtauMobileTheme.axaml b/OpenUtauMobile/Themes/OpenUtauMobile/OpenUtauMobileTheme.axaml index d4764b2..571a715 100644 --- a/OpenUtauMobile/Themes/OpenUtauMobile/OpenUtauMobileTheme.axaml +++ b/OpenUtauMobile/Themes/OpenUtauMobile/OpenUtauMobileTheme.axaml @@ -15,8 +15,9 @@ - + + @@ -41,4 +42,4 @@ - \ No newline at end of file + diff --git a/OpenUtauMobile/Themes/OpenUtauMobile/Runtime/ThemeStaticTokens.cs b/OpenUtauMobile/Themes/OpenUtauMobile/Runtime/ThemeStaticTokens.cs index 597283d..262b1db 100644 --- a/OpenUtauMobile/Themes/OpenUtauMobile/Runtime/ThemeStaticTokens.cs +++ b/OpenUtauMobile/Themes/OpenUtauMobile/Runtime/ThemeStaticTokens.cs @@ -1,5 +1,6 @@ using System; using Avalonia; +using Avalonia.Media; namespace OpenUtauMobile.Themes.OpenUtauMobile.Runtime; @@ -8,6 +9,7 @@ namespace OpenUtauMobile.Themes.OpenUtauMobile.Runtime; /// public static class ThemeBaseLayoutTokens { + public static double SpaceXXS => 2d; public static double SpaceXS => 4d; public static double SpaceS => 8d; public static double SpaceM => 16d; @@ -203,6 +205,40 @@ public static class ThemeSemComponentTokens public static double SliderMinHeight => 48d; } +public static class ThemeSemTabItemTokens +{ + public static double ContainerHeight => 48d; + public static double ActiveIndicatorHeight => 2d; + public static double LabelSize => ThemeBaseTypographyTokens.LabelLSize; + + public static Thickness HeaderInset => new(24, 0); + + public static CornerRadius ActiveIndicatorCorner => ThemeBaseShapeTokens.CornerNone; + + public static FontWeight LabelWeight => FontWeight.Medium; +} + +public static class ThemeSemDependencyManagerTokens +{ + public static double ContentMaxWidth => 1248d; + public static double BadgeMinWidth => 16d; + public static double BadgeHeight => 16d; + public static double SearchFieldHeight => 48d; + public static double IconButtonSize => 48d; + + public static Thickness PageInset => new(24, 16, 24, 24); + public static Thickness BadgeInset => new(4, 0); + public static Thickness SearchFieldInset => new(40, 0, 16, 0); + public static Thickness SearchFieldEndSpacing => new(0, 0, 12, 0); + public static Thickness ToolbarBottomSpacing => new(0, 0, 0, 16); + public static Thickness CardInset => new(16); + public static Thickness CardBottomSpacing => new(0, 0, 0, 12); + + public static CornerRadius SearchFieldCorner => ThemeBaseShapeTokens.CornerXXXXL; + public static CornerRadius IconButtonCorner => ThemeBaseShapeTokens.CornerXXXXL; + public static CornerRadius BadgeCorner => ThemeBaseShapeTokens.CornerM; +} + public static class ThemeSemOpacityTokens { // ── Semantic Opacity Levels ── @@ -221,4 +257,4 @@ public static class ThemeSemOpacityTokens // ── Overlay Opacity ── public static double Scrim => ThemeBaseOpacityTokens.OverlayScrim; public static double LightScrim => ThemeBaseOpacityTokens.OverlayLightScrim; -} \ No newline at end of file +} diff --git a/OpenUtauMobile/Themes/OpenUtauMobile/Styles/TabItem.axaml b/OpenUtauMobile/Themes/OpenUtauMobile/Styles/TabItem.axaml new file mode 100644 index 0000000..3e5b926 --- /dev/null +++ b/OpenUtauMobile/Themes/OpenUtauMobile/Styles/TabItem.axaml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenUtauMobile/Themes/OpenUtauMobile/Styles/TextBox.axaml b/OpenUtauMobile/Themes/OpenUtauMobile/Styles/TextBox.axaml new file mode 100644 index 0000000..0a13c0c --- /dev/null +++ b/OpenUtauMobile/Themes/OpenUtauMobile/Styles/TextBox.axaml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenUtauMobile/Themes/OpenUtauMobile/Styles/TextInput.axaml b/OpenUtauMobile/Themes/OpenUtauMobile/Styles/TextInput.axaml deleted file mode 100644 index 98b716a..0000000 --- a/OpenUtauMobile/Themes/OpenUtauMobile/Styles/TextInput.axaml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OpenUtauMobile/Themes/OpenUtauMobile/Styles/Views/DependencyManagerView.axaml b/OpenUtauMobile/Themes/OpenUtauMobile/Styles/Views/DependencyManagerView.axaml index ddfbeb0..1514bed 100644 --- a/OpenUtauMobile/Themes/OpenUtauMobile/Styles/Views/DependencyManagerView.axaml +++ b/OpenUtauMobile/Themes/OpenUtauMobile/Styles/Views/DependencyManagerView.axaml @@ -3,15 +3,64 @@ xmlns:theme="clr-namespace:OpenUtauMobile.Themes.OpenUtauMobile.Runtime"> - + + + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/OpenUtauMobile/Views/DependencyManagerView.axaml b/OpenUtauMobile/Views/DependencyManagerView.axaml index 4238e66..3053192 100644 --- a/OpenUtauMobile/Views/DependencyManagerView.axaml +++ b/OpenUtauMobile/Views/DependencyManagerView.axaml @@ -15,24 +15,20 @@ - - - + - - + - - + - - + - - - + Classes="DependencyTabs"> + + - - - - + + + + - - - - - - + + + + + - + - + - + - + @@ -142,19 +131,15 @@ - - + + - - - - + - - + - + @@ -189,18 +173,18 @@ FontWeight="Medium" Foreground="{DynamicResource Sem.Color.OnSurfaceVariant}" /> - - + Margin="0,0,0,10" > + + + - + @@ -223,11 +207,9 @@ - - + - - + - - + - - + - - + @@ -310,41 +289,30 @@ CornerRadius="10" ShowProgressText="True" /> - - - - - + - - - - + + + + - - + HorizontalScrollBarVisibility="Disabled"> + - + - - - - + - + @@ -416,7 +380,7 @@ Foreground="{DynamicResource Sem.Color.Outline}" /> - +