Commit 1e59859c authored by Edric Milaret's avatar Edric Milaret Committed by gerrit2

move qrcode function to a dedicated button

This is an harmonization with the other clients

Change-Id: I0ccc9f33b01b5acdf82f7a7d9b5e341f1aa567c8
Tuleap: #921
parent 568a0e51
......@@ -82,7 +82,7 @@ CallWidget::CallWidget(QWidget* parent) :
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()));
......@@ -202,24 +202,6 @@ CallWidget::~CallWidget()
delete shareMenu_;
}
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()
{
......@@ -818,8 +800,14 @@ CallWidget::on_copyCMButton_clicked()
QApplication::clipboard()->setText(text);
}
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());
}
......@@ -82,6 +82,7 @@ private slots:
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 @@ private:
void setupSmartListMenu();
void slidePage(QWidget* widget, bool toRight = false);
void callStateToView(Call* value);
void setupShareMenu();
void setupQRCode();
};
......@@ -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>
......
......@@ -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>
......@@ -184,22 +184,40 @@ QPushButton#hangupButton:pressed{
}
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;
}
......
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