Add spacing between the Jitsi and Threads toolbar buttons.

This commit is contained in:
Doug
2022-06-21 09:46:28 +01:00
committed by Doug
parent 9817b92419
commit 6eed50fd9a
3 changed files with 44 additions and 12 deletions
+33 -12
View File
@@ -1547,6 +1547,38 @@ static CGSize kThreadListBarButtonItemImageSize;
return item;
}
- (UIBarButtonItem *)joinJitsiBarButtonItem
{
CallTileActionButton *button = [CallTileActionButton new];
[button setImage:AssetImages.callVideoIcon.image
forState:UIControlStateNormal];
[button setTitle:[VectorL10n roomJoinGroupCall]
forState:UIControlStateNormal];
[button addTarget:self
action:@selector(onVideoCallPressed:)
forControlEvents:UIControlEventTouchUpInside];
button.contentEdgeInsets = UIEdgeInsetsMake(4, 12, 4, 12);
UIBarButtonItem *item;
if (RiotSettings.shared.enableThreads)
{
// Add some spacing when there is a threads button
UIView *buttonContainer = [[UIView alloc] initWithFrame:CGRectZero];
[buttonContainer vc_addSubViewMatchingParent:button withInsets:UIEdgeInsetsMake(0, 0, 0, -12)];
item = [[UIBarButtonItem alloc] initWithCustomView:buttonContainer];
}
else
{
item = [[UIBarButtonItem alloc] initWithCustomView:button];
}
item.accessibilityLabel = [VectorL10n roomAccessibilityVideoCall];
return item;
}
- (UIBarButtonItem *)threadMoreBarButtonItem
{
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:AssetImages.roomContextMenuMore.image
@@ -1751,18 +1783,7 @@ static CGSize kThreadListBarButtonItemImageSize;
}
else
{
// show Join button
CallTileActionButton *button = [CallTileActionButton new];
[button setImage:AssetImages.callVideoIcon.image
forState:UIControlStateNormal];
[button setTitle:[VectorL10n roomJoinGroupCall]
forState:UIControlStateNormal];
[button addTarget:self
action:@selector(onVideoCallPressed:)
forControlEvents:UIControlEventTouchUpInside];
button.contentEdgeInsets = UIEdgeInsetsMake(4, 12, 4, 12);
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:button];
item.accessibilityLabel = [VectorL10n roomAccessibilityVideoCall];
UIBarButtonItem *item = [self joinJitsiBarButtonItem];
[rightBarButtonItems addObject:item];
hasCustomJoinButton = YES;