Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL language causes misalignment of slider labels #4904

Open
1 task done
low-batt opened this issue Apr 28, 2024 · 0 comments · May be fixed by #4919
Open
1 task done

RTL language causes misalignment of slider labels #4904

low-batt opened this issue Apr 28, 2024 · 0 comments · May be fixed by #4919

Comments

@low-batt
Copy link
Contributor

low-batt commented Apr 28, 2024

System and IINA version:

Expected behavior:
The text fields under the slider for the Speed setting on the VIDEO tab of the quick settings panel are properly aligned with the tick marks they are intended to label.

Actual behavior:
Currently IINA does not support any right to left languages. However PR #4922 enables Hebrew. If you build IINA with that pull request and set Hebrew as the language then show the video panel the labels under the slider for the Speed settings are misaligned:
he-speed

The labels should look like this:
en-speed

I believe this problem is responsible for these constraint errors:

Errors displayed in Xcode console::
Unable to simultaneously satisfy constraints:
(
    "<NSLayoutConstraint:0x600000852670 H:[NSTextField:0x11fe5dac0]-(>=0)-[NSTextField:0x11fe5ddf0]   (active)>",
    "<NSLayoutConstraint:0x600000852530 NSTextField:0x11fe5dac0.centerX == 0.667*NSSlider:0x11fe4b490.trailing   (active)>",
    "<NSLayoutConstraint:0x600000852620 NSTextField:0x11fe5ddf0.trailing == NSSlider:0x11fe4b490.trailing   (active)>",
    "<NSLayoutConstraint:0x600000852760 H:[NSSlider:0x11fe4b490]-(8)-[NSTextField:0x11fe5e120]   (active)>",
    "<NSLayoutConstraint:0x600000852710 NSTextField:0x11fe5e120.trailing == NSTextField:0x11fe5e450.leading   (active)>",
    "<NSLayoutConstraint:0x600000852800 H:[NSTextField:0x11fe5e450]-(0)-|   (active, names: '|':NSView:0x11fe4b260 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600000852530 NSTextField:0x11fe5dac0.centerX == 0.667*NSSlider:0x11fe4b490.trailing   (active)>

Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens.  And/or, set a symbolic breakpoint on LAYOUT_CONSTRAINTS_NOT_SATISFIABLE to catch this in the debugger.

Steps to reproduce:

  • Pull PR feat: enable hebrew locale #4922

  • Open the IINA project in Xcode

  • Under the Product menu open the Scheme menu and select Edit Scheme…

  • Click on the Options tab

  • Scroll down to the App Language setting

  • In the pull down select Hebrew

  • Start IINA running under Xcode

  • Start playing a video

  • Press ⇧⌘V to show the video panel

  • Notice the labels under the slider for Speed are misaligned or missing

  • MPV does not have this problem.

mpv does not support localization.

How often does this happen?
Every time.

@low-batt low-batt linked a pull request May 3, 2024 that will close this issue
2 tasks
low-batt added a commit that referenced this issue May 8, 2024
This commit will:
- Add outlets for speed slider labels and other components to the
  QuickSettingViewController class
- Add outlets for constraints controlling the position of speed slider
  labels to the QuickSettingViewController class
- Add methods awakeFromNib, calculateSliderLabelMultiplier and
  viewWillLayout to the QuickSettingViewController class to replace
  constraints when in a right to left layout
- Add a convertSpeedToSliderValue method to the
  QuickSettingViewController class to eliminate duplication of a
  formula

These changes cause IINA to replace the layout constraints that control
the position of the labels under the speed slider in the video panel
that identify the speed associated with particular slider tick marks
with constraints that properly position the slider labels when the user
interface layout direction is right to left.
@low-batt low-batt linked a pull request May 8, 2024 that will close this issue
2 tasks
@low-batt low-batt linked a pull request May 8, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant