Skip to content
Snippets Groups Projects
Commit 57442b22 authored by Olivier SOLDANO's avatar Olivier SOLDANO Committed by Anthony Léonard
Browse files

hover widget for quick actions on contact requests


implements a hover widget with three buttons, for accepting,
discarding, and blocking a contact request without requiring to
use the dedicated panel

Change-Id: I5002d3d156d8783bc613f52d7dd2abaaf9fc064f
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent fe18af3a
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,8 @@ SOURCES += main.cpp\
sendcontactrequestwidget.cpp \
currentaccountwidget.cpp \
contactrequestwidget.cpp \
contactrequestitemdelegate.cpp
contactrequestitemdelegate.cpp \
quickactcontactrequestwidget.cpp
HEADERS += mainwindow.h \
callwidget.h \
......@@ -114,7 +115,8 @@ HEADERS += mainwindow.h \
sendcontactrequestwidget.h \
currentaccountwidget.h \
contactrequestwidget.h \
contactrequestitemdelegate.h
contactrequestitemdelegate.h \
quickactcontactrequestwidget.h
contains(DEFINES, URI_PROTOCOL) {
HEADERS += shmclient.h
......@@ -140,7 +142,8 @@ FORMS += mainwindow.ui \
photoboothdialog.ui \
sendcontactrequestwidget.ui \
currentaccountwidget.ui \
contactrequestwidget.ui
contactrequestwidget.ui \
quickactcontactrequestwidget.ui
win32: LIBS += -lole32 -luuid -lshlwapi
LIBS += -lqrencode
......
/***************************************************************************
* Copyright (C) 2015-2017 by Savoir-faire Linux *
* Author: Olivier Soldano <olivier.soldano@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, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
#include "quickactcontactrequestwidget.h"
#include "ui_quickactcontactrequestwidget.h"
#include <QFont>
// CLIENT
#include "contactrequestitemdelegate.h"
QuickActContactRequestWidget::QuickActContactRequestWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::QuickActContactRequestWidget)
{
ui->setupUi(this);
// set symbols in buttons using FontAwsome
ui->quickValidCRBtn->setText(QChar(0xf00c));
ui->quickMuteCRBtn->setText(QChar(0xf12d));
ui->quickBanCRBtn->setText(QChar(0xf00d));
connect(ui->quickValidCRBtn, &QPushButton::clicked, this, [=](){
emit quickValidCRBtnClicked();
});
connect(ui->quickMuteCRBtn, &QPushButton::clicked, this, [=](){
emit quickValidCRBtnClicked();
});
connect(ui->quickBanCRBtn, &QPushButton::clicked, this, [=](){
emit quickValidCRBtnClicked();
});
}
QuickActContactRequestWidget::~QuickActContactRequestWidget()
{
disconnect(this);
delete ui;
}
/***************************************************************************
* Copyright (C) 2015-2017 by Savoir-faire Linux *
* Author: Olivier Soldano <olivier.soldano@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, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
#ifndef QUICKACTCONTACTREQUESTWIDGET_H
#define QUICKACTCONTACTREQUESTWIDGET_H
#include <QWidget>
namespace Ui {
class QuickActContactRequestWidget;
}
class QuickActContactRequestWidget : public QWidget
{
Q_OBJECT
public:
explicit QuickActContactRequestWidget(QWidget *parent = 0);
~QuickActContactRequestWidget();
signals:
void quickValidCRBtnClicked();
void quickMuteCRBtnClicked();
void quickBanCRBtnClicked();
private:
Ui::QuickActContactRequestWidget *ui;
};
#endif // QUICKACTCONTACTREQUESTWIDGET_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QuickActContactRequestWidget</class>
<widget class="QWidget" name="QuickActContactRequestWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>687</width>
<height>147</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="3,1">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>428</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout" stretch="9,3,1">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>5</number>
</property>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QPushButton" name="quickValidCRBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="quickMuteCRBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="quickBanCRBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
......@@ -428,6 +428,36 @@ QPushButton#generalTabButton, QPushButton#videoTabButton, QPushButton#accountTab
padding: 2px;
}
QPushButton#quickValidCRBtn, QPushButton#quickMuteCRBtn, QPushButton#quickBanCRBtn{
border-radius: 2px;
height:25px;
width:25px;
margin: 2px 2px 2px 2px;
text-align: center;
font: 10pt "FontAwesome";
}
QPushButton#quickValidCRBtn{
background-color: #66cc00;
}
QPushButton#quickValidCRBtn:hover{
background-color: #80ff00;
}
QPushButton#quickMuteCRBtn{
background-color: #ff9933;
}
QPushButton#quickMuteCRBtn:hover{
background-color: #ffb366;
}
QPushButton#quickBanCRBtn{
background-color: #ff3333;
}
QPushButton#quickBanCRBtn:hover{
background-color: #ff6666;
}
QTabBar::tab{
background: transparent;
color: rgb(77, 77, 77);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment