From efc665dc84235039932d36da9c84a7349664e746 Mon Sep 17 00:00:00 2001
From: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
Date: Mon, 17 Sep 2018 15:42:43 -0400
Subject: [PATCH] UI: messages view

Enable gif animation

Change-Id: I28371de138e5b9e05303bb1c0cf7f2b63f2c68a3
---
 src/MessagesVC.mm              | 34 +++++++-----
 src/views/IMTableCellView.h    |  4 +-
 src/views/IMTableCellView.mm   | 20 +++++++-
 src/views/IconButton.h         |  7 +++
 src/views/IconButton.mm        | 56 ++++++++++++++++++++
 ui/Base.lproj/MessageCells.xib | 94 ++++++++++++++++++++++++----------
 6 files changed, 171 insertions(+), 44 deletions(-)

diff --git a/src/MessagesVC.mm b/src/MessagesVC.mm
index 44e9033b..41fc300e 100644
--- a/src/MessagesVC.mm
+++ b/src/MessagesVC.mm
@@ -351,15 +351,15 @@ typedef NS_ENUM(NSInteger, MessageSequencing) {
                                   paragraphStyle,NSParagraphStyleAttributeName, nil];
         NSAttributedString* alternativeString = [[NSAttributedString alloc] initWithString:fileName attributes:alternativeNametAttr];
         result.transferedFileName.attributedAlternateTitle = alternativeString;
-        NSImage* image = [self getImageForFilePath:name size:MAX_TRANSFERED_IMAGE_SIZE];
+        NSImage* image = [self getImageForFilePath:name];
         if (([name rangeOfString:@"/"].location == NSNotFound)) {
-            image = [self getImageForFilePath:[self getDataTransferPath:interactionID] size:MAX_TRANSFERED_IMAGE_SIZE];
+            image = [self getImageForFilePath:[self getDataTransferPath:interactionID]];
         }
         if(image != nil) {
-            result.transferedImage.image = [image roundCorners:14];
-            [result updateImageConstraint:image.size.width andHeight:image.size.height];
-            [result.transferedImage setAction:@selector(imagePreview:)];
-            [result.transferedImage setTarget:self];
+            result.transferedImage.image = image;
+            [result updateImageConstraintWithMax: MAX_TRANSFERED_IMAGE_SIZE];
+            [result.openImagebutton setAction:@selector(imagePreview:)];
+            [result.openImagebutton setTarget:self];
         }
     }
     [result setupForInteraction:interactionID];
@@ -525,12 +525,21 @@ typedef NS_ENUM(NSInteger, MessageSequencing) {
 
         if( interaction.status == lrc::api::interaction::Status::TRANSFER_FINISHED) {
             NSString* name =  @(interaction.body.c_str());
-            NSImage* image = [self getImageForFilePath:name size:MAX_TRANSFERED_IMAGE_SIZE];
+            NSImage* image = [self getImageForFilePath:name];
             if (([name rangeOfString:@"/"].location == NSNotFound)) {
-                image = [self getImageForFilePath:[self getDataTransferPath:it->first] size:MAX_TRANSFERED_IMAGE_SIZE];
+                image = [self getImageForFilePath:[self getDataTransferPath:it->first]];
             }
             if (image != nil) {
-                return image.size.height + TIME_BOX_HEIGHT;
+                CGFloat widthScaleFactor = MAX_TRANSFERED_IMAGE_SIZE / image.size.width;
+                CGFloat heightScaleFactor = MAX_TRANSFERED_IMAGE_SIZE / image.size.height;
+                CGFloat heigt = 0;
+                if((widthScaleFactor >= 1) && (heightScaleFactor >= 1)) {
+                    heigt = image.size.height;
+                } else {
+                    CGFloat scale = MIN(widthScaleFactor, heightScaleFactor);
+                    heigt = image.size.height * scale;
+                }
+                return heigt + TIME_BOX_HEIGHT;
             }
         }
         return BUBBLE_HEIGHT_FOR_TRANSFERED_FILE + TIME_BOX_HEIGHT;
@@ -573,14 +582,11 @@ typedef NS_ENUM(NSInteger, MessageSequencing) {
     return @(info.path.c_str());
 }
 
--(NSImage*) getImageForFilePath: (NSString *) path size:(CGFloat)size {
+-(NSImage*) getImageForFilePath: (NSString *) path {
     if (path.length <= 0) {return nil;}
     if (![[NSFileManager defaultManager] fileExistsAtPath: path]) {return nil;}
     NSImage* transferedImage = [[NSImage alloc] initWithContentsOfFile: path];
-    if(transferedImage != nil) {
-        return [transferedImage imageResizeInsideMax: size];
-    }
-    return nil;
+    return transferedImage;
 }
 
 -(CGSize) sizeFor:(NSString *) message maxWidth:(CGFloat) width {
diff --git a/src/views/IMTableCellView.h b/src/views/IMTableCellView.h
index 8a920484..d4867b9e 100644
--- a/src/views/IMTableCellView.h
+++ b/src/views/IMTableCellView.h
@@ -33,10 +33,11 @@
 @property (nonatomic, strong) IBOutlet NSBox* timeBox;
 @property (nonatomic, strong) IBOutlet NSTextField* timeLabel;
 @property (nonatomic, strong) IBOutlet NSButton* transferedFileName;
-@property (nonatomic, strong) IBOutlet NSButton* transferedImage;
+@property (nonatomic, strong) IBOutlet NSImageView* transferedImage;
 @property (nonatomic, strong) IBOutlet NSProgressIndicator* sendingMessageIndicator;
 @property (nonatomic, strong) IBOutlet NSImageView* messageFailed;
 @property (nonatomic, strong) IBOutlet NSView* messageStatus;
+@property (nonatomic, strong) IBOutlet NSButton* openImagebutton;
 
 
 - (uint64_t) interaction;
@@ -44,6 +45,7 @@
 - (void) setupForInteraction:(uint64_t)inter;
 - (void) updateMessageConstraint:(CGFloat) width andHeight: (CGFloat) height timeIsVisible: (bool) visible isTopPadding: (bool) padding;
 - (void) updateImageConstraint: (CGFloat) width andHeight: (CGFloat) height;
+- (void) updateImageConstraintWithMax: (CGFloat) maxDimension;
 - (void) invalidateImageConstraints;
 
 @end
diff --git a/src/views/IMTableCellView.mm b/src/views/IMTableCellView.mm
index 35acca50..06de03ec 100644
--- a/src/views/IMTableCellView.mm
+++ b/src/views/IMTableCellView.mm
@@ -21,6 +21,7 @@
 #import "IMTableCellView.h"
 #import "NSColor+RingTheme.h"
 
+
 @implementation IMTableCellView {
     uint64_t interaction;
 }
@@ -34,6 +35,7 @@ NSString* const TIME_BOX_HEIGHT = @"34";
 @synthesize declineButton;
 @synthesize progressIndicator;
 @synthesize statusLabel;
+@synthesize openImagebutton;
 
 - (void) setupDirection
 {
@@ -57,8 +59,6 @@ NSString* const TIME_BOX_HEIGHT = @"34";
     [self.msgView setTranslatesAutoresizingMaskIntoConstraints:NO];
     [self.msgBackground setTranslatesAutoresizingMaskIntoConstraints:NO];
     [self.msgView setEditable:NO];
-    [(NSButtonCell*)transferedImage.cell setShowsStateBy:NSNoCellMask];
-    [(NSButtonCell*)transferedImage.cell setHighlightsBy:NSNoCellMask];
     acceptButton.image = [NSColor image: [NSImage imageNamed:@"ic_file_upload.png"] tintedWithColor:[NSColor greenSuccessColor]];
     declineButton.image = [NSColor image: [NSImage imageNamed:@"ic_action_cancel.png"] tintedWithColor:[NSColor redColor]];
 }
@@ -130,6 +130,22 @@ NSString* const TIME_BOX_HEIGHT = @"34";
     [NSLayoutConstraint activateConstraints:constraintsHorizontal];
 }
 
+- (void) updateImageConstraintWithMax: (CGFloat) maxDimension {
+    if(!self.transferedImage) {return;}
+    CGFloat widthScaleFactor = maxDimension / transferedImage.image.size.width;
+    CGFloat heightScaleFactor = maxDimension / transferedImage.image.size.height;
+    NSSize size = NSZeroSize;
+    if((widthScaleFactor >= 1) && (heightScaleFactor >= 1)) {
+        size.width = transferedImage.image.size.width;
+        size.height = transferedImage.image.size.height;
+    } else {
+        CGFloat scale = MIN(widthScaleFactor, heightScaleFactor);
+        size.width = transferedImage.image.size.width * scale;
+        size.height = transferedImage.image.size.height * scale;
+    }
+    [self updateImageConstraint:size.width andHeight: size.height];
+}
+
 - (void) invalidateImageConstraints {
 [NSLayoutConstraint deactivateConstraints:[self.transferedImage constraints]];
 }
diff --git a/src/views/IconButton.h b/src/views/IconButton.h
index cd71176b..4a072987 100644
--- a/src/views/IconButton.h
+++ b/src/views/IconButton.h
@@ -76,5 +76,12 @@
 
 @property (nonatomic, strong) NSColor* buttonDisableColor;
 
+/*
+ * Color of the button corners. Draw circle with cornerRadius filled with bgColor
+ * and fill corner with cornerColor
+ */
+@property (nonatomic, strong) NSColor* cornerColor;
+
+
 
 @end
diff --git a/src/views/IconButton.mm b/src/views/IconButton.mm
index 4002903b..26939936 100644
--- a/src/views/IconButton.mm
+++ b/src/views/IconButton.mm
@@ -123,6 +123,62 @@
         NSBezierPath* ovalPath = [NSBezierPath bezierPathWithRoundedRect:dirtyRect
                                                                  xRadius:[self.cornerRadius floatValue]
                                                                  yRadius:[self.cornerRadius floatValue]];
+        if(self.cornerColor) {
+            NSRect frame = [self frame];
+
+            [backgroundColor setFill];
+            [ovalPath fill];
+            [NSGraphicsContext saveGraphicsState];
+
+            CGPoint top = CGPointMake(frame.size.width * 0.5, 0);
+            CGPoint right = CGPointMake(frame.size.width, frame.size.height * 0.5);
+            CGPoint bottom = CGPointMake(frame.size.width * 0.5, frame.size.height);
+            CGPoint left = CGPointMake(0, frame.size.height * 0.5);
+            CGPoint topLeft = CGPointMake(0, 0);
+            CGPoint topRight = CGPointMake(frame.size.width, 0);
+            CGPoint bottomLeft = CGPointMake(0, frame.size.height);
+            CGPoint bottomRight = CGPointMake(frame.size.width, frame.size.height);
+
+            NSBezierPath* topLeftPath = [[NSBezierPath alloc] init];
+            NSPoint pointArrayLeft[3];
+            pointArrayLeft[0] = left;
+            pointArrayLeft[1] = topLeft;
+            pointArrayLeft[2] = top;
+
+            [topLeftPath appendBezierPathWithPoints:pointArrayLeft count:3];
+            [topLeftPath appendBezierPathWithArcFromPoint: topLeft toPoint: left radius: 20.0f];
+            [self.cornerColor setFill];
+            [topLeftPath fill];
+
+            NSBezierPath* topRightPath = [[NSBezierPath alloc] init];
+            NSPoint pointArrayTop[3];
+            pointArrayTop[0] = top;
+            pointArrayTop[1] = topRight;
+            pointArrayTop[2] = right;
+            [topRightPath appendBezierPathWithPoints:pointArrayTop count:3];
+            [topRightPath appendBezierPathWithArcFromPoint: topRight toPoint: top radius: 20.0f];
+            [topRightPath fill];
+
+            NSBezierPath* bottomLeftPath = [[NSBezierPath alloc] init];
+            NSPoint pointArrayRight[3];
+            pointArrayRight[0] = right;
+            pointArrayRight[1] = bottomRight;
+            pointArrayRight[2] = bottom;
+            [bottomLeftPath appendBezierPathWithPoints:pointArrayRight count:3];
+            [bottomLeftPath appendBezierPathWithArcFromPoint: bottomRight toPoint: right radius: 20.0f];
+            [bottomLeftPath fill];
+
+            NSBezierPath* bottomRightPath = [[NSBezierPath alloc] init];
+            NSPoint pointArrayBottom[3];
+            pointArrayBottom[0] = bottom;
+            pointArrayBottom[1] = bottomLeft;
+            pointArrayBottom[2] = left;
+            [bottomRightPath appendBezierPathWithPoints:pointArrayBottom count:3];
+            [bottomRightPath appendBezierPathWithArcFromPoint: bottomLeft toPoint: bottom radius: 20.0f];
+            [bottomRightPath fill];
+            [NSGraphicsContext saveGraphicsState];
+            return;
+        }
 
         [backgroundColor setFill];
         [ovalPath fill];
diff --git a/ui/Base.lproj/MessageCells.xib b/ui/Base.lproj/MessageCells.xib
index f1b7ce09..717a3843 100644
--- a/ui/Base.lproj/MessageCells.xib
+++ b/ui/Base.lproj/MessageCells.xib
@@ -128,11 +128,11 @@
             <point key="canvasLocation" x="139" y="167"/>
         </tableCellView>
         <tableCellView identifier="LeftFinishedFileView" id="eW8-NR-350" userLabel="IMTableCellView" customClass="IMTableCellView">
-            <rect key="frame" x="0.0" y="0.0" width="264" height="172"/>
+            <rect key="frame" x="0.0" y="0.0" width="264" height="57"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
                 <box boxType="custom" borderType="none" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="EAm-7Z-ubs">
-                    <rect key="frame" x="0.0" y="138" width="264" height="34"/>
+                    <rect key="frame" x="0.0" y="23" width="264" height="34"/>
                     <view key="contentView" id="vWe-2x-kXT">
                         <rect key="frame" x="0.0" y="0.0" width="264" height="34"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -167,10 +167,10 @@
                     <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="CbP-fL-hnq"/>
                 </imageView>
                 <view translatesAutoresizingMaskIntoConstraints="NO" id="rfH-MI-dNw" customClass="MessageBubbleView">
-                    <rect key="frame" x="40" y="0.0" width="250" height="138"/>
+                    <rect key="frame" x="40" y="0.0" width="250" height="23"/>
                     <subviews>
                         <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gXD-VF-3Sl">
-                            <rect key="frame" x="15" y="103" width="30" height="20"/>
+                            <rect key="frame" x="15" y="-12" width="30" height="20"/>
                             <constraints>
                                 <constraint firstAttribute="width" constant="30" id="6H8-jT-mn3"/>
                                 <constraint firstAttribute="height" constant="20" id="R4X-bF-Ge1"/>
@@ -178,7 +178,7 @@
                             <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageAlignment="left" imageScaling="proportionallyDown" image="ic_attachment" id="yjj-R0-GLl"/>
                         </imageView>
                         <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="NbG-jg-Rsk">
-                            <rect key="frame" x="55" y="105" width="180" height="18"/>
+                            <rect key="frame" x="55" y="-10" width="180" height="18"/>
                             <buttonCell key="cell" type="square" title="Round Rect" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="8CE-a4-Ayu">
                                 <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
                                 <font key="font" metaFont="system" size="14"/>
@@ -193,7 +193,7 @@
                             </textFieldCell>
                         </textField>
                         <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="ypT-pD-ceZ">
-                            <rect key="frame" x="15" y="85" width="220" height="5"/>
+                            <rect key="frame" x="15" y="-30" width="220" height="5"/>
                         </box>
                     </subviews>
                     <constraints>
@@ -210,35 +210,55 @@
                         <constraint firstItem="NbG-jg-Rsk" firstAttribute="top" secondItem="rfH-MI-dNw" secondAttribute="top" constant="15" id="wGz-05-VEt"/>
                     </constraints>
                 </view>
-                <button ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hxG-Yd-cRF">
-                    <rect key="frame" x="40" y="0.0" width="48" height="138"/>
-                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="fOs-co-GVj">
+                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="wGS-P4-qNL">
+                    <rect key="frame" x="40" y="0.0" width="10" height="23"/>
+                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" animates="YES" imageScaling="proportionallyUpOrDown" id="Sav-r4-aC6"/>
+                </imageView>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7XH-9N-c5g" customClass="HoverButton">
+                    <rect key="frame" x="40" y="0.0" width="10" height="23"/>
+                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" alignment="center" borderStyle="border" transparent="YES" imageScaling="proportionallyDown" inset="2" id="25g-in-yWt">
                         <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                         <font key="font" metaFont="system"/>
                     </buttonCell>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="color" keyPath="cornerColor">
+                            <color key="value" red="0.94117647058823528" green="0.94117647058823528" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
+                        </userDefinedRuntimeAttribute>
+                        <userDefinedRuntimeAttribute type="color" keyPath="hoverColor">
+                            <color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.20000000000000001" colorSpace="calibratedRGB"/>
+                        </userDefinedRuntimeAttribute>
+                        <userDefinedRuntimeAttribute type="color" keyPath="highlightColor">
+                            <color key="value" white="0.0" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
                 </button>
             </subviews>
             <constraints>
-                <constraint firstItem="hxG-Yd-cRF" firstAttribute="top" secondItem="EAm-7Z-ubs" secondAttribute="bottom" id="39u-ZX-g6R"/>
-                <constraint firstItem="hxG-Yd-cRF" firstAttribute="leading" secondItem="BPl-0q-GSo" secondAttribute="trailing" constant="10" id="3oQ-t9-qcp"/>
                 <constraint firstItem="rfH-MI-dNw" firstAttribute="leading" secondItem="BPl-0q-GSo" secondAttribute="trailing" constant="10" id="611-lJ-BBQ"/>
+                <constraint firstItem="7XH-9N-c5g" firstAttribute="bottom" secondItem="wGS-P4-qNL" secondAttribute="bottom" id="7xg-xB-k0N"/>
                 <constraint firstItem="rfH-MI-dNw" firstAttribute="top" secondItem="EAm-7Z-ubs" secondAttribute="bottom" id="HIj-cX-wOT"/>
                 <constraint firstItem="EAm-7Z-ubs" firstAttribute="leading" secondItem="eW8-NR-350" secondAttribute="leading" id="JhW-lj-cC3"/>
+                <constraint firstAttribute="bottom" secondItem="wGS-P4-qNL" secondAttribute="bottom" id="NGw-Kb-y44"/>
+                <constraint firstItem="7XH-9N-c5g" firstAttribute="trailing" secondItem="wGS-P4-qNL" secondAttribute="trailing" id="OEw-jb-FKE"/>
                 <constraint firstAttribute="trailing" secondItem="EAm-7Z-ubs" secondAttribute="trailing" id="Q5D-pe-Xft"/>
-                <constraint firstAttribute="bottom" secondItem="hxG-Yd-cRF" secondAttribute="bottom" id="U5P-2F-5pI"/>
                 <constraint firstItem="EAm-7Z-ubs" firstAttribute="top" secondItem="eW8-NR-350" secondAttribute="top" id="W4u-5d-H5k"/>
                 <constraint firstItem="BPl-0q-GSo" firstAttribute="leading" secondItem="eW8-NR-350" secondAttribute="leading" id="Y7M-PN-14V"/>
+                <constraint firstItem="7XH-9N-c5g" firstAttribute="leading" secondItem="wGS-P4-qNL" secondAttribute="leading" id="mLF-3I-e1L"/>
+                <constraint firstItem="wGS-P4-qNL" firstAttribute="top" secondItem="EAm-7Z-ubs" secondAttribute="bottom" id="q6v-Q9-mg2"/>
                 <constraint firstItem="rfH-MI-dNw" firstAttribute="bottom" secondItem="BPl-0q-GSo" secondAttribute="bottom" id="s5i-QD-LqE"/>
                 <constraint firstAttribute="bottom" secondItem="rfH-MI-dNw" secondAttribute="bottom" id="vyt-jC-mVO"/>
+                <constraint firstItem="7XH-9N-c5g" firstAttribute="top" secondItem="wGS-P4-qNL" secondAttribute="top" id="z8d-A5-a2s"/>
+                <constraint firstItem="wGS-P4-qNL" firstAttribute="leading" secondItem="BPl-0q-GSo" secondAttribute="trailing" constant="10" id="zlY-t4-J7v"/>
             </constraints>
             <connections>
                 <outlet property="msgBackground" destination="rfH-MI-dNw" id="AJp-Zq-XG8"/>
+                <outlet property="openImagebutton" destination="7XH-9N-c5g" id="6re-SE-3gr"/>
                 <outlet property="photoView" destination="BPl-0q-GSo" id="6XR-pb-GjY"/>
                 <outlet property="statusLabel" destination="ldC-Xq-oV5" id="qmg-YD-p6y"/>
                 <outlet property="timeBox" destination="EAm-7Z-ubs" id="4bu-p8-yDg"/>
                 <outlet property="timeLabel" destination="JUf-er-n2R" id="mdy-VT-uV5"/>
                 <outlet property="transferedFileName" destination="NbG-jg-Rsk" id="ao1-1g-gNT"/>
-                <outlet property="transferedImage" destination="hxG-Yd-cRF" id="yBf-Uw-eMd"/>
+                <outlet property="transferedImage" destination="wGS-P4-qNL" id="3gA-qc-ICe"/>
             </connections>
             <point key="canvasLocation" x="132" y="-22"/>
         </tableCellView>
@@ -465,11 +485,11 @@
             <point key="canvasLocation" x="139" y="750"/>
         </tableCellView>
         <tableCellView identifier="RightFinishedFileView" id="rmZ-yh-rX1" userLabel="IMTableCellView" customClass="IMTableCellView">
-            <rect key="frame" x="0.0" y="0.0" width="400" height="172"/>
+            <rect key="frame" x="0.0" y="0.0" width="400" height="40"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
                 <box boxType="custom" borderType="none" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="e0e-TK-qch">
-                    <rect key="frame" x="0.0" y="138" width="400" height="34"/>
+                    <rect key="frame" x="0.0" y="6" width="400" height="34"/>
                     <view key="contentView" id="Jbl-ZD-fCi">
                         <rect key="frame" x="0.0" y="0.0" width="400" height="34"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -496,10 +516,10 @@
                     </constraints>
                 </box>
                 <view translatesAutoresizingMaskIntoConstraints="NO" id="uQv-aG-QZp" customClass="MessageBubbleView">
-                    <rect key="frame" x="150" y="0.0" width="250" height="138"/>
+                    <rect key="frame" x="150" y="0.0" width="250" height="6"/>
                     <subviews>
                         <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gyB-QF-uEW">
-                            <rect key="frame" x="15" y="103" width="30" height="20"/>
+                            <rect key="frame" x="15" y="-29" width="30" height="20"/>
                             <constraints>
                                 <constraint firstAttribute="width" constant="30" id="20F-SE-qna"/>
                                 <constraint firstAttribute="height" constant="20" id="4aT-Xp-Gdi"/>
@@ -507,7 +527,7 @@
                             <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="ic_attachment" id="yAd-of-sXU"/>
                         </imageView>
                         <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jRP-c4-heJ">
-                            <rect key="frame" x="55" y="104" width="180" height="19"/>
+                            <rect key="frame" x="55" y="-28" width="180" height="19"/>
                             <buttonCell key="cell" type="roundRect" title="Round Rect" bezelStyle="roundedRect" alignment="center" imageScaling="proportionallyDown" inset="2" id="3i8-bi-EQN">
                                 <behavior key="behavior" lightByContents="YES"/>
                                 <font key="font" metaFont="system" size="14"/>
@@ -522,7 +542,7 @@
                             </textFieldCell>
                         </textField>
                         <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="gLx-wW-frG">
-                            <rect key="frame" x="15" y="85" width="220" height="5"/>
+                            <rect key="frame" x="15" y="-47" width="220" height="5"/>
                         </box>
                     </subviews>
                     <constraints>
@@ -539,32 +559,52 @@
                         <constraint firstItem="jRP-c4-heJ" firstAttribute="leading" secondItem="gyB-QF-uEW" secondAttribute="trailing" constant="10" id="wI3-Hn-sFr"/>
                     </constraints>
                 </view>
-                <button ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9ra-MQ-dQc">
-                    <rect key="frame" x="176" y="0.0" width="48" height="138"/>
-                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="ime-Ce-yIP">
-                        <behavior key="behavior" lightByContents="YES"/>
+                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="KzR-Xo-Vlj">
+                    <rect key="frame" x="400" y="0.0" width="0.0" height="6"/>
+                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" animates="YES" imageScaling="proportionallyUpOrDown" id="Ea2-xs-9NC"/>
+                </imageView>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ld8-l1-IEa" customClass="HoverButton">
+                    <rect key="frame" x="400" y="0.0" width="0.0" height="6"/>
+                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" imagePosition="only" alignment="center" borderStyle="border" transparent="YES" imageScaling="proportionallyDown" inset="2" id="PfG-Ue-7zC">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                         <font key="font" metaFont="system"/>
                     </buttonCell>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="color" keyPath="cornerColor">
+                            <color key="value" red="0.94117647058823528" green="0.94117647058823528" blue="0.94901960784313721" alpha="1" colorSpace="calibratedRGB"/>
+                        </userDefinedRuntimeAttribute>
+                        <userDefinedRuntimeAttribute type="color" keyPath="hoverColor">
+                            <color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.20000000000000001" colorSpace="calibratedRGB"/>
+                        </userDefinedRuntimeAttribute>
+                        <userDefinedRuntimeAttribute type="color" keyPath="highlightColor">
+                            <color key="value" red="0.0" green="0.0" blue="0.0" alpha="0.40000000000000002" colorSpace="calibratedRGB"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
                 </button>
             </subviews>
             <constraints>
-                <constraint firstItem="9ra-MQ-dQc" firstAttribute="top" secondItem="e0e-TK-qch" secondAttribute="bottom" id="47p-LD-eW3"/>
+                <constraint firstItem="KzR-Xo-Vlj" firstAttribute="trailing" secondItem="ld8-l1-IEa" secondAttribute="trailing" id="2yE-GJ-IQU"/>
                 <constraint firstItem="e0e-TK-qch" firstAttribute="top" secondItem="rmZ-yh-rX1" secondAttribute="top" id="8NZ-EV-k0V"/>
+                <constraint firstItem="KzR-Xo-Vlj" firstAttribute="top" secondItem="ld8-l1-IEa" secondAttribute="top" id="ExB-dn-NAm"/>
+                <constraint firstAttribute="bottom" secondItem="KzR-Xo-Vlj" secondAttribute="bottom" id="FG9-hP-jwr"/>
+                <constraint firstAttribute="trailing" secondItem="KzR-Xo-Vlj" secondAttribute="trailing" id="G62-7V-dcz"/>
                 <constraint firstItem="e0e-TK-qch" firstAttribute="leading" secondItem="rmZ-yh-rX1" secondAttribute="leading" id="JHH-tM-TTv"/>
-                <constraint firstAttribute="bottom" secondItem="9ra-MQ-dQc" secondAttribute="bottom" id="Z8C-ig-6oB"/>
-                <constraint firstAttribute="trailing" secondItem="9ra-MQ-dQc" secondAttribute="trailing" id="ZdJ-Th-dsy"/>
+                <constraint firstItem="KzR-Xo-Vlj" firstAttribute="top" secondItem="e0e-TK-qch" secondAttribute="bottom" id="QFA-JJ-eQE"/>
+                <constraint firstItem="KzR-Xo-Vlj" firstAttribute="leading" secondItem="ld8-l1-IEa" secondAttribute="leading" id="aWC-JV-Yfg"/>
                 <constraint firstAttribute="bottom" secondItem="uQv-aG-QZp" secondAttribute="bottom" id="iyK-vD-6gs"/>
                 <constraint firstAttribute="trailing" secondItem="uQv-aG-QZp" secondAttribute="trailing" id="nBz-tG-1V1"/>
                 <constraint firstItem="uQv-aG-QZp" firstAttribute="top" secondItem="e0e-TK-qch" secondAttribute="bottom" id="rvb-My-XBo"/>
                 <constraint firstAttribute="trailing" secondItem="e0e-TK-qch" secondAttribute="trailing" id="w3i-dk-KKy"/>
+                <constraint firstItem="KzR-Xo-Vlj" firstAttribute="bottom" secondItem="ld8-l1-IEa" secondAttribute="bottom" id="wIL-PM-J2D"/>
             </constraints>
             <connections>
                 <outlet property="msgBackground" destination="uQv-aG-QZp" id="poE-7z-JEI"/>
+                <outlet property="openImagebutton" destination="ld8-l1-IEa" id="lGl-pq-r5p"/>
                 <outlet property="statusLabel" destination="eHR-Hi-Zl2" id="TvR-nl-6eO"/>
                 <outlet property="timeBox" destination="e0e-TK-qch" id="JPW-TW-Byd"/>
                 <outlet property="timeLabel" destination="Od3-Cq-LmR" id="lja-3j-VsT"/>
                 <outlet property="transferedFileName" destination="jRP-c4-heJ" id="5OM-gW-g7U"/>
-                <outlet property="transferedImage" destination="9ra-MQ-dQc" id="BsK-nv-ovu"/>
+                <outlet property="transferedImage" destination="KzR-Xo-Vlj" id="0Aj-VB-IrK"/>
             </connections>
             <point key="canvasLocation" x="147" y="1290"/>
         </tableCellView>
-- 
GitLab