move qrcode function to a dedicated button

This is an harmonization with the other clients

Change-Id: I0ccc9f33b01b5acdf82f7a7d9b5e341f1aa567c8
Tuleap: #921
diff --git a/callwidget.cpp b/callwidget.cpp
index 95ab0d0..8d1d525 100644
--- a/callwidget.cpp
+++ b/callwidget.cpp
@@ -82,7 +82,7 @@
     ui->ringLogo->setPixmap(logo.scaledToHeight(100, Qt::SmoothTransformation));
     ui->ringLogo->setAlignment(Qt::AlignHCenter);
 
-    setupShareMenu();
+    ui->qrLabel->hide();
 
     GlobalInstances::setPixmapManipulator(std::unique_ptr<Interfaces::PixbufManipulator>(new Interfaces::PixbufManipulator()));
 
@@ -203,24 +203,6 @@
 }
 
 void
-CallWidget::setupShareMenu()
-{
-    ui->shareButton->setPopupMode(QToolButton::ToolButtonPopupMode::MenuButtonPopup);
-    shareMenu_ = new QMenu(ui->shareButton);
-    auto emailShare = new QAction(tr("Share by email"), this);
-    connect(emailShare, &QAction::triggered, [=]() {
-        Utils::InvokeMailto(tr("Contact me on Ring"), tr("My RingId is : ") + ui->ringIdLabel->text());
-    });
-    shareMenu_->addAction(emailShare);
-    auto qrcodeAction = new QAction(tr("Show QRCode"), this);
-    qrcodeAction->setCheckable(true);
-    ui->qrLabel->hide();
-    connect(qrcodeAction, &QAction::toggled, ui->qrLabel, &QLabel::setVisible);
-    shareMenu_->addAction(qrcodeAction);
-    ui->shareButton->setMenu(shareMenu_);
-}
-
-void
 CallWidget::setupOutOfCallIM()
 {
     ui->listMessageView->setItemDelegate(imDelegate_);
@@ -819,7 +801,13 @@
 }
 
 void
+CallWidget::on_qrButton_toggled(bool checked)
+{
+    ui->qrLabel->setVisible(checked);
+}
+
+void
 CallWidget::on_shareButton_clicked()
 {
-    ui->shareButton->showMenu();
+    Utils::InvokeMailto(tr("Contact me on Ring"), tr("My RingId is : ") + ui->ringIdLabel->text());
 }
diff --git a/callwidget.h b/callwidget.h
index 69318b7..b56dd0d 100644
--- a/callwidget.h
+++ b/callwidget.h
@@ -82,6 +82,7 @@
     void on_imBackButton_clicked();
     void on_copyCMButton_clicked();
     void on_smartList_clicked(const QModelIndex &index);
+    void on_qrButton_toggled(bool checked);
     void on_shareButton_clicked();
 
 private slots:
@@ -124,7 +125,6 @@
     void setupSmartListMenu();
     void slidePage(QWidget* widget, bool toRight = false);
     void callStateToView(Call* value);
-    void setupShareMenu();
     void setupQRCode();
 };
 
diff --git a/callwidget.ui b/callwidget.ui
index b53447c..ee54fe8 100644
--- a/callwidget.ui
+++ b/callwidget.ui
@@ -751,7 +751,7 @@
                    </spacer>
                   </item>
                   <item>
-                   <widget class="QToolButton" name="shareButton">
+                   <widget class="QToolButton" name="qrButton">
                     <property name="sizePolicy">
                      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
                       <horstretch>0</horstretch>
@@ -778,7 +778,55 @@
                     </property>
                     <property name="icon">
                      <iconset resource="ressources.qrc">
-                      <normaloff>:/images/icons/ic_share_white_24dp_2x.png</normaloff>:/images/icons/ic_share_white_24dp_2x.png</iconset>
+                      <normaloff>:/images/qrcode.png</normaloff>:/images/qrcode.png</iconset>
+                    </property>
+                    <property name="iconSize">
+                     <size>
+                      <width>18</width>
+                      <height>18</height>
+                     </size>
+                    </property>
+                    <property name="checkable">
+                     <bool>true</bool>
+                    </property>
+                   </widget>
+                  </item>
+                  <item>
+                   <spacer name="horizontalSpacer_12">
+                    <property name="orientation">
+                     <enum>Qt::Horizontal</enum>
+                    </property>
+                    <property name="sizeType">
+                     <enum>QSizePolicy::Fixed</enum>
+                    </property>
+                    <property name="sizeHint" stdset="0">
+                     <size>
+                      <width>5</width>
+                      <height>20</height>
+                     </size>
+                    </property>
+                   </spacer>
+                  </item>
+                  <item>
+                   <widget class="QToolButton" name="shareButton">
+                    <property name="minimumSize">
+                     <size>
+                      <width>30</width>
+                      <height>30</height>
+                     </size>
+                    </property>
+                    <property name="maximumSize">
+                     <size>
+                      <width>30</width>
+                      <height>30</height>
+                     </size>
+                    </property>
+                    <property name="text">
+                     <string/>
+                    </property>
+                    <property name="icon">
+                     <iconset resource="ressources.qrc">
+                      <normaloff>:/images/icons/ic_share_black_48dp_2x.png</normaloff>:/images/icons/ic_share_black_48dp_2x.png</iconset>
                     </property>
                     <property name="iconSize">
                      <size>
@@ -836,6 +884,22 @@
                   </property>
                  </widget>
                 </item>
+                <item>
+                 <spacer name="verticalSpacer_4">
+                  <property name="orientation">
+                   <enum>Qt::Vertical</enum>
+                  </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Fixed</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>20</width>
+                    <height>10</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
                 <item alignment="Qt::AlignHCenter">
                  <widget class="QLabel" name="qrLabel">
                   <property name="text">
@@ -848,10 +912,13 @@
                   <property name="orientation">
                    <enum>Qt::Vertical</enum>
                   </property>
+                  <property name="sizeType">
+                   <enum>QSizePolicy::Expanding</enum>
+                  </property>
                   <property name="sizeHint" stdset="0">
                    <size>
                     <width>20</width>
-                    <height>40</height>
+                    <height>20</height>
                    </size>
                   </property>
                  </spacer>
diff --git a/images/icons/ic_share_black_48dp_2x.png b/images/icons/ic_share_black_48dp_2x.png
new file mode 100644
index 0000000..5a8544c
--- /dev/null
+++ b/images/icons/ic_share_black_48dp_2x.png
Binary files differ
diff --git a/images/icons/ic_share_white_24dp_2x.png b/images/icons/ic_share_white_24dp_2x.png
deleted file mode 100644
index 22a8783..0000000
--- a/images/icons/ic_share_white_24dp_2x.png
+++ /dev/null
Binary files differ
diff --git a/images/qrcode.png b/images/qrcode.png
new file mode 100644
index 0000000..89d72e1
--- /dev/null
+++ b/images/qrcode.png
Binary files differ
diff --git a/ressources.qrc b/ressources.qrc
index 1450be3..69c51ca 100644
--- a/ressources.qrc
+++ b/ressources.qrc
@@ -29,7 +29,6 @@
         <file>images/icons/ic_arrow_forward_white_48dp_2x.png</file>
         <file>images/icons/ic_settings_white_48dp_2x.png</file>
         <file>images/icons/ic_voicemail_white_24dp_2x.png</file>
-        <file>images/icons/ic_share_white_24dp_2x.png</file>
         <file>images/background-light.png</file>
         <file>images/background-dark.png</file>
         <file>images/icons/ic_arrow_drop_down_black_9dp_2x.png</file>
@@ -38,5 +37,7 @@
         <file>images/icons/ic_arrow_tab_previous_black_9dp_2x.png</file>
         <file>images/spikeMask.png</file>
         <file>images/icons/ic_photo_camera_white_24dp_2x.png</file>
+        <file>images/qrcode.png</file>
+        <file>images/icons/ic_share_black_48dp_2x.png</file>
     </qresource>
 </RCC>
diff --git a/stylesheet.css b/stylesheet.css
index 49e085a..8e1a4d2 100644
--- a/stylesheet.css
+++ b/stylesheet.css
@@ -184,22 +184,40 @@
 }
 
 QPushButton#exitSettingsButton, QPushButton#settingsButton, QPushButton#addToContactButton,
-QPushButton#imBackButton, QPushButton#copyCMButton, QToolButton#shareButton{
+QPushButton#imBackButton, QPushButton#copyCMButton{
     background-color: #414141;
     border-radius: 15px;
     border:solid 1px;
 }
 
 QPushButton#exitSettingsButton:hover, QPushButton#settingsButton:hover, QPushButton#imBackButton:hover,
-QPushButton#copyCMButton:hover, QToolButton#shareButton:hover{
+QPushButton#copyCMButton:hover{
     background-color: #515151;
 }
 
 QPushButton#exitSettingsButton:pressed, QPushButton#settingsButton:pressed, QToolButton#imBackButton:pressed,
-QPushButton#copyCMButton:pressed, QToolButton#shareButton:pressed{
+QPushButton#copyCMButton:pressed{
     background-color: #313131;
 }
 
+QToolButton#qrButton, QToolButton#shareButton{
+    background-color: #3AC0D2;
+    border-radius: 15px;
+    border:solid 1px;
+}
+
+QToolButton#qrButton:hover, QToolButton#shareButton:hover{
+    background-color: #4dc6d6;
+}
+
+QToolButton#qrButton:pressed, QToolButton#shareButton:pressed{
+    background-color: #34acbd;
+}
+
+QToolButton#qrButton:checked {
+    background-color: #34acbd;
+}
+
 QPushButton#deleteAccountButton, QToolButton#addAccountButton{
     background: transparent;
 }