Commit 64d025a6 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

Conversation View: change UI

Split Conversation view in three section:
1 - peer info and buttons to perform actions
2 - conversation
3 - send message panel

Change-Id: I1732c3ba093ff7b2d65004ddc6d43ef54539403a
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent 5e6ce9dc
......@@ -207,6 +207,10 @@ SET(ringclient_VIEWS
src/views/RoundedTextField.mm
src/views/MessageBubbleView.h
src/views/MessageBubbleView.mm
src/views/SendMessageCell.h
src/views/SendMessageCell.mm
src/views/SendMessagePanel.h
src/views/SendMessagePanel.mm
)
SET(ringclient_OTHERS
......
......@@ -79,8 +79,7 @@
[self.view.layer setBackgroundColor:[NSColor ringGreyHighlight].CGColor];
[self.view.layer setCornerRadius:5.0f];
[sendPanel setWantsLayer:YES];
[sendPanel setLayer:[CALayer layer]];
[messageField setFocusRingType:NSFocusRingTypeNone];
[self setupChat];
......@@ -119,7 +118,11 @@
[contactMethodsPopupButton addItemWithTitle:cm->uri().toNSString()];
}
[contactMethodsPopupButton setEnabled:(contactMethods.length() > 1)];
BOOL isSMultipleCM = (contactMethods.length() > 1);
[contactMethodsPopupButton setEnabled:isSMultipleCM];
[contactMethodsPopupButton setBordered:isSMultipleCM];
[[contactMethodsPopupButton cell] setArrowPosition: !isSMultipleCM ? NSPopUpNoArrow : NSPopUpArrowAtBottom];
[emptyConversationPlaceHolder setHidden:NO];
// Select first cm
......
/*
* Copyright (C) 2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import <Cocoa/Cocoa.h>
@protocol MessageCellDelegate
-(void) focusChanged;
@end
@interface SendMessageCell : NSTextFieldCell
@property (strong, nonatomic) id <MessageCellDelegate> viewDelegate;
@end
/*
* Copyright (C) 2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import "SendMessageCell.h"
@implementation SendMessageCell
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView {
NSColor* textColor;
[self.viewDelegate focusChanged];
[super drawWithFrame:cellFrame inView:controlView];
}
@end
/*
* Copyright (C) 2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import <Cocoa/Cocoa.h>
#import "SendMessageCell.h"
@interface SendMessagePanel : NSView <MessageCellDelegate>
@property (nonatomic, strong) IBOutlet SendMessageCell* messageCell;
@end
/*
* Copyright (C) 2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import "SendMessagePanel.h"
#import "NSColor+RingTheme.h"
@implementation SendMessagePanel
-(void) awakeFromNib {
self.messageCell.viewDelegate = self;
}
- (void)drawRect:(NSRect)dirtyRect {
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(40, dirtyRect.size.height)];
[path lineToPoint:NSMakePoint(dirtyRect.size.width - 40 , dirtyRect.size.height)];
BOOL isEditing = [(NSTextField *)[self.messageCell controlView] currentEditor] != nil;
if(isEditing) {
[[NSColor ringBlue]set];
[path setLineWidth:3];
}
else {
[[NSColor quaternaryLabelColor]set];
[path setLineWidth:2];
}
[path stroke];
[super drawRect:dirtyRect];
}
-(void) focusChanged {
[self setNeedsDisplay:YES];
}
@end
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment