Skip to content

Commit

Permalink
ActionSheet: Fix horizontal layout for PlaybackSpeedView
Browse files Browse the repository at this point in the history
Also improve header with verbose languages.
  • Loading branch information
edrflt committed Oct 27, 2021
1 parent 35412ab commit 227f430
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Resources/Xib/VideoPlayer/NewPlaybackSpeedView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="yaH-mw-hPl" userLabel="padding view">
<rect key="frame" x="0.0" y="10" width="560" height="24.5"/>
<variation key="heightClass=compact" hidden="YES"/>
</view>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="vzh-jn-Qnx">
<rect key="frame" x="0.0" y="54.5" width="560" height="61"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="UGP-1H-Jie"/>
<constraint firstAttribute="height" constant="60" id="UGP-1H-Jie">
<variation key="widthClass=regular" constant="50"/>
</constraint>
</constraints>
<segments>
<segment title="Vitesse de lecture"/>
Expand Down Expand Up @@ -106,20 +109,24 @@
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="E3o-sm-5YH" userLabel="padding view">
<rect key="frame" x="0.0" y="220.5" width="560" height="24.5"/>
<variation key="heightClass=compact" hidden="YES"/>
</view>
</subviews>
<constraints>
<constraint firstItem="E3o-sm-5YH" firstAttribute="height" secondItem="yaH-mw-hPl" secondAttribute="height" id="76D-8J-H2h"/>
</constraints>
<directionalEdgeInsets key="directionalLayoutMargins" top="10" leading="0.0" bottom="10" trailing="0.0"/>
<variation key="heightClass=compact"/>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="Thd-jN-ogA"/>
<gestureRecognizers/>
<constraints>
<constraint firstItem="Thd-jN-ogA" firstAttribute="trailing" secondItem="nwn-Xw-n6u" secondAttribute="trailing" constant="20" id="8AW-PX-fGb"/>
<constraint firstItem="nwn-Xw-n6u" firstAttribute="top" secondItem="Thd-jN-ogA" secondAttribute="top" id="eNn-tL-U4N"/>
<constraint firstItem="Thd-jN-ogA" firstAttribute="bottom" secondItem="nwn-Xw-n6u" secondAttribute="bottom" constant="20" id="m7c-Ok-FSu"/>
<constraint firstItem="Thd-jN-ogA" firstAttribute="bottom" secondItem="nwn-Xw-n6u" secondAttribute="bottom" constant="20" id="m7c-Ok-FSu">
<variation key="heightClass=compact" constant="0.0"/>
</constraint>
<constraint firstItem="nwn-Xw-n6u" firstAttribute="leading" secondItem="Thd-jN-ogA" secondAttribute="leading" constant="20" id="tT4-Aq-KaH"/>
</constraints>
<nil key="simulatedTopBarMetrics"/>
Expand Down
1 change: 1 addition & 0 deletions Sources/ActionSheet/ActionSheetSectionHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class ActionSheetSectionHeader: UIView {
previousButton.tintColor = PresentationTheme.current.colors.orangeUI
previousButton.setContentHuggingPriority(.required, for: .horizontal)
previousButton.setContentHuggingPriority(.required, for: .vertical)
previousButton.setContentCompressionResistancePriority(.required, for: .horizontal)
previousButton.translatesAutoresizingMaskIntoConstraints = false
previousButton.isHidden = true
return previousButton
Expand Down
1 change: 1 addition & 0 deletions Sources/ActionSheet/NewPlaybackSpeedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class NewPlaybackSpeedView: UIView {
resetButton.addTarget(self, action: #selector(self.handleResetTap(_:)), for: .touchUpInside)
resetButton.setContentHuggingPriority(.required, for: .horizontal)
resetButton.setContentHuggingPriority(.required, for: .vertical)
resetButton.setContentCompressionResistancePriority(.required, for: .horizontal)
}

private func setupSegmentedControl() {
Expand Down
1 change: 1 addition & 0 deletions Sources/ActionSheet/VideoFiltersView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class VideoFiltersView: UIView {
resetButton.addTarget(self, action: #selector(self.handleResetButton(_:)), for: .touchUpInside)
resetButton.setContentHuggingPriority(.required, for: .horizontal)
resetButton.setContentHuggingPriority(.required, for: .vertical)
resetButton.setContentCompressionResistancePriority(.required, for: .horizontal)
}

private func setupSliders() {
Expand Down

0 comments on commit 227f430

Please sign in to comment.