Skip to content

[Feature] Code changes to support subtitle shadow + shadow depth control + background color + opacity control#134

Open
anilabhadatta wants to merge 8 commits into
NuvioMedia:Devfrom
anilabhadatta:Dev_shadow_subtitle
Open

[Feature] Code changes to support subtitle shadow + shadow depth control + background color + opacity control#134
anilabhadatta wants to merge 8 commits into
NuvioMedia:Devfrom
anilabhadatta:Dev_shadow_subtitle

Conversation

@anilabhadatta

@anilabhadatta anilabhadatta commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR implements full feature parity for Subtitle Shadow and Shadow Density controls on the Nuvio Desktop. It introduces the necessary UI controls in both the main application settings and the desktop webview player bridge, while ensuring correct serialization of the floating-point values without arbitrary limits.

PR type

  • Reproducible bug fix
  • UI glitch/bug fix
  • Behavior bug/regression fix
  • Small maintenance only, with no UI or behavior change
  • Docs accuracy fix
  • Translation/localization only
  • Approved larger or directional change

Why

1. Shadow UI Controls Implementation:

  • Added global and local toggle capabilities for rendering drop shadows behind subtitles. Added a custom floating point slider component (SettingsFloatSliderRow) to properly allow fine-grained tweaking of shadowDensity on the main settings page.
  • Integrated the DOM elements and bridging logic in controls.html and controls.js to ensure the desktop video player respects and dynamically updates these new subtitle properties.

2. Fixing Serialization Density Limits:

  • Discovered that NativePlayerController.kt was inadvertently clamping all JSON serialized Float values between 0.0 and 1.0. Because the max intended density is 5.0, this bug artificially prevented the slider inside the desktop webview player from moving past 1.0.
  • Refactored the appendJsonField for Float types in NativePlayerController.kt to serialize raw values without arbitrary coercion, solving the UI range discrepancy.

3. Settings Search Indexing:

  • Updated SettingsSearch.kt to ensure the new Shadow strings and toggle components are indexed and accessible via the main application search feature.

Desktop scope

This PR modifies desktop and common compose settings UI logic and native player bridging logic.

  • Modified PlaybackSettingsPage.kt to construct the SettingsSwitchRow and SettingsFloatSliderRow.
  • Modified NativePlayerController.kt to serialize shadow fields without clamping the float ranges.
  • Modified controls.html and controls.js to build the shadow toggle and shadow density stepper in the webview.
  • Modified strings.xml to include localization for subtitle shadow features.
  • Modified SettingsSearch.kt for settings index.

Issue or approval

NuvioMedia/NuvioMobile#1309 -> Sync with mobile feature request
Mobile PR: NuvioMedia/NuvioMobile#1388

UI / behavior impact

  • No UI change
  • No behavior change
  • UI changed only to fix a documented glitch/bug
  • Behavior changed only to fix a documented bug/regression
  • UI change has explicit maintainer approval
  • Behavior change has explicit maintainer approval

Policy check

  • I have read and understood CONTRIBUTING.md.
  • This PR is small, focused, and limited to one problem.
  • This PR is not cosmetic-only.
  • Any UI change fixes a linked glitch/bug and includes visual proof, or this PR has no UI change.
  • Any behavior change fixes a linked bug/regression or has explicit approval, or this PR has no behavior change.
  • This PR does not bundle unrelated refactors, cleanups, formatting, or drive-by changes.
  • This PR does not add dependencies, architecture changes, migrations, or product-direction changes without explicit approval.
  • I listed the testing performed below.

Scope boundaries

None.

Testing

Manually verified:

  1. Verified Subtitle Shadow and Shadow Density appear in the PlaybackSettingsPage exactly beneath the Outline settings.
  2. Verified SettingsFloatSliderRow handles ranges of 0.2 to 5.0 seamlessly.
  3. Verified the webview player controls (controls.html bridge) correctly toggle the shadow style and dispatch density updates back to the Kotlin UI via NativePlayerController.kt.
  4. Successfully verified that the JSON Float limits inside NativePlayerController.kt were fixed, ensuring that the Webview slider successfully matches the full 1.0 to 5.0 range instead of capping out at 1.0.

Screenshots / Video

image image

Mac result:
Screenshot 2026-06-23 at 3 09 56 PM
Screenshot 2026-06-23 at 3 09 43 PM
Screenshot 2026-06-23 at 3 09 32 PM

Breaking changes

None.

Linked issues

NuvioMedia/NuvioMobile#1309 -> Sync with mobile feature request
Mobile PR: NuvioMedia/NuvioMobile#1388

@anilabhadatta

anilabhadatta commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

background color & opacity control added in this PR as well.
Also improved selection in style settings panel. the buttons on click were taking some time to render changes. Now the changes will be smooth and instant.
Also the logic is written: if Outline enabled, shadow and background color disabled, similarly other combinations

Screenshot 2026-06-25 at 1 24 48 PM Screenshot 2026-06-25 at 1 25 58 PM Screenshot 2026-06-25 at 1 26 17 PM
shadow+back.mp4

@anilabhadatta anilabhadatta changed the title feature: shadow on subtitle [Feature] Code changes to support subtitle shadow + shadow depth control + background color + opacity control Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant