From 5662aa933f1beb6c0fe58b3d6a7b84c6cf06e999 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Fri, 26 Sep 2014 16:39:29 +0200 Subject: [PATCH 01/18] Added MaskablePixmapWidget, improved avatar rendering --- img/avatar_mask.png | Bin 0 -> 5766 bytes img/avatar_mask_circle.png | Bin 0 -> 9310 bytes mainwindow.ui | 51 +++++++++----------------- qtox.pro | 5 +-- res.qrc | 2 ++ widget/form/chatform.cpp | 7 ++-- widget/form/genericchatform.cpp | 5 +-- widget/form/genericchatform.h | 3 +- widget/form/groupchatform.cpp | 3 +- widget/friendwidget.cpp | 17 ++++----- widget/friendwidget.h | 4 ++- widget/maskablepixmapwidget.cpp | 61 ++++++++++++++++++++++++++++++++ widget/maskablepixmapwidget.h | 45 +++++++++++++++++++++++ widget/tool/clickablelabel.h | 22 ------------ widget/widget.cpp | 10 ++++-- widget/widget.h | 2 ++ 16 files changed, 160 insertions(+), 77 deletions(-) create mode 100644 img/avatar_mask.png create mode 100644 img/avatar_mask_circle.png create mode 100644 widget/maskablepixmapwidget.cpp create mode 100644 widget/maskablepixmapwidget.h delete mode 100644 widget/tool/clickablelabel.h diff --git a/img/avatar_mask.png b/img/avatar_mask.png new file mode 100644 index 0000000000000000000000000000000000000000..508914f0425838a3c1b5496ff87ff6388115ace3 GIT binary patch literal 5766 zcmeHr`9Boi_y2fQ6yYWNmI`IBX)x9#`&Jo*GKtY>41=)@38jTFG$Mq0F^nu@iNOp; zy|S;_w=u-n!dM!_SU&UqFTOu~@8faq@_3wc@8h0x?m6c^-`>4#!Ottj3jhH4tt?F; zoN<>!JEyrhJ?~GU9nNqv=$4h^X-<1~+AEH;J`-T+8Uz4-*r2|zN~%q7^t zA0CYHKtBdxFc=L43K<0R2zadFkM_=D8b|>EVkfLjjUB_X*K!cfA{}C8f~VvD)xk_2 zQl^iOq5cD?z?(w$j`Y}eSayRbF6}12>-TYFOJ^QMMR|21+@B_aUfJ3@hyAKGOAa^6 z>XDDiT|9J)K+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;FPoc;VqU&jT=?e%Vn`Qf7J>3=FzN`^Zo=j+;LrYL2lCE6GO%G_B#Xiax1#C zWN?zxZ6hdmffe7YKVkR^QrlD0d2f)R&-9CwQj_G^UNX*?LbG0rj=N!W=V4dFUbirb gWr(=7(0;p!HfY`X17htZas?mKQK?1qW}N^ literal 0 HcmV?d00001 diff --git a/img/avatar_mask_circle.png b/img/avatar_mask_circle.png new file mode 100644 index 0000000000000000000000000000000000000000..83cb97dfc4e3874237965d1d0a961bd1cbb91592 GIT binary patch literal 9310 zcmXAP2UHW?^Y*3?LTEukXwpOll`6d^D2R$6h|;7xZWx9;a;F&XD(cYbB{Rq%{1;kU&wjqFaXeV`+I^U3Fo*CKr-CIDcnBT zCp_xL9d95iDoX8EP(T>&Mu@js@EzaW6=Nv?kOwZ9n_Z25z5FIN3T0Wd|!J)`Po>v98vr^XR3+nE!u+ zN|{Hgz>Tvzjl0-w`( zJhirdFNB_Z+;X6wIsM~+Sv$Svx@V{(Vmr&j5e`q@6(T#<4}?0_mwRNi63d^x6C|W~ zE;|8(mM=OwM%*B8tMwqe|C9M}k0U|^&|wJc6hZw?=ej|r`bHQE zD#l~2*stI>PWGyRsQ|@KRNFP{stDygEK$kJ-$>V>Q(e@#nSeHW`EPcE3(#N8au&q) z0qFol9|20{Jj)zgTQ#*yOF{l%41VpcP>WH4Fh8SSf5*3-Dbo z6%qpp?%U7om=^Cac;e$GW27bjZ%|glNsAp=u?@xg}9l7w1<}R79r!F zuY<_7`z)A+@l}C&fvZ{mq*Oj9V4*+I)c1zqo_)CQu9h~4N}fBIQ?71yi4)v=RqCNV zJiS_}vT3+`zwTbPT9JfbI#w@a{E@KonKh7`W}U^CNUY{}heLY_kCQ224J$O$g=Tav zr<9A&5*6f1gf{o=3+!hPQBTp^8SlQtlfD_!<{HZ5+(<9Scf=0iz7oz5Z3xo{3xRo| zs{*Elr=Ti_4NZzdX2uD4P4zYBF8f$2K+4M3GUeJ9+p`rn;UXOzcX=dMM*6IMYF%4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LUe8oo`6;l_$Ed-IQLMfCTZ3|aufWG-t z%~}u8RQ>J`wSzvt+fr^>a_bnTXMa7QcC}+se_`?FA6`1q!w602e!9Ky8HNW(XSY$GR98*TH+#gYeOv0GYp#bpQYW literal 0 HcmV?d00001 diff --git a/mainwindow.ui b/mainwindow.ui index 845a0c728..a197594bd 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 716 - 543 + 714 + 541 @@ -1452,32 +1452,20 @@ QSplitter:handle{ 0 - - + + + Qt::Horizontal + + + QSizePolicy::Maximum + + - 40 - 40 + 5 + 20 - - - 40 - 40 - - - - - - - :/img/contact.png - - - false - - - true - - + @@ -2095,8 +2083,8 @@ QSplitter:handle{ 0 0 - 263 - 378 + 262 + 375 @@ -3230,8 +3218,8 @@ QSplitter:handle{ 0 0 - 716 - 19 + 714 + 25 @@ -3257,11 +3245,6 @@ QSplitter:handle{ QLabel
widget/croppinglabel.h
- - ClickableLabel - QLabel -
widget/tool/clickablelabel.h
-
diff --git a/qtox.pro b/qtox.pro index 6b63a9835..c5bf81c1b 100644 --- a/qtox.pro +++ b/qtox.pro @@ -117,7 +117,7 @@ HEADERS += widget/form/addfriendform.h \ widget/tool/chatactions/messageaction.h \ widget/tool/chatactions/filetransferaction.h \ widget/tool/chatactions/systemmessageaction.h \ - widget/tool/clickablelabel.h + widget/maskablepixmapwidget.h SOURCES += \ widget/form/addfriendform.cpp \ @@ -157,4 +157,5 @@ SOURCES += \ widget/settingsdialog.cpp \ widget/tool/chatactions/messageaction.cpp \ widget/tool/chatactions/filetransferaction.cpp \ - widget/tool/chatactions/systemmessageaction.cpp + widget/tool/chatactions/systemmessageaction.cpp \ + widget/maskablepixmapwidget.cpp diff --git a/res.qrc b/res.qrc index b1b50df58..62b891ee6 100644 --- a/res.qrc +++ b/res.qrc @@ -142,5 +142,7 @@ translations/pl.qm translations/fi.qm translations/mannol.qm + img/avatar_mask.png + img/avatar_mask_circle.png diff --git a/widget/form/chatform.cpp b/widget/form/chatform.cpp index 83f9a9892..f659240da 100644 --- a/widget/form/chatform.cpp +++ b/widget/form/chatform.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "chatform.h" #include "friend.h" #include "widget/friendwidget.h" @@ -32,12 +33,13 @@ #include "widget/tool/chattextedit.h" #include "core.h" #include "widget/widget.h" +#include "widget/maskablepixmapwidget.h" ChatForm::ChatForm(Friend* chatFriend) : f(chatFriend) { nameLabel->setText(f->getName()); - avatarLabel->setPixmap(QPixmap(":/img/contact_dark.png")); + avatar->setPixmap(QPixmap(":/img/contact_dark.png")); statusMessageLabel = new CroppingLabel(); netcam = new NetCamView(); @@ -475,8 +477,7 @@ void ChatForm::onAvatarChange(int FriendId, const QPixmap &pic) if (FriendId != f->friendId) return; - QPixmap scaled = pic.scaled(40,40,Qt::KeepAspectRatio,Qt::SmoothTransformation); - avatarLabel->setPixmap(scaled); + avatar->setPixmap(pic); } void ChatForm::dragEnterEvent(QDragEnterEvent *ev) diff --git a/widget/form/genericchatform.cpp b/widget/form/genericchatform.cpp index cff9e3b50..1f7b827f7 100644 --- a/widget/form/genericchatform.cpp +++ b/widget/form/genericchatform.cpp @@ -26,6 +26,7 @@ #include "widget/tool/chatactions/systemmessageaction.h" #include "widget/chatareawidget.h" #include "widget/tool/chattextedit.h" +#include "widget/maskablepixmapwidget.h" GenericChatForm::GenericChatForm(QWidget *parent) : QWidget(parent) @@ -35,7 +36,7 @@ GenericChatForm::GenericChatForm(QWidget *parent) : headWidget = new QWidget(); nameLabel = new CroppingLabel(); - avatarLabel = new QLabel(); + avatar = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask_circle.png"); QHBoxLayout *headLayout = new QHBoxLayout(), *mainFootLayout = new QHBoxLayout(); headTextLayout = new QVBoxLayout(); QVBoxLayout *mainLayout = new QVBoxLayout(); @@ -99,7 +100,7 @@ GenericChatForm::GenericChatForm(QWidget *parent) : mainFootLayout->setSpacing(0); headWidget->setLayout(headLayout); - headLayout->addWidget(avatarLabel); + headLayout->addWidget(avatar); headLayout->addLayout(headTextLayout); headLayout->addLayout(volMicLayout); headLayout->addWidget(callButton); diff --git a/widget/form/genericchatform.h b/widget/form/genericchatform.h index c824d5e85..d45bf1072 100644 --- a/widget/form/genericchatform.h +++ b/widget/form/genericchatform.h @@ -30,6 +30,7 @@ class QPushButton; class CroppingLabel; class ChatTextEdit; class ChatAreaWidget; +class MaskablePixmapWidget; namespace Ui { class MainWindow; @@ -60,7 +61,7 @@ protected slots: protected: CroppingLabel *nameLabel; - QLabel *avatarLabel; + MaskablePixmapWidget *avatar; QWidget *headWidget; QPushButton *fileButton, *emoteButton, *callButton, *videoButton, *volButton, *micButton; QVBoxLayout *headTextLayout; diff --git a/widget/form/groupchatform.cpp b/widget/form/groupchatform.cpp index 4dc6c7e0d..7622f2cf0 100644 --- a/widget/form/groupchatform.cpp +++ b/widget/form/groupchatform.cpp @@ -19,6 +19,7 @@ #include "widget/groupwidget.h" #include "widget/tool/chattextedit.h" #include "widget/croppinglabel.h" +#include "widget/maskablepixmapwidget.h" #include "core.h" #include #include @@ -42,7 +43,7 @@ GroupChatForm::GroupChatForm(Group* chatGroup) nameLabel->setText(group->widget->name.text()); nusersLabel->setFont(small); nusersLabel->setText(GroupChatForm::tr("%1 users in chat","Number of users in chat").arg(group->peers.size())); - avatarLabel->setPixmap(QPixmap(":/img/group_dark.png")); + avatar->setPixmap(QPixmap(":/img/group_dark.png")); QString names; for (QString& s : group->peers) diff --git a/widget/friendwidget.cpp b/widget/friendwidget.cpp index 869bc4192..c15ee03cc 100644 --- a/widget/friendwidget.cpp +++ b/widget/friendwidget.cpp @@ -22,11 +22,13 @@ #include "friend.h" #include "core.h" #include "widget/form/chatform.h" +#include "widget/maskablepixmapwidget.h" #include #include #include #include #include +#include FriendWidget::FriendWidget(int FriendId, QString id) : friendId(FriendId), isDefaultAvatar{true} @@ -42,7 +44,8 @@ FriendWidget::FriendWidget(int FriendId, QString id) textLayout.setMargin(0); setLayoutDirection(Qt::LeftToRight); // parent might have set Qt::RightToLeft - avatar.setPixmap(QPixmap(":img/contact.png")); + avatar = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask.png"); + avatar->setPixmap(QPixmap(":img/contact.png")); name.setText(id); //statusPic.setAlignment(Qt::AlignHCenter); statusPic.setPixmap(QPixmap(":img/status/dot_away.png")); @@ -65,7 +68,7 @@ FriendWidget::FriendWidget(int FriendId, QString id) textLayout.addStretch(); layout.addSpacing(20); - layout.addWidget(&avatar); + layout.addWidget(avatar); layout.addSpacing(5); layout.addLayout(&textLayout); layout.addSpacing(5); @@ -138,7 +141,7 @@ void FriendWidget::setAsActiveChatroom() pal3.setColor(QPalette::Background, Qt::white); this->setPalette(pal3); if (isDefaultAvatar) - avatar.setPixmap(QPixmap(":img/contact_dark.png")); + avatar->setPixmap(QPixmap(":img/contact_dark.png")); } void FriendWidget::setAsInactiveChatroom() @@ -159,7 +162,7 @@ void FriendWidget::setAsInactiveChatroom() this->setPalette(pal3); if (isDefaultAvatar) - avatar.setPixmap(QPixmap(":img/contact.png")); + avatar->setPixmap(QPixmap(":img/contact.png")); } void FriendWidget::updateStatusLight() @@ -203,8 +206,7 @@ void FriendWidget::onAvatarChange(int FriendId, const QPixmap& pic) return; isDefaultAvatar = false; - QPixmap scaled = pic.scaled(40,40,Qt::KeepAspectRatio,Qt::SmoothTransformation); - avatar.setPixmap(scaled); + avatar->setPixmap(pic); } void FriendWidget::mousePressEvent(QMouseEvent *ev) @@ -225,8 +227,7 @@ void FriendWidget::mouseMoveEvent(QMouseEvent *ev) mdata->setData("friend", QString::number(friendId).toLatin1()); drag->setMimeData(mdata); - if (avatar.pixmap()) - drag->setPixmap(*avatar.pixmap()); + drag->setPixmap(avatar->getPixmap()); drag->exec(Qt::CopyAction | Qt::MoveAction); } diff --git a/widget/friendwidget.h b/widget/friendwidget.h index aa225d533..4cfef368e 100644 --- a/widget/friendwidget.h +++ b/widget/friendwidget.h @@ -23,6 +23,7 @@ #include "croppinglabel.h" class QPixmap; +class MaskablePixmapWidget; struct FriendWidget : public GenericChatroomWidget { @@ -50,7 +51,8 @@ protected: public: int friendId; - QLabel avatar, statusPic; + MaskablePixmapWidget* avatar; + QLabel statusPic; CroppingLabel name, statusMessage; bool isDefaultAvatar; QPoint dragStartPos; diff --git a/widget/maskablepixmapwidget.cpp b/widget/maskablepixmapwidget.cpp new file mode 100644 index 000000000..6fdd3f03b --- /dev/null +++ b/widget/maskablepixmapwidget.cpp @@ -0,0 +1,61 @@ +/* + Copyright (C) 2014 by Project Tox + + This file is part of qTox, a Qt-based graphical interface for Tox. + + This program is libre 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 COPYING file for more details. +*/ + +#include "maskablepixmapwidget.h" +#include +#include + +MaskablePixmapWidget::MaskablePixmapWidget(QWidget *parent, QSize size, QString maskName) + : QWidget(parent) +{ + setMinimumSize(size); + setMaximumSize(size); + + mask = QPixmap(maskName).scaled(maximumSize(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); +} + +void MaskablePixmapWidget::setPixmap(const QPixmap &pmap) +{ + pixmap = pmap.scaled(maximumSize(), Qt::KeepAspectRatio, Qt::SmoothTransformation); +} + +QPixmap MaskablePixmapWidget::getPixmap() const +{ + return pixmap; +} + +void MaskablePixmapWidget::paintEvent(QPaintEvent *ev) +{ + QPixmap tmp(ev->rect().size()); + tmp.fill(Qt::transparent); + + QPoint offset((ev->rect().size().width()-pixmap.size().width())/2,(ev->rect().size().height()-pixmap.size().height())/2); + + QPainter painter(&tmp); + painter.setCompositionMode(QPainter::CompositionMode_Source); + painter.drawPixmap(offset,pixmap); + painter.setCompositionMode(QPainter::CompositionMode_DestinationIn); + painter.drawPixmap(0,0,mask); + + painter.end(); + painter.begin(this); + painter.drawPixmap(0,0,tmp); +} + +void MaskablePixmapWidget::mousePressEvent(QMouseEvent*) +{ + emit clicked(); +} diff --git a/widget/maskablepixmapwidget.h b/widget/maskablepixmapwidget.h new file mode 100644 index 000000000..359b1ab00 --- /dev/null +++ b/widget/maskablepixmapwidget.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2014 by Project Tox + + This file is part of qTox, a Qt-based graphical interface for Tox. + + This program is libre 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 COPYING file for more details. +*/ + +#ifndef MASKABLEPIXMAPWIDGET_H +#define MASKABLEPIXMAPWIDGET_H + +#include + +class MaskablePixmapWidget : public QWidget +{ + Q_OBJECT +public: + MaskablePixmapWidget(QWidget *parent, QSize size, QString maskName); + + void setPixmap(const QPixmap &pmap); + QPixmap getPixmap() const; + +signals: + void clicked(); + +protected: + virtual void paintEvent(QPaintEvent *ev); + virtual void mousePressEvent(QMouseEvent *); + +private: + QPixmap pixmap; + QPixmap mask; + QSize size; + QString maskName; +}; + +#endif // MASKABLEPIXMAPWIDGET_H diff --git a/widget/tool/clickablelabel.h b/widget/tool/clickablelabel.h deleted file mode 100644 index 99e523b20..000000000 --- a/widget/tool/clickablelabel.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef CLICKABLELABEL_H -#define CLICKABLELABEL_H - -#include - -class QMouseEvent; -class QWidget; - -class ClickableLabel : public QLabel -{ -Q_OBJECT - -public: - explicit ClickableLabel(QWidget* parent = 0) : QLabel(parent) {} -signals: - void clicked(); -protected: - void mousePressEvent (QMouseEvent*) {emit clicked();} -}; - - -#endif // CLICKABLELABEL_H diff --git a/widget/widget.cpp b/widget/widget.cpp index 88128d8ac..da034ace2 100644 --- a/widget/widget.cpp +++ b/widget/widget.cpp @@ -32,6 +32,7 @@ #include "camera.h" #include "widget/form/chatform.h" #include "widget/settingsdialog.h" +#include "widget/maskablepixmapwidget.h" #include #include #include @@ -111,6 +112,10 @@ Widget::Widget(QWidget *parent) isWindowMinimized = 0; + profilePicture = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask.png"); + profilePicture->setPixmap(QPixmap(":/img/avatar.png")); + ui->horizontalLayout_3->insertWidget(0,profilePicture); + ui->mainContent->setLayout(new QVBoxLayout()); ui->mainHead->setLayout(new QVBoxLayout()); ui->mainHead->layout()->setMargin(0); @@ -214,7 +219,7 @@ Widget::Widget(QWidget *parent) connect(ui->settingsButton, SIGNAL(clicked()), this, SLOT(onSettingsClicked())); connect(ui->nameLabel, SIGNAL(textChanged(QString,QString)), this, SLOT(onUsernameChanged(QString,QString))); connect(ui->statusLabel, SIGNAL(textChanged(QString,QString)), this, SLOT(onStatusMessageChanged(QString,QString))); - connect(ui->profilePicture, SIGNAL(clicked()), this, SLOT(onAvatarClicked())); + connect(profilePicture, SIGNAL(clicked()), this, SLOT(onAvatarClicked())); connect(setStatusOnline, SIGNAL(triggered()), this, SLOT(setStatusOnline())); connect(setStatusAway, SIGNAL(triggered()), this, SLOT(setStatusAway())); connect(setStatusBusy, SIGNAL(triggered()), this, SLOT(setStatusBusy())); @@ -322,8 +327,7 @@ void Widget::onAvatarClicked() void Widget::onSelfAvatarLoaded(const QPixmap& pic) { - QPixmap scaled = pic.scaled(40,40, Qt::KeepAspectRatio,Qt::SmoothTransformation); - ui->profilePicture->setPixmap(scaled); + profilePicture->setPixmap(pic); } void Widget::onConnected() diff --git a/widget/widget.h b/widget/widget.h index 352e12cfa..dd6c8180e 100644 --- a/widget/widget.h +++ b/widget/widget.h @@ -38,6 +38,7 @@ class Core; class Camera; class FriendListWidget; class SettingsDialog; +class MaskablePixmapWidget; class Widget : public QMainWindow { @@ -144,6 +145,7 @@ private: GenericChatroomWidget* activeChatroomWidget; FriendListWidget* contactListWidget; Camera* camera; + MaskablePixmapWidget* profilePicture; bool notify(QObject *receiver, QEvent *event); bool eventFilter(QObject *, QEvent *event); }; From f9df1a1503f716163597940fae470f7c35a1f7c2 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Fri, 26 Sep 2014 19:16:27 +0200 Subject: [PATCH 02/18] ChatAreaWidget: removed frame --- widget/chatareawidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/widget/chatareawidget.cpp b/widget/chatareawidget.cpp index 524039d20..e1e7e3447 100644 --- a/widget/chatareawidget.cpp +++ b/widget/chatareawidget.cpp @@ -34,6 +34,7 @@ ChatAreaWidget::ChatAreaWidget(QWidget *parent) : setOpenExternalLinks(false); setOpenLinks(false); setAcceptRichText(false); + setFrameStyle(QFrame::NoFrame); chatTextTable = textCursor().insertTable(1,3); From 4d24bd53f26133a0fc4a7ffb68031eb92bca1ede Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sat, 27 Sep 2014 13:23:00 +0200 Subject: [PATCH 03/18] fix #308 --- widget/chatareawidget.cpp | 2 +- widget/tool/chatactions/chataction.h | 3 ++- .../tool/chatactions/filetransferaction.cpp | 21 +++++++++++++++---- widget/tool/chatactions/filetransferaction.h | 3 ++- widget/tool/chatactions/messageaction.cpp | 2 +- widget/tool/chatactions/messageaction.h | 2 +- .../tool/chatactions/systemmessageaction.cpp | 2 +- widget/tool/chatactions/systemmessageaction.h | 2 +- 8 files changed, 26 insertions(+), 11 deletions(-) diff --git a/widget/chatareawidget.cpp b/widget/chatareawidget.cpp index e1e7e3447..765d9e96c 100644 --- a/widget/chatareawidget.cpp +++ b/widget/chatareawidget.cpp @@ -118,7 +118,7 @@ void ChatAreaWidget::insertMessage(ChatAction *msgAction) chatTextTable->cellAt(row,1).firstCursorPosition().insertHtml(msgAction->getMessage()); chatTextTable->cellAt(row,2).firstCursorPosition().insertText(msgAction->getDate()); - msgAction->setTextCursor(cur); + msgAction->setup(cur, this); messages.append(msgAction); } diff --git a/widget/tool/chatactions/chataction.h b/widget/tool/chatactions/chataction.h index 16c9f179b..5c3eed650 100644 --- a/widget/tool/chatactions/chataction.h +++ b/widget/tool/chatactions/chataction.h @@ -21,13 +21,14 @@ #include class FileTransferInstance; +class QTextEdit; class ChatAction : public QObject { public: ChatAction(const bool &me, const QString &author, const QString &date) : isMe(me), name(author), date(date) {;} virtual ~ChatAction(){;} - virtual void setTextCursor(QTextCursor cursor){(void)cursor;} ///< Call once, and then you MUST let the object update itself + virtual void setup(QTextCursor cursor, QTextEdit* textEdit) = 0; ///< Call once, and then you MUST let the object update itself virtual QString getName(); virtual QString getMessage() = 0; diff --git a/widget/tool/chatactions/filetransferaction.cpp b/widget/tool/chatactions/filetransferaction.cpp index 12e2a1ac6..59f2c9250 100644 --- a/widget/tool/chatactions/filetransferaction.cpp +++ b/widget/tool/chatactions/filetransferaction.cpp @@ -17,8 +17,12 @@ #include "filetransferaction.h" #include "filetransferinstance.h" -FileTransferAction::FileTransferAction(FileTransferInstance *widget, const QString &author, const QString &date, const bool &me) : - ChatAction(me, author, date) +#include +#include + +FileTransferAction::FileTransferAction(FileTransferInstance *widget, const QString &author, const QString &date, const bool &me) + : ChatAction(me, author, date) + , edit(nullptr) { w = widget; @@ -39,20 +43,26 @@ QString FileTransferAction::getMessage() return widgetHtml; } -void FileTransferAction::setTextCursor(QTextCursor cursor) +void FileTransferAction::setup(QTextCursor cursor, QTextEdit *textEdit) { cur = cursor; cur.setKeepPositionOnInsert(true); int end=cur.selectionEnd(); cur.setPosition(cur.position()); cur.setPosition(end, QTextCursor::KeepAnchor); + + edit = textEdit; } void FileTransferAction::updateHtml() { - if (cur.isNull()) + if (cur.isNull() || !edit) return; + // save old slider value + int vSliderVal = edit->verticalScrollBar()->value(); + + // update content int pos = cur.selectionStart(); cur.removeSelectedText(); cur.setKeepPositionOnInsert(false); @@ -62,6 +72,9 @@ void FileTransferAction::updateHtml() cur.setPosition(pos); cur.setPosition(end, QTextCursor::KeepAnchor); + // restore old slider value + edit->verticalScrollBar()->setValue(vSliderVal); + // Free our ressources if we'll never need to update again if (w->getState() == FileTransferInstance::TransfState::tsCanceled || w->getState() == FileTransferInstance::TransfState::tsFinished) diff --git a/widget/tool/chatactions/filetransferaction.h b/widget/tool/chatactions/filetransferaction.h index ee6d0e11c..31982cd45 100644 --- a/widget/tool/chatactions/filetransferaction.h +++ b/widget/tool/chatactions/filetransferaction.h @@ -26,7 +26,7 @@ public: FileTransferAction(FileTransferInstance *widget, const QString &author, const QString &date, const bool &me); virtual ~FileTransferAction(); virtual QString getMessage(); - virtual void setTextCursor(QTextCursor cursor) final; + virtual void setup(QTextCursor cursor, QTextEdit* textEdit) override; private slots: void updateHtml(); @@ -34,6 +34,7 @@ private slots: private: FileTransferInstance *w; QTextCursor cur; + QTextEdit* edit; }; #endif // FILETRANSFERACTION_H diff --git a/widget/tool/chatactions/messageaction.cpp b/widget/tool/chatactions/messageaction.cpp index fa396468c..84ce86194 100644 --- a/widget/tool/chatactions/messageaction.cpp +++ b/widget/tool/chatactions/messageaction.cpp @@ -23,7 +23,7 @@ MessageAction::MessageAction(const QString &author, const QString &message, cons { } -void MessageAction::setTextCursor(QTextCursor cursor) +void MessageAction::setup(QTextCursor cursor, QTextEdit *) { // When this function is called, we're supposed to only update ourselve when needed // Nobody should ask us to do anything with our content, we're on our own diff --git a/widget/tool/chatactions/messageaction.h b/widget/tool/chatactions/messageaction.h index baa68898a..65f8e6465 100644 --- a/widget/tool/chatactions/messageaction.h +++ b/widget/tool/chatactions/messageaction.h @@ -25,7 +25,7 @@ public: MessageAction(const QString &author, const QString &message, const QString &date, const bool &me); virtual ~MessageAction(){;} virtual QString getMessage(); - virtual void setTextCursor(QTextCursor cursor) final; + virtual void setup(QTextCursor cursor, QTextEdit*) override; private: QString message; diff --git a/widget/tool/chatactions/systemmessageaction.cpp b/widget/tool/chatactions/systemmessageaction.cpp index 32457c6ed..a50f55e47 100644 --- a/widget/tool/chatactions/systemmessageaction.cpp +++ b/widget/tool/chatactions/systemmessageaction.cpp @@ -28,7 +28,7 @@ QString SystemMessageAction::getMessage() return QString("
" + message + "
"); } -void SystemMessageAction::setTextCursor(QTextCursor cursor) +void SystemMessageAction::setup(QTextCursor cursor, QTextEdit *) { // When this function is called, we're supposed to only update ourselve when needed // Nobody should ask us to do anything with our content, we're on our own diff --git a/widget/tool/chatactions/systemmessageaction.h b/widget/tool/chatactions/systemmessageaction.h index b628f7e04..6767a3f73 100644 --- a/widget/tool/chatactions/systemmessageaction.h +++ b/widget/tool/chatactions/systemmessageaction.h @@ -24,7 +24,7 @@ class SystemMessageAction : public ChatAction public: SystemMessageAction(const QString &message, const QString& type, const QString &date); virtual ~SystemMessageAction(){;} - virtual void setTextCursor(QTextCursor cursor) final; + virtual void setup(QTextCursor cursor, QTextEdit*) override; virtual QString getName() {return QString();} virtual QString getMessage(); From cd0f8d4d58116b76bca7045be07a6191f9dc7be6 Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Sat, 27 Sep 2014 14:37:51 +0200 Subject: [PATCH 04/18] Fix #326 From faf59cea9c72fa1774a3587029f51e9e6acd9e96 Mon Sep 17 00:00:00 2001 From: Joni Martikainen Date: Sun, 21 Sep 2014 23:33:07 +0300 Subject: [PATCH 05/18] check if call is active before mute check if call is active before mute. Prevents segfault. --- coreav.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coreav.cpp b/coreav.cpp index 9244fe433..fa4ce5cd8 100644 --- a/coreav.cpp +++ b/coreav.cpp @@ -273,7 +273,9 @@ void Core::decreaseVideoBusyness() void Core::micMuteToggle(int callId) { - calls[callId].muteMic = !calls[callId].muteMic; + if (calls[callId].active) { + calls[callId].muteMic = !calls[callId].muteMic; + } } void Core::onAvCancel(void* _toxav, int32_t callId, void* core) From 97b5599651f7dd469f4f7dcf8b1fe4e50cf6e381 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sat, 27 Sep 2014 15:39:17 +0200 Subject: [PATCH 06/18] MaskablePixmapWidget: fixed drawing routine --- widget/maskablepixmapwidget.cpp | 17 +++++++---------- widget/maskablepixmapwidget.h | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/widget/maskablepixmapwidget.cpp b/widget/maskablepixmapwidget.cpp index 6fdd3f03b..0959a5a20 100644 --- a/widget/maskablepixmapwidget.cpp +++ b/widget/maskablepixmapwidget.cpp @@ -16,20 +16,17 @@ #include "maskablepixmapwidget.h" #include -#include MaskablePixmapWidget::MaskablePixmapWidget(QWidget *parent, QSize size, QString maskName) : QWidget(parent) { - setMinimumSize(size); - setMaximumSize(size); - - mask = QPixmap(maskName).scaled(maximumSize(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + setFixedSize(size); + mask = QPixmap(maskName).scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); } void MaskablePixmapWidget::setPixmap(const QPixmap &pmap) { - pixmap = pmap.scaled(maximumSize(), Qt::KeepAspectRatio, Qt::SmoothTransformation); + pixmap = pmap.scaled(width(), height(), Qt::KeepAspectRatio, Qt::SmoothTransformation); } QPixmap MaskablePixmapWidget::getPixmap() const @@ -37,20 +34,20 @@ QPixmap MaskablePixmapWidget::getPixmap() const return pixmap; } -void MaskablePixmapWidget::paintEvent(QPaintEvent *ev) +void MaskablePixmapWidget::paintEvent(QPaintEvent *) { - QPixmap tmp(ev->rect().size()); + QPixmap tmp(width(), height()); tmp.fill(Qt::transparent); - QPoint offset((ev->rect().size().width()-pixmap.size().width())/2,(ev->rect().size().height()-pixmap.size().height())/2); + QPoint offset((width() - pixmap.size().width())/2,(height() - pixmap.size().height())/2); // centering the pixmap QPainter painter(&tmp); painter.setCompositionMode(QPainter::CompositionMode_Source); painter.drawPixmap(offset,pixmap); painter.setCompositionMode(QPainter::CompositionMode_DestinationIn); painter.drawPixmap(0,0,mask); - painter.end(); + painter.begin(this); painter.drawPixmap(0,0,tmp); } diff --git a/widget/maskablepixmapwidget.h b/widget/maskablepixmapwidget.h index 359b1ab00..faaf4abf3 100644 --- a/widget/maskablepixmapwidget.h +++ b/widget/maskablepixmapwidget.h @@ -32,7 +32,7 @@ signals: void clicked(); protected: - virtual void paintEvent(QPaintEvent *ev); + virtual void paintEvent(QPaintEvent *); virtual void mousePressEvent(QMouseEvent *); private: From de7ade033a0eb60a0913f477062588837b60ac40 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sat, 27 Sep 2014 16:37:16 +0200 Subject: [PATCH 07/18] MaskablePixmapWidget: white background, removed circular mask --- img/avatar_mask.png | Bin 5766 -> 3602 bytes img/avatar_mask_circle.png | Bin 9310 -> 0 bytes widget/form/genericchatform.cpp | 2 +- widget/maskablepixmapwidget.cpp | 3 ++- 4 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 img/avatar_mask_circle.png diff --git a/img/avatar_mask.png b/img/avatar_mask.png index 508914f0425838a3c1b5496ff87ff6388115ace3..2527e336522e8c2014d399ee1e277b2ce3bc9cf1 100644 GIT binary patch literal 3602 zcmeHK{W}wi7oWP}R&Kdmh08*cp{}>9ud-dq+lu9#q{++Vb={aTZ1{e=DmN=Nd5MK4 zEN`(%%(@kmCi1eG8Qrk4F)^Er&DZ@GzCVA@^L)3c!;*iXuDav>WJe%7^j-2&v6p$+F4}4Cc+X zGluahZdzbNxkK~bUcaqQ=?c@SbS9pCzhF|}cDGvkbGR<0%D~}=fbAqF9D=WzY%xyx zp3&zdZx*q48(y-2p6>2sR963xQR6dcg8;VRQBF8u#u@_y7QWQ2Z241oP?Xjr`8~jZ zE&hbd5}}q8b*$Tsslg6M6Zw%Az%p^|+X}n0yFXMJ-WO%lJ7$c5vK7+is}eUwwe{xL zgjq^9P!Rddktz{bEoz`5sZUIEdskNkZ?NaOefN&-0zX;{7!E-_7QD^N3Zsc>lMaY{ zCjOm1G$-ji#yB=;ctkiJa2syX#tS7+6`5xS@fjd%h>vbbR-Z`t#|36^ptPO>3F`LOErA6@D32}#5Bp%x z6s`RWHxPm?fHYB;Z7H3-i!Ruwb}uG8x}Iq-pGSA~5i@GEB?S{kn*oWN;M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Jx-K z&GtZHO^YOnTKw+gjce)Z;A{1cjy!+&1Y4F4xenQaAiL4XiHu^44s{AyLowF|g5*6C z(&b;=`4OGl)K*8YxHGs>kicJRj{3LBu{t#m)ab#8nkIPzK3$puyqHu9a&uEmmNrRk zu33F!TB!k4C5b)PZD=|BewX?5<{Kl9Ft(!$z8KYL6Y)zYJXc1{eh0LFJhH-n$m4s!b{{D{dc?>Io5NXWodEz zfCuU6s%&WEv?^A$qi*~MS4x9m{f>er{p<^jzI})8nak#XCQzkf_T9kM<<(s;8a+o$Q*P&H z&8t{NiMz5)SnHu%fWyFNSnI#xh`#&_e?_CAImyb)zK5{;thVBz^BI%JiLb*b_vosQc z9eAJi(bfrdPO-ep?rxugYlEf=VCRt`VhYg&R8N zzbj3=;FPoc;VqU&jT=?e%Vn`Qf7J>3=FzN`^Zo=j+;LrYL2lCE6GO%G_B#Xiax1#C zWN?zxZ6hdmffe7YKVkR^QrlD0d2f)R&-9CwQj_G^UNX*?LbG0rj=N!W=V4dFUbirb gWr(=7(0;p!HfY`X17htZas?mKQK?1qW}N^ diff --git a/img/avatar_mask_circle.png b/img/avatar_mask_circle.png deleted file mode 100644 index 83cb97dfc4e3874237965d1d0a961bd1cbb91592..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9310 zcmXAP2UHW?^Y*3?LTEukXwpOll`6d^D2R$6h|;7xZWx9;a;F&XD(cYbB{Rq%{1;kU&wjqFaXeV`+I^U3Fo*CKr-CIDcnBT zCp_xL9d95iDoX8EP(T>&Mu@js@EzaW6=Nv?kOwZ9n_Z25z5FIN3T0Wd|!J)`Po>v98vr^XR3+nE!u+ zN|{Hgz>Tvzjl0-w`( zJhirdFNB_Z+;X6wIsM~+Sv$Svx@V{(Vmr&j5e`q@6(T#<4}?0_mwRNi63d^x6C|W~ zE;|8(mM=OwM%*B8tMwqe|C9M}k0U|^&|wJc6hZw?=ej|r`bHQE zD#l~2*stI>PWGyRsQ|@KRNFP{stDygEK$kJ-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hTTCy8X)Q5)#_>uD`9SyHOaPET0rdHwRYkT=wtUvZJg;_ddXPrbWnFdxNqFV2W3B+ zy}tHZ^`~acJRdhL-sYvin|!UE5b4oQI1_TeOq#B5@g?NEW*SdhmyF60#MySwqJJK@ zlvT&6%-o_a{!)ptNnZJ{-`RcH#Aru*zV`M|`&XU{K;>LG4+^X*bxzYW%O3eQCI1Yu z7Ayuy7Z|rh-Lr5zV-4R6jJq941;5>GlI<$^pw$j>32LP|zg^ss+Nyjd$J#!~m*ti? z82JB5d=KX)XrsS_3xos{#2{ixPU^P4wpQZ)URe*ofB1J?XvL*NIi|DQ&h!AnVt>}ClTwf;GtA= z0j3M+u~u9Sb3Hmza7kh*#&1#lZqsP2>b!U3=DvdaA%61S_rT9R-*e=*9)LUe8oo`6;l_$Ed-IQLMfCTZ3|aufWG-t z%~}u8RQ>J`wSzvt+fr^>a_bnTXMa7QcC}+se_`?FA6`1q!w602e!9Ky8HNW(XSY$GR98*TH+#gYeOv0GYp#bpQYW diff --git a/widget/form/genericchatform.cpp b/widget/form/genericchatform.cpp index 1f7b827f7..a10fe0c83 100644 --- a/widget/form/genericchatform.cpp +++ b/widget/form/genericchatform.cpp @@ -36,7 +36,7 @@ GenericChatForm::GenericChatForm(QWidget *parent) : headWidget = new QWidget(); nameLabel = new CroppingLabel(); - avatar = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask_circle.png"); + avatar = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask.png"); QHBoxLayout *headLayout = new QHBoxLayout(), *mainFootLayout = new QHBoxLayout(); headTextLayout = new QVBoxLayout(); QVBoxLayout *mainLayout = new QVBoxLayout(); diff --git a/widget/maskablepixmapwidget.cpp b/widget/maskablepixmapwidget.cpp index 0959a5a20..cdbe5c9b9 100644 --- a/widget/maskablepixmapwidget.cpp +++ b/widget/maskablepixmapwidget.cpp @@ -42,7 +42,8 @@ void MaskablePixmapWidget::paintEvent(QPaintEvent *) QPoint offset((width() - pixmap.size().width())/2,(height() - pixmap.size().height())/2); // centering the pixmap QPainter painter(&tmp); - painter.setCompositionMode(QPainter::CompositionMode_Source); + painter.setCompositionMode(QPainter::CompositionMode_SourceOver); + painter.fillRect(0,0,width(),height(),Qt::white); painter.drawPixmap(offset,pixmap); painter.setCompositionMode(QPainter::CompositionMode_DestinationIn); painter.drawPixmap(0,0,mask); From a245255550fb8a331378f9b595a8dbb80b733278 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sat, 27 Sep 2014 16:39:54 +0200 Subject: [PATCH 08/18] removed avatar_mask_circle.png from qrc --- res.qrc | 1 - 1 file changed, 1 deletion(-) diff --git a/res.qrc b/res.qrc index 62b891ee6..603fc8ba2 100644 --- a/res.qrc +++ b/res.qrc @@ -143,6 +143,5 @@ translations/fi.qm translations/mannol.qm img/avatar_mask.png - img/avatar_mask_circle.png From 329f57d33a0251df1f95c0ddf356adab55ac5478 Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Sat, 27 Sep 2014 17:01:31 +0200 Subject: [PATCH 09/18] debian: Shouldn't depend on metapackages --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index ef73726b7..7883115e6 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Maintainer: John Smith Section: misc Priority: optional Standards-Version: 3.9.5 -Build-Depends: debhelper (>= 9), cdbs, qt5-qmake, qt5-default, libopenal-dev, libopencv-dev, libopus-dev +Build-Depends: debhelper (>= 9), cdbs, qt5-qmake, libopenal-dev, libopencv-dev, libopus-dev Package: qtox Architecture: any From 5411db5bec5b5899c2da4d19f7ddb9a189aca58c Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sat, 27 Sep 2014 17:41:17 +0200 Subject: [PATCH 10/18] MaskablePixmapWidget: background-color argument --- widget/maskablepixmapwidget.cpp | 5 +++-- widget/maskablepixmapwidget.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/widget/maskablepixmapwidget.cpp b/widget/maskablepixmapwidget.cpp index cdbe5c9b9..9257416fc 100644 --- a/widget/maskablepixmapwidget.cpp +++ b/widget/maskablepixmapwidget.cpp @@ -17,8 +17,9 @@ #include "maskablepixmapwidget.h" #include -MaskablePixmapWidget::MaskablePixmapWidget(QWidget *parent, QSize size, QString maskName) +MaskablePixmapWidget::MaskablePixmapWidget(QWidget *parent, QSize size, QString maskName, QColor background) : QWidget(parent) + , backgroundColor(background) { setFixedSize(size); mask = QPixmap(maskName).scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); @@ -43,7 +44,7 @@ void MaskablePixmapWidget::paintEvent(QPaintEvent *) QPainter painter(&tmp); painter.setCompositionMode(QPainter::CompositionMode_SourceOver); - painter.fillRect(0,0,width(),height(),Qt::white); + painter.fillRect(0,0,width(),height(),backgroundColor); painter.drawPixmap(offset,pixmap); painter.setCompositionMode(QPainter::CompositionMode_DestinationIn); painter.drawPixmap(0,0,mask); diff --git a/widget/maskablepixmapwidget.h b/widget/maskablepixmapwidget.h index faaf4abf3..72ae39b42 100644 --- a/widget/maskablepixmapwidget.h +++ b/widget/maskablepixmapwidget.h @@ -23,7 +23,7 @@ class MaskablePixmapWidget : public QWidget { Q_OBJECT public: - MaskablePixmapWidget(QWidget *parent, QSize size, QString maskName); + MaskablePixmapWidget(QWidget *parent, QSize size, QString maskName, QColor background = Qt::white); void setPixmap(const QPixmap &pmap); QPixmap getPixmap() const; @@ -40,6 +40,7 @@ private: QPixmap mask; QSize size; QString maskName; + QColor backgroundColor; }; #endif // MASKABLEPIXMAPWIDGET_H From 76e5876f0ae9c735db8c49b15039a61286be15da Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sat, 27 Sep 2014 17:45:38 +0200 Subject: [PATCH 11/18] set default avatar to contact_dark.png, removed active/inactive avatar switching --- widget/friendwidget.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/widget/friendwidget.cpp b/widget/friendwidget.cpp index c15ee03cc..6cea7ad03 100644 --- a/widget/friendwidget.cpp +++ b/widget/friendwidget.cpp @@ -45,7 +45,7 @@ FriendWidget::FriendWidget(int FriendId, QString id) setLayoutDirection(Qt::LeftToRight); // parent might have set Qt::RightToLeft avatar = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask.png"); - avatar->setPixmap(QPixmap(":img/contact.png")); + avatar->setPixmap(QPixmap(":img/contact_dark.png")); name.setText(id); //statusPic.setAlignment(Qt::AlignHCenter); statusPic.setPixmap(QPixmap(":img/status/dot_away.png")); @@ -140,8 +140,6 @@ void FriendWidget::setAsActiveChatroom() QPalette pal3; pal3.setColor(QPalette::Background, Qt::white); this->setPalette(pal3); - if (isDefaultAvatar) - avatar->setPixmap(QPixmap(":img/contact_dark.png")); } void FriendWidget::setAsInactiveChatroom() @@ -160,9 +158,6 @@ void FriendWidget::setAsInactiveChatroom() QPalette pal3; pal3.setColor(QPalette::Background, QColor(65,65,65,255)); this->setPalette(pal3); - - if (isDefaultAvatar) - avatar->setPixmap(QPixmap(":img/contact.png")); } void FriendWidget::updateStatusLight() From bb214b53f7aa97069fd3c245b72f7a811978ff9f Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sat, 27 Sep 2014 17:58:56 +0200 Subject: [PATCH 12/18] set profile picture to contact_dark.png --- widget/widget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widget/widget.cpp b/widget/widget.cpp index da034ace2..8057c221f 100644 --- a/widget/widget.cpp +++ b/widget/widget.cpp @@ -113,7 +113,7 @@ Widget::Widget(QWidget *parent) isWindowMinimized = 0; profilePicture = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask.png"); - profilePicture->setPixmap(QPixmap(":/img/avatar.png")); + profilePicture->setPixmap(QPixmap(":/img/contact_dark.png")); ui->horizontalLayout_3->insertWidget(0,profilePicture); ui->mainContent->setLayout(new QVBoxLayout()); From 18330f0928a07d01740cbc2fd76896d30afd0932 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sat, 27 Sep 2014 18:00:13 +0200 Subject: [PATCH 13/18] MaskablePixmapWidget: set cursor to PointingHandCursor if clickable --- widget/maskablepixmapwidget.cpp | 14 +++++++++++++- widget/maskablepixmapwidget.h | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/widget/maskablepixmapwidget.cpp b/widget/maskablepixmapwidget.cpp index 9257416fc..bc47f1154 100644 --- a/widget/maskablepixmapwidget.cpp +++ b/widget/maskablepixmapwidget.cpp @@ -20,11 +20,22 @@ MaskablePixmapWidget::MaskablePixmapWidget(QWidget *parent, QSize size, QString maskName, QColor background) : QWidget(parent) , backgroundColor(background) + , clickable(false) { setFixedSize(size); mask = QPixmap(maskName).scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); } +void MaskablePixmapWidget::setClickable(bool clickable) +{ + this->clickable = clickable; + + if (clickable) + setCursor(Qt::PointingHandCursor); + else + unsetCursor(); +} + void MaskablePixmapWidget::setPixmap(const QPixmap &pmap) { pixmap = pmap.scaled(width(), height(), Qt::KeepAspectRatio, Qt::SmoothTransformation); @@ -56,5 +67,6 @@ void MaskablePixmapWidget::paintEvent(QPaintEvent *) void MaskablePixmapWidget::mousePressEvent(QMouseEvent*) { - emit clicked(); + if(clickable) + emit clicked(); } diff --git a/widget/maskablepixmapwidget.h b/widget/maskablepixmapwidget.h index 72ae39b42..c4601d227 100644 --- a/widget/maskablepixmapwidget.h +++ b/widget/maskablepixmapwidget.h @@ -25,6 +25,7 @@ class MaskablePixmapWidget : public QWidget public: MaskablePixmapWidget(QWidget *parent, QSize size, QString maskName, QColor background = Qt::white); + void setClickable(bool clickable); void setPixmap(const QPixmap &pmap); QPixmap getPixmap() const; @@ -41,6 +42,7 @@ private: QSize size; QString maskName; QColor backgroundColor; + bool clickable; }; #endif // MASKABLEPIXMAPWIDGET_H From 2b58d45b73920808ce0843edd8aef42c8e5599ef Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sat, 27 Sep 2014 19:13:27 +0200 Subject: [PATCH 14/18] MaskablePixmapWidget: use KeepAspectRatioByExpanding --- widget/maskablepixmapwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widget/maskablepixmapwidget.cpp b/widget/maskablepixmapwidget.cpp index bc47f1154..305eb015c 100644 --- a/widget/maskablepixmapwidget.cpp +++ b/widget/maskablepixmapwidget.cpp @@ -38,7 +38,7 @@ void MaskablePixmapWidget::setClickable(bool clickable) void MaskablePixmapWidget::setPixmap(const QPixmap &pmap) { - pixmap = pmap.scaled(width(), height(), Qt::KeepAspectRatio, Qt::SmoothTransformation); + pixmap = pmap.scaled(width(), height(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); } QPixmap MaskablePixmapWidget::getPixmap() const From 9b52d3174d69b2794d9a8ec322881bb27df185fc Mon Sep 17 00:00:00 2001 From: krepa098 Date: Sat, 27 Sep 2014 19:13:46 +0200 Subject: [PATCH 15/18] set clickable to true --- widget/widget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/widget/widget.cpp b/widget/widget.cpp index 8057c221f..22f65aa74 100644 --- a/widget/widget.cpp +++ b/widget/widget.cpp @@ -114,6 +114,7 @@ Widget::Widget(QWidget *parent) profilePicture = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask.png"); profilePicture->setPixmap(QPixmap(":/img/contact_dark.png")); + profilePicture->setClickable(true); ui->horizontalLayout_3->insertWidget(0,profilePicture); ui->mainContent->setLayout(new QVBoxLayout()); From 63252d2fc0984b16aeee42fa54a3af26e61c1389 Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Sat, 27 Sep 2014 20:21:56 +0200 Subject: [PATCH 16/18] Fix merge --- widget/form/chatform.cpp | 2 +- widget/friendwidget.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/widget/form/chatform.cpp b/widget/form/chatform.cpp index dc8b7bf05..a200eff08 100644 --- a/widget/form/chatform.cpp +++ b/widget/form/chatform.cpp @@ -505,5 +505,5 @@ void ChatForm::onAvatarRemoved(int FriendId) if (FriendId != f->friendId) return; - avatarLabel->setPixmap(QPixmap(":/img/contact_dark.png")); + avatar->setPixmap(QPixmap(":/img/contact_dark.png")); } diff --git a/widget/friendwidget.cpp b/widget/friendwidget.cpp index 7b09c2b95..5bce871f7 100644 --- a/widget/friendwidget.cpp +++ b/widget/friendwidget.cpp @@ -210,7 +210,7 @@ void FriendWidget::onAvatarRemoved(int FriendId) return; isDefaultAvatar = true; - avatar.setPixmap(QPixmap(":img/contact.png")); + avatar->setPixmap(QPixmap(":img/contact.png")); } void FriendWidget::mousePressEvent(QMouseEvent *ev) From f6176e4a3cb522679a40fff790e6ef30da98f35f Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Sat, 27 Sep 2014 21:07:13 +0200 Subject: [PATCH 17/18] buildPackages.sh shouldn't be interactive --- tools/buildPackages.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/buildPackages.sh b/tools/buildPackages.sh index dc01f4a82..80117b281 100755 --- a/tools/buildPackages.sh +++ b/tools/buildPackages.sh @@ -56,9 +56,9 @@ done if [[ $OPT_APT = "true" ]]; then echo "Installing missing tools (if any)..." if [[ $EUID -ne 0 && $OPT_SUDO = "true" ]]; then - sudo apt-get install wget debhelper cdbs devscripts alien tar gzip build-essential + sudo apt-get install wget debhelper cdbs devscripts alien tar gzip build-essential -y else - apt-get install wget debhelper cdbs devscripts alien tar gzip build-essential + apt-get install wget debhelper cdbs devscripts alien tar gzip build-essential -y fi fi From 702daa987b2eb252706d840cd6cda0406f03bb9e Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Sat, 27 Sep 2014 21:25:42 +0200 Subject: [PATCH 18/18] Make buildPackages.sh install dependencies --- tools/buildPackages.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/buildPackages.sh b/tools/buildPackages.sh index 80117b281..e028670e5 100755 --- a/tools/buildPackages.sh +++ b/tools/buildPackages.sh @@ -62,6 +62,16 @@ if [[ $OPT_APT = "true" ]]; then fi fi +# Get the requried dependencies if needed +if [[ $OPT_APT = "true" ]]; then + echo "Installing missing dependencies (if any)..." + if [[ $EUID -ne 0 && $OPT_SUDO = "true" ]]; then + sudo apt-get install qt5-qmake libopenal-dev libopencv-dev libopus-dev -y + else + apt-get install qt5-qmake libopenal-dev libopencv-dev libopus-dev -y + fi +fi + mkdir -p .packages cd .packages