mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 10:02:46 +02:00
merged element-ios 1.10.5 into 4409_basis_update_1_10_5
This commit is contained in:
@@ -71,12 +71,15 @@ struct Composer: View {
|
||||
}
|
||||
|
||||
private var formatItems: [FormatItem] {
|
||||
FormatType.allCases.map { type in
|
||||
FormatItem(
|
||||
type: type,
|
||||
state: wysiwygViewModel.actionStates[type.composerAction] ?? .disabled
|
||||
)
|
||||
}
|
||||
return FormatType.allCases
|
||||
// Exclude indent type outside of lists.
|
||||
.filter { wysiwygViewModel.isInList || !$0.isIndentType }
|
||||
.map { type in
|
||||
FormatItem(
|
||||
type: type,
|
||||
state: wysiwygViewModel.actionStates[type.composerAction] ?? .disabled
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private var composerContainer: some View {
|
||||
@@ -257,6 +260,13 @@ struct Composer: View {
|
||||
}
|
||||
}
|
||||
|
||||
private extension WysiwygComposerViewModel {
|
||||
/// Return true if the selection of the composer is currently located in a list.
|
||||
var isInList: Bool {
|
||||
actionStates[.orderedList] == .reversed || actionStates[.unorderedList] == .reversed
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Previews
|
||||
|
||||
struct Composer_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user