Skip to content

Commit eaf44b0

Browse files
authored
Merge pull request #1893 from nextcloud/fix/1884/replace-link-icon
2 parents 756c921 + 137c491 commit eaf44b0

File tree

6 files changed

+35
-9
lines changed

6 files changed

+35
-9
lines changed

NextcloudTalk/AvatarView.swift

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,13 @@ import SDWebImage
126126
setUserStatus(roomStatus, with: backgroundColor)
127127
}
128128
} else if room.isPublic {
129-
if let statusImage = statusImageWith(name: "link", color: .label, padding: 4) {
130-
setUserStatusImage(statusImage, with: backgroundColor)
129+
if let statusImage = UIImage(named: "link") {
130+
let diameter = statusImageSize(padding: 2)
131+
let size = CGSize(width: diameter, height: diameter)
132+
if let configuredImage = NCUtils.renderAspectImage(image: statusImage, ofSize: size, centerImage: true)?.withRenderingMode(.alwaysTemplate) {
133+
setUserStatusImage(configuredImage, with: backgroundColor)
134+
userStatusImageView.tintColor = .label
135+
}
131136
}
132137
} else if room.isFederated {
133138
if let statusImage = statusImageWith(name: "globe", color: .label, padding: 3) {
@@ -173,8 +178,7 @@ import SDWebImage
173178
}
174179

175180
private func statusImageWith(name: String, color: UIColor, secondaryColor: UIColor? = nil, padding: CGFloat) -> UIImage? {
176-
let userStatusSize = self.frame.size.height * userStatusSizePercentage - padding * 2
177-
let sizeConfiguration = UIImage.SymbolConfiguration(pointSize: userStatusSize)
181+
let sizeConfiguration = UIImage.SymbolConfiguration(pointSize: statusImageSize(padding: padding))
178182

179183
// Multicolor image
180184
if let secondaryColor {
@@ -195,4 +199,8 @@ import SDWebImage
195199

196200
return nil
197201
}
202+
203+
private func statusImageSize(padding: CGFloat) -> CGFloat {
204+
return self.frame.size.height * userStatusSizePercentage - padding * 2
205+
}
198206
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "icon-public-white.svg",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
},
12+
"properties" : {
13+
"preserves-vector-representation" : true
14+
}
15+
}
Lines changed: 3 additions & 0 deletions
Loading

NextcloudTalk/RoomCreationTableViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,12 +467,12 @@ enum RoomVisibilityOption: Int {
467467
switch option {
468468
case RoomVisibilityOption.kAllowGuestsOption.rawValue:
469469
roomVisibilityOptionCell = tableView.dequeueOrCreateCell(withIdentifier: "AllowGuestsCellIdentifier")
470-
roomVisibilityOptionCell.textLabel?.text = NSLocalizedString("Allow guests", comment: "")
470+
roomVisibilityOptionCell.textLabel?.text = NSLocalizedString("Allow guests to join this conversation via link", comment: "")
471471
let optionSwicth = UISwitch()
472472
optionSwicth.isOn = self.isPublic
473473
optionSwicth.addTarget(self, action: #selector(allowGuestValueChanged(_:)), for: .valueChanged)
474474
roomVisibilityOptionCell.accessoryView = optionSwicth
475-
roomVisibilityOptionCell.imageView?.image = UIImage(systemName: "link")
475+
roomVisibilityOptionCell.imageView?.image = UIImage(named: "link")?.withRenderingMode(.alwaysTemplate)
476476
case RoomVisibilityOption.kPasswordProtectionOption.rawValue:
477477
roomVisibilityOptionCell = tableView.dequeueOrCreateCell(withIdentifier: "SetPasswordCellIdentifier")
478478
roomVisibilityOptionCell.textLabel?.text = self.roomPassword.isEmpty ? NSLocalizedString("Set password", comment: "") : NSLocalizedString("Change password", comment: "")

NextcloudTalk/RoomInfoTableViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,12 +2032,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
20322032
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:allowGuestsCellIdentifier];
20332033
}
20342034

2035-
cell.textLabel.text = NSLocalizedString(@"Allow guests", nil);
2035+
cell.textLabel.text = NSLocalizedString(@"Allow guests to join this conversation via link", nil);
20362036
cell.textLabel.numberOfLines = 0;
20372037
cell.selectionStyle = UITableViewCellSelectionStyleNone;
20382038
cell.accessoryView = _publicSwitch;
20392039
_publicSwitch.on = (_room.type == kNCRoomTypePublic) ? YES : NO;
2040-
[cell.imageView setImage:[UIImage systemImageNamed:@"link"]];
2040+
[cell.imageView setImage:[[UIImage imageNamed:@"link"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]];
20412041
cell.imageView.tintColor = [UIColor secondaryLabelColor];
20422042

20432043
return cell;

NextcloudTalk/en.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"All notifications are muted" = "All notifications are muted";
129129

130130
/* No comment provided by engineer. */
131-
"Allow guests" = "Allow guests";
131+
"Allow guests to join this conversation via link" = "Allow guests to join this conversation via link";
132132

133133
/* '@all' should not be translated */
134134
"Allow participants to mention @all" = "Allow participants to mention @all";

0 commit comments

Comments
 (0)