mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
MESSENGER-5358 add switch in settings for wysiwyg composer
This commit is contained in:
@@ -173,7 +173,8 @@ typedef NS_ENUM(NSUInteger, USER_INTERFACE)
|
||||
TIMELINE_ENTER_ROOM_INDEX,
|
||||
USER_INTERFACE_LANGUAGE_INDEX,
|
||||
USER_INTERFACE_TIMELINE_STYLE_INDEX,
|
||||
PERSONAL_NOTES_INDEX
|
||||
PERSONAL_NOTES_INDEX,
|
||||
WYSIWYG_COMPOSER_INDEX
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSUInteger, TIMELINE)
|
||||
@@ -705,6 +706,10 @@ SSOAuthenticationPresenterDelegate>
|
||||
|
||||
[tmpSections addObject:sectionPresence];
|
||||
}
|
||||
// bwi: #5358 the user should be able to switch back to the old composer
|
||||
if (BWIBuildSettings.shared.bwiWYSIWYGVisibilityInSettings) {
|
||||
[sectionUserInterface addRowWithTag:WYSIWYG_COMPOSER_INDEX];
|
||||
};
|
||||
|
||||
Section *sectionAdvanced = [Section sectionWithTag:SECTION_TAG_ADVANCED];
|
||||
sectionAdvanced.headerTitle = [VectorL10n settingsAdvanced];
|
||||
@@ -2583,7 +2588,11 @@ SSOAuthenticationPresenterDelegate>
|
||||
} else if (row == PERSONAL_NOTES_INDEX)
|
||||
{
|
||||
cell = [self cellForPersonalNotesVisibility:tableView indexPath:indexPath row:row];
|
||||
} else {
|
||||
} else if (row == WYSIWYG_COMPOSER_INDEX)
|
||||
{
|
||||
cell = [self toggleWYSIWYGComposer:tableView indexPath:indexPath row:row];
|
||||
} else
|
||||
{
|
||||
cell = [self cellForTimeline:tableView indexPath:indexPath row:row];
|
||||
}
|
||||
}
|
||||
@@ -5482,6 +5491,20 @@ SSOAuthenticationPresenterDelegate>
|
||||
settings.personalNotesVisible = sender.on;
|
||||
}
|
||||
|
||||
- (UITableViewCell*) toggleWYSIWYGComposer:(UITableView*)tableView indexPath:(NSIndexPath*)indexPath row:(NSInteger)row {
|
||||
MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
|
||||
|
||||
labelAndSwitchCell.mxkLabel.text = [BWIL10n bwiSettingsEnableWysiwygComposer];
|
||||
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableWysiwygComposer;
|
||||
labelAndSwitchCell.mxkSwitch.thumbTintColor = ThemeService.shared.theme.backgroundColor;
|
||||
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
|
||||
|
||||
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableWysiwygComposerFeature:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
return labelAndSwitchCell;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - ThreadsBetaCoordinatorBridgePresenterDelegate
|
||||
|
||||
- (void)threadsBetaCoordinatorBridgePresenterDelegateDidTapEnable:(ThreadsBetaCoordinatorBridgePresenter *)coordinatorBridgePresenter
|
||||
|
||||
Reference in New Issue
Block a user