mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
remove code related to the previous bidi usage implementation of whitespaces for the timestamp label
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// Copyright 2025 Element Creations Ltd.
|
||||
// Copyright 2023-2025 New Vector Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
extension LayoutDirection {
|
||||
var isolateLayoutUnicodeString: String {
|
||||
switch self {
|
||||
case .leftToRight:
|
||||
return "\u{2066}"
|
||||
case .rightToLeft:
|
||||
return "\u{2067}"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,22 +41,6 @@ extension String {
|
||||
}
|
||||
}
|
||||
|
||||
extension String {
|
||||
static func generateBreakableWhitespaceEnd(whitespaceCount: Int, layoutDirection: LayoutDirection) -> String {
|
||||
guard whitespaceCount > 0 else {
|
||||
return ""
|
||||
}
|
||||
|
||||
var whiteSpaces = layoutDirection.isolateLayoutUnicodeString
|
||||
|
||||
// fixed size whitespace of size 1/3 em per character
|
||||
whiteSpaces += String(repeating: "\u{2004}", count: whitespaceCount)
|
||||
|
||||
// braille whitespace, which is non breakable but makes previous whitespaces breakable
|
||||
return whiteSpaces + "\u{2800}"
|
||||
}
|
||||
}
|
||||
|
||||
extension String {
|
||||
func ellipsize(length: Int) -> String {
|
||||
guard count > length else {
|
||||
|
||||
Reference in New Issue
Block a user