Settings: Add enable room message bubbles parameter.

This commit is contained in:
SBiOSoftWhare
2022-01-03 18:30:59 +01:00
parent 410bf07e84
commit b69fa7cc31
4 changed files with 37 additions and 2 deletions
+28 -2
View File
@@ -127,7 +127,8 @@ enum {
enum
{
USER_INTERFACE_LANGUAGE_INDEX = 0,
USER_INTERFACE_THEME_INDEX
USER_INTERFACE_THEME_INDEX,
USER_INTERFACE_TIMELINE_STYLE_INDEX
};
enum
@@ -499,9 +500,16 @@ TableViewSectionsDelegate>
}
Section *sectionUserInterface = [Section sectionWithTag:SECTION_TAG_USER_INTERFACE];
sectionUserInterface.headerTitle = [VectorL10n settingsUserInterface];
[sectionUserInterface addRowWithTag:USER_INTERFACE_LANGUAGE_INDEX];
[sectionUserInterface addRowWithTag:USER_INTERFACE_THEME_INDEX];
sectionUserInterface.headerTitle = [VectorL10n settingsUserInterface];
if (BuildSettings.roomScreenAllowTimelineStyleConfiguration)
{
[sectionUserInterface addRowWithTag:USER_INTERFACE_TIMELINE_STYLE_INDEX];
}
[tmpSections addObject: sectionUserInterface];
Section *sectionAdvanced = [Section sectionWithTag:SECTION_TAG_ADVANCED];
@@ -2196,6 +2204,19 @@ TableViewSectionsDelegate>
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
cell.selectionStyle = UITableViewCellSelectionStyleDefault;
}
else if (row == USER_INTERFACE_TIMELINE_STYLE_INDEX)
{
MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
labelAndSwitchCell.mxkLabel.text = [VectorL10n settingsEnableRoomMessageBubbles];
labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.roomScreenEnableMessageBubbles;
labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
labelAndSwitchCell.mxkSwitch.enabled = YES;
[labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableRoomMessageBubbles:) forControlEvents:UIControlEventTouchUpInside];
cell = labelAndSwitchCell;
}
}
else if (section == SECTION_TAG_IGNORED_USERS)
{
@@ -3839,6 +3860,11 @@ TableViewSectionsDelegate>
RiotSettings.shared.showNSFWPublicRooms = sender.isOn;
}
- (void)toggleEnableRoomMessageBubbles:(UISwitch *)sender
{
RiotSettings.shared.roomScreenEnableMessageBubbles = sender.isOn;
}
#pragma mark - TextField listener
- (IBAction)textFieldDidChange:(id)sender