mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-11-02 20:12:44 +08:00
[fix] adapt iOS keyboard switch widths to localized text
This commit is contained in:
@@ -323,6 +323,7 @@ final class RemoteKeyboardInputBar: UIView {
|
||||
let computerButton = UIButton(type: .system)
|
||||
computerButton.setTitle(NSLocalizedString("电脑键盘", comment: ""), for: .normal)
|
||||
computerButton.titleLabel?.font = .systemFont(ofSize: 15, weight: .medium)
|
||||
computerButton.setContentHuggingPriority(.defaultHigh, for: .horizontal)
|
||||
computerButton.accessibilityLabel = NSLocalizedString("切换到电脑键盘", comment: "")
|
||||
computerButton.addTarget(self, action: #selector(switchToComputer), for: .touchUpInside)
|
||||
|
||||
@@ -337,7 +338,8 @@ final class RemoteKeyboardInputBar: UIView {
|
||||
row.translatesAutoresizingMaskIntoConstraints = false
|
||||
addSubview(row)
|
||||
NSLayoutConstraint.activate([
|
||||
computerButton.widthAnchor.constraint(equalToConstant: 80),
|
||||
// Keep the minimum touch width while allowing longer translations.
|
||||
computerButton.widthAnchor.constraint(greaterThanOrEqualToConstant: 80),
|
||||
dismissButton.widthAnchor.constraint(equalToConstant: RemoteKeyboardDismissButton.sideLength),
|
||||
row.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor, constant: 4),
|
||||
row.trailingAnchor.constraint(equalTo: safeAreaLayoutGuide.trailingAnchor, constant: -4),
|
||||
|
||||
@@ -855,7 +855,8 @@ private struct RemoteComputerKeyboard: View {
|
||||
switchKeyboard()
|
||||
}
|
||||
.font(.system(size: 15, weight: .medium))
|
||||
.frame(width: 80, height: 44)
|
||||
.fixedSize(horizontal: true, vertical: false)
|
||||
.frame(minWidth: 80, minHeight: 44)
|
||||
.accessibilityLabel(NSLocalizedString("切换到系统键盘", comment: ""))
|
||||
if verticalSizeClass == .compact {
|
||||
pageTabs
|
||||
|
||||
Reference in New Issue
Block a user