Merge pull request #14 from F1ynn/master
New group chat notification icons
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 613 B |
Before Width: | Height: | Size: 605 B After Width: | Height: | Size: 796 B |
Before Width: | Height: | Size: 764 B After Width: | Height: | Size: 814 B |
BIN
img/status/dot_groupchat_notification_2.png
Normal file
After Width: | Height: | Size: 807 B |
72
ui/callButton/callButton.css
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
QPushButton#green
|
||||||
|
{
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("ui/callButton/callButton.png");
|
||||||
|
background-repeat: none;
|
||||||
|
border: none;
|
||||||
|
width: 50px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#green:hover
|
||||||
|
{
|
||||||
|
background-image: url("ui/callButton/callButtonHover.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#green:pressed
|
||||||
|
{
|
||||||
|
background-image: url("ui/callButton/callButtonPressed.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#red
|
||||||
|
{
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("ui/callButton/callButtonRed.png");
|
||||||
|
background-repeat: none;
|
||||||
|
border: none;
|
||||||
|
width: 50px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
QPushButton#red:hover
|
||||||
|
{
|
||||||
|
background-image: url("ui/callButton/callButtonRedHover.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#red:pressed
|
||||||
|
{
|
||||||
|
background-image: url("ui/callButton/callButtonRedPressed.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#yellow
|
||||||
|
{
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("ui/callButton/callButtonYellow.png");
|
||||||
|
background-repeat: none;
|
||||||
|
border: none;
|
||||||
|
width: 50px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
QPushButton#yellow:hover
|
||||||
|
{
|
||||||
|
background-image: url("ui/callButton/callButtonYellowHover.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#yellow:pressed
|
||||||
|
{
|
||||||
|
background-image: url("ui/callButton/callButtonYellowPressed.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#grey
|
||||||
|
{
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("ui/callButton/callButtonDisabled.png");
|
||||||
|
background-repeat: none;
|
||||||
|
border: none;
|
||||||
|
width: 50px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
BIN
ui/callButton/callButton.png
Normal file
After Width: | Height: | Size: 974 B |
BIN
ui/callButton/callButton.xcf
Normal file
BIN
ui/callButton/callButtonDisabled.png
Normal file
After Width: | Height: | Size: 899 B |
BIN
ui/callButton/callButtonHover.png
Normal file
After Width: | Height: | Size: 946 B |
BIN
ui/callButton/callButtonPressed.png
Normal file
After Width: | Height: | Size: 980 B |
BIN
ui/callButton/callButtonRed.png
Normal file
After Width: | Height: | Size: 884 B |
BIN
ui/callButton/callButtonRedHover.png
Normal file
After Width: | Height: | Size: 918 B |
BIN
ui/callButton/callButtonRedPressed.png
Normal file
After Width: | Height: | Size: 951 B |
BIN
ui/callButton/callButtonYellow.png
Normal file
After Width: | Height: | Size: 854 B |
BIN
ui/callButton/callButtonYellowHover.png
Normal file
After Width: | Height: | Size: 848 B |
BIN
ui/callButton/callButtonYellowPressed.png
Normal file
After Width: | Height: | Size: 897 B |
22
ui/emoteButton/emoteButton.css
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
QPushButton
|
||||||
|
{
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("ui/emoteButton/emoteButton.png");
|
||||||
|
background-repeat: none;
|
||||||
|
border: none;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
QPushButton:hover
|
||||||
|
{
|
||||||
|
background-image: url("ui/emoteButton/emoteButtonHover.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:pressed
|
||||||
|
{
|
||||||
|
background-image: url("ui/emoteButton/emoteButtonPressed.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
BIN
ui/emoteButton/emoteButton.png
Normal file
After Width: | Height: | Size: 758 B |
BIN
ui/emoteButton/emoteButton.xcf
Normal file
BIN
ui/emoteButton/emoteButtonHover.png
Normal file
After Width: | Height: | Size: 745 B |
BIN
ui/emoteButton/emoteButtonPressed.png
Normal file
After Width: | Height: | Size: 754 B |
22
ui/fileButton/fileButton.css
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
QPushButton
|
||||||
|
{
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("ui/fileButton/fileButton.png");
|
||||||
|
background-repeat: none;
|
||||||
|
border: none;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
QPushButton:hover
|
||||||
|
{
|
||||||
|
background-image: url("ui/fileButton/fileButtonHover.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:pressed
|
||||||
|
{
|
||||||
|
background-image: url("ui/fileButton/fileButtonPressed.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
BIN
ui/fileButton/fileButton.png
Normal file
After Width: | Height: | Size: 857 B |
BIN
ui/fileButton/fileButton.xcf
Normal file
BIN
ui/fileButton/fileButtonHover.png
Normal file
After Width: | Height: | Size: 848 B |
BIN
ui/fileButton/fileButtonPressed.png
Normal file
After Width: | Height: | Size: 839 B |
22
ui/sendButton/sendButton.css
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
QPushButton
|
||||||
|
{
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("ui/sendButton/sendButton.png");
|
||||||
|
background-repeat: none;
|
||||||
|
border: none;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
QPushButton:hover
|
||||||
|
{
|
||||||
|
background-image: url("ui/sendButton/sendButtonHover.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:pressed
|
||||||
|
{
|
||||||
|
background-image: url("ui/sendButton/sendButtonPressed.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
BIN
ui/sendButton/sendButton.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
ui/sendButton/sendButton.xcf
Normal file
BIN
ui/sendButton/sendButtonHover.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
ui/sendButton/sendButtonPressed.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
71
ui/videoButton/videoButton.css
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
QPushButton#green
|
||||||
|
{
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("ui/videoButton/videoButton.png");
|
||||||
|
background-repeat: none;
|
||||||
|
border: none;
|
||||||
|
width: 50px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#green:hover
|
||||||
|
{
|
||||||
|
background-image: url("ui/videoButton/videoButtonHover.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#green:pressed
|
||||||
|
{
|
||||||
|
background-image: url("ui/videoButton/videoButtonPressed.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#red
|
||||||
|
{
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("ui/videoButton/videoButtonRed.png");
|
||||||
|
background-repeat: none;
|
||||||
|
border: none;
|
||||||
|
width: 50px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
QPushButton#red:hover
|
||||||
|
{
|
||||||
|
background-image: url("ui/videoButton/videoButtonRedHover.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#red:pressed
|
||||||
|
{
|
||||||
|
background-image: url("ui/videoButton/videoButtonRedPressed.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#yellow
|
||||||
|
{
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("ui/videoButton/videoButtonYellow.png");
|
||||||
|
background-repeat: none;
|
||||||
|
border: none;
|
||||||
|
width: 50px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
QPushButton#yellow:hover
|
||||||
|
{
|
||||||
|
background-image: url("ui/videoButton/videoButtonYellowHover.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#yellow:pressed
|
||||||
|
{
|
||||||
|
background-image: url("ui/videoButton/videoButtonYellowPressed.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#grey
|
||||||
|
{
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url("ui/videoButton/videoButtonDisabled.png");
|
||||||
|
background-repeat: none;
|
||||||
|
border: none;
|
||||||
|
width: 50px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
BIN
ui/videoButton/videoButton.png
Normal file
After Width: | Height: | Size: 636 B |
BIN
ui/videoButton/videoButton.xcf
Normal file
BIN
ui/videoButton/videoButtonDisabled.png
Normal file
After Width: | Height: | Size: 597 B |
BIN
ui/videoButton/videoButtonHover.png
Normal file
After Width: | Height: | Size: 613 B |
BIN
ui/videoButton/videoButtonPressed.png
Normal file
After Width: | Height: | Size: 617 B |
BIN
ui/videoButton/videoButtonRed.png
Normal file
After Width: | Height: | Size: 571 B |
BIN
ui/videoButton/videoButtonRedHover.png
Normal file
After Width: | Height: | Size: 574 B |
BIN
ui/videoButton/videoButtonRedPressed.png
Normal file
After Width: | Height: | Size: 574 B |
BIN
ui/videoButton/videoButtonYellow.png
Normal file
After Width: | Height: | Size: 577 B |
BIN
ui/videoButton/videoButtonYellowHover.png
Normal file
After Width: | Height: | Size: 573 B |
BIN
ui/videoButton/videoButtonYellowPressed.png
Normal file
After Width: | Height: | Size: 572 B |
|
@ -18,7 +18,7 @@ ChatForm::ChatForm(Friend* chatFriend)
|
||||||
headTextLayout = new QVBoxLayout(), mainLayout = new QVBoxLayout(), footButtonsSmall = new QVBoxLayout();
|
headTextLayout = new QVBoxLayout(), mainLayout = new QVBoxLayout(), footButtonsSmall = new QVBoxLayout();
|
||||||
mainChatLayout = new QGridLayout();
|
mainChatLayout = new QGridLayout();
|
||||||
msgEdit = new ChatTextEdit();
|
msgEdit = new ChatTextEdit();
|
||||||
sendButton = new QPushButton(), fileButton = new QPushButton(), emoteButton = new QPushButton(), callButton = new QPushButton();
|
sendButton = new QPushButton(), fileButton = new QPushButton(), emoteButton = new QPushButton(), callButton = new QPushButton(), videoButton = new QPushButton();
|
||||||
chatArea = new QScrollArea();
|
chatArea = new QScrollArea();
|
||||||
|
|
||||||
QFont bold;
|
QFont bold;
|
||||||
|
@ -38,32 +38,68 @@ ChatForm::ChatForm(Friend* chatFriend)
|
||||||
footButtonsSmall->setSpacing(2);
|
footButtonsSmall->setSpacing(2);
|
||||||
|
|
||||||
msgEdit->setFixedHeight(50);
|
msgEdit->setFixedHeight(50);
|
||||||
|
|
||||||
|
QString sendButtonStylesheet = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
QFile f("ui/sendButton/sendButton.css");
|
||||||
|
f.open(QFile::ReadOnly | QFile::Text);
|
||||||
|
QTextStream sendButtonStylesheetStream(&f);
|
||||||
|
sendButtonStylesheet = sendButtonStylesheetStream.readAll();
|
||||||
|
}
|
||||||
|
catch (int e) {}
|
||||||
|
sendButton->setStyleSheet(sendButtonStylesheet);
|
||||||
|
|
||||||
QPalette toxgreen;
|
QPalette toxgreen;
|
||||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
||||||
sendButton->setIcon(QIcon("img/button icons/sendmessage_2x.png"));
|
|
||||||
sendButton->setFlat(true);
|
|
||||||
sendButton->setPalette(toxgreen);
|
QString fileButtonStylesheet = "";
|
||||||
sendButton->setAutoFillBackground(true);
|
try
|
||||||
sendButton->setFixedSize(50, 50);
|
{
|
||||||
sendButton->setIconSize(QSize(32,32));
|
QFile f("ui/fileButton/fileButton.css");
|
||||||
fileButton->setIcon(QIcon("img/button icons/attach_2x.png"));
|
f.open(QFile::ReadOnly | QFile::Text);
|
||||||
fileButton->setFlat(true);
|
QTextStream fileButtonStylesheetStream(&f);
|
||||||
fileButton->setPalette(toxgreen);
|
fileButtonStylesheet = fileButtonStylesheetStream.readAll();
|
||||||
fileButton->setAutoFillBackground(true);
|
}
|
||||||
fileButton->setIconSize(QSize(16,16));
|
catch (int e) {}
|
||||||
fileButton->setFixedSize(24,24);
|
fileButton->setStyleSheet(fileButtonStylesheet);
|
||||||
emoteButton->setIcon(QIcon("img/button icons/emoticon_2x.png"));
|
|
||||||
emoteButton->setFlat(true);
|
|
||||||
emoteButton->setPalette(toxgreen);
|
QString emoteButtonStylesheet = "";
|
||||||
emoteButton->setAutoFillBackground(true);
|
try
|
||||||
emoteButton->setIconSize(QSize(16,16));
|
{
|
||||||
emoteButton->setFixedSize(24,24);
|
QFile f("ui/emoteButton/emoteButton.css");
|
||||||
callButton->setIcon(QIcon("img/button icons/call_2x.png"));
|
f.open(QFile::ReadOnly | QFile::Text);
|
||||||
callButton->setFlat(true);
|
QTextStream emoteButtonStylesheetStream(&f);
|
||||||
callButton->setPalette(toxgreen);
|
emoteButtonStylesheet = emoteButtonStylesheetStream.readAll();
|
||||||
callButton->setAutoFillBackground(true);
|
}
|
||||||
callButton->setIconSize(QSize(25,25));
|
catch (int e) {}
|
||||||
callButton->setFixedSize(50,40);
|
emoteButton->setStyleSheet(emoteButtonStylesheet);
|
||||||
|
|
||||||
|
QString callButtonStylesheet = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
QFile f("ui/callButton/callButton.css");
|
||||||
|
f.open(QFile::ReadOnly | QFile::Text);
|
||||||
|
QTextStream callButtonStylesheetStream(&f);
|
||||||
|
callButtonStylesheet = callButtonStylesheetStream.readAll();
|
||||||
|
}
|
||||||
|
catch (int e) {}
|
||||||
|
callButton->setObjectName("green");
|
||||||
|
callButton->setStyleSheet(callButtonStylesheet);
|
||||||
|
|
||||||
|
QString videoButtonStylesheet = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
QFile f("ui/videoButton/videoButton.css");
|
||||||
|
f.open(QFile::ReadOnly | QFile::Text);
|
||||||
|
QTextStream videoButtonStylesheetStream(&f);
|
||||||
|
videoButtonStylesheet = videoButtonStylesheetStream.readAll();
|
||||||
|
}
|
||||||
|
catch (int e) {}
|
||||||
|
videoButton->setObjectName("green");
|
||||||
|
videoButton->setStyleSheet(videoButtonStylesheet);
|
||||||
|
|
||||||
main->setLayout(mainLayout);
|
main->setLayout(mainLayout);
|
||||||
mainLayout->addWidget(chatArea);
|
mainLayout->addWidget(chatArea);
|
||||||
|
@ -84,6 +120,7 @@ ChatForm::ChatForm(Friend* chatFriend)
|
||||||
headLayout->addLayout(headTextLayout);
|
headLayout->addLayout(headTextLayout);
|
||||||
headLayout->addStretch();
|
headLayout->addStretch();
|
||||||
headLayout->addWidget(callButton);
|
headLayout->addWidget(callButton);
|
||||||
|
headLayout->addWidget(videoButton);
|
||||||
|
|
||||||
headTextLayout->addStretch();
|
headTextLayout->addStretch();
|
||||||
headTextLayout->addWidget(name);
|
headTextLayout->addWidget(name);
|
||||||
|
@ -290,9 +327,8 @@ void ChatForm::onAvInvite(int FriendId, int CallId)
|
||||||
if (FriendId != f->friendId)
|
if (FriendId != f->friendId)
|
||||||
return;
|
return;
|
||||||
callId = CallId;
|
callId = CallId;
|
||||||
QPalette callinvitePal;
|
callButton->setObjectName("yellow");
|
||||||
callinvitePal.setColor(QPalette::Button, QColor(206, 191, 69)); // Call invite orange
|
callButton->style()->polish(callButton);
|
||||||
callButton->setPalette(callinvitePal);
|
|
||||||
callButton->disconnect();
|
callButton->disconnect();
|
||||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onAnswerCallTriggered()));
|
connect(callButton, SIGNAL(clicked()), this, SLOT(onAnswerCallTriggered()));
|
||||||
}
|
}
|
||||||
|
@ -302,9 +338,8 @@ void ChatForm::onAvStart(int FriendId, int CallId)
|
||||||
if (FriendId != f->friendId)
|
if (FriendId != f->friendId)
|
||||||
return;
|
return;
|
||||||
callId = CallId;
|
callId = CallId;
|
||||||
QPalette toxred;
|
callButton->setObjectName("red");
|
||||||
toxred.setColor(QPalette::Button, QColor(200,78,78)); // Tox Red
|
callButton->style()->polish(callButton);
|
||||||
callButton->setPalette(toxred);
|
|
||||||
callButton->disconnect();
|
callButton->disconnect();
|
||||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onHangupCallTriggered()));
|
connect(callButton, SIGNAL(clicked()), this, SLOT(onHangupCallTriggered()));
|
||||||
}
|
}
|
||||||
|
@ -313,9 +348,8 @@ void ChatForm::onAvCancel(int FriendId, int)
|
||||||
{
|
{
|
||||||
if (FriendId != f->friendId)
|
if (FriendId != f->friendId)
|
||||||
return;
|
return;
|
||||||
QPalette toxgreen;
|
callButton->setObjectName("red");
|
||||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
callButton->style()->polish(callButton);
|
||||||
callButton->setPalette(toxgreen);
|
|
||||||
callButton->disconnect();
|
callButton->disconnect();
|
||||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||||
}
|
}
|
||||||
|
@ -324,9 +358,8 @@ void ChatForm::onAvEnd(int FriendId, int)
|
||||||
{
|
{
|
||||||
if (FriendId != f->friendId)
|
if (FriendId != f->friendId)
|
||||||
return;
|
return;
|
||||||
QPalette toxgreen;
|
callButton->setObjectName("green");
|
||||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
callButton->style()->polish(callButton);
|
||||||
callButton->setPalette(toxgreen);
|
|
||||||
callButton->disconnect();
|
callButton->disconnect();
|
||||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||||
}
|
}
|
||||||
|
@ -336,9 +369,8 @@ void ChatForm::onAvRinging(int FriendId, int CallId)
|
||||||
if (FriendId != f->friendId)
|
if (FriendId != f->friendId)
|
||||||
return;
|
return;
|
||||||
callId = CallId;
|
callId = CallId;
|
||||||
QPalette pal;
|
callButton->setObjectName("grey");
|
||||||
pal.setColor(QPalette::Button, Qt::gray); // Call ringing grey
|
callButton->style()->polish(callButton);
|
||||||
callButton->setPalette(pal);
|
|
||||||
callButton->disconnect();
|
callButton->disconnect();
|
||||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCancelCallTriggered()));
|
connect(callButton, SIGNAL(clicked()), this, SLOT(onCancelCallTriggered()));
|
||||||
}
|
}
|
||||||
|
@ -347,9 +379,8 @@ void ChatForm::onAvStarting(int FriendId, int)
|
||||||
{
|
{
|
||||||
if (FriendId != f->friendId)
|
if (FriendId != f->friendId)
|
||||||
return;
|
return;
|
||||||
QPalette toxred;
|
callButton->setObjectName("red");
|
||||||
toxred.setColor(QPalette::Button, QColor(200,78,78)); // Tox Red
|
callButton->style()->polish(callButton);
|
||||||
callButton->setPalette(toxred);
|
|
||||||
callButton->disconnect();
|
callButton->disconnect();
|
||||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onHangupCallTriggered()));
|
connect(callButton, SIGNAL(clicked()), this, SLOT(onHangupCallTriggered()));
|
||||||
}
|
}
|
||||||
|
@ -358,9 +389,8 @@ void ChatForm::onAvEnding(int FriendId, int)
|
||||||
{
|
{
|
||||||
if (FriendId != f->friendId)
|
if (FriendId != f->friendId)
|
||||||
return;
|
return;
|
||||||
QPalette toxgreen;
|
callButton->setObjectName("green");
|
||||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
callButton->style()->polish(callButton);
|
||||||
callButton->setPalette(toxgreen);
|
|
||||||
callButton->disconnect();
|
callButton->disconnect();
|
||||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||||
}
|
}
|
||||||
|
@ -369,9 +399,8 @@ void ChatForm::onAvRequestTimeout(int FriendId, int)
|
||||||
{
|
{
|
||||||
if (FriendId != f->friendId)
|
if (FriendId != f->friendId)
|
||||||
return;
|
return;
|
||||||
QPalette toxgreen;
|
callButton->setObjectName("green");
|
||||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
callButton->style()->polish(callButton);
|
||||||
callButton->setPalette(toxgreen);
|
|
||||||
callButton->disconnect();
|
callButton->disconnect();
|
||||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||||
}
|
}
|
||||||
|
@ -380,9 +409,8 @@ void ChatForm::onAvPeerTimeout(int FriendId, int)
|
||||||
{
|
{
|
||||||
if (FriendId != f->friendId)
|
if (FriendId != f->friendId)
|
||||||
return;
|
return;
|
||||||
QPalette toxgreen;
|
callButton->setObjectName("green");
|
||||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
callButton->style()->polish(callButton);
|
||||||
callButton->setPalette(toxgreen);
|
|
||||||
callButton->disconnect();
|
callButton->disconnect();
|
||||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||||
}
|
}
|
||||||
|
@ -405,9 +433,8 @@ void ChatForm::onCallTriggered()
|
||||||
|
|
||||||
void ChatForm::onCancelCallTriggered()
|
void ChatForm::onCancelCallTriggered()
|
||||||
{
|
{
|
||||||
QPalette toxgreen;
|
callButton->setObjectName("green");
|
||||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
callButton->style()->polish(callButton);
|
||||||
callButton->setPalette(toxgreen);
|
|
||||||
callButton->disconnect();
|
callButton->disconnect();
|
||||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||||
emit cancelCall(callId, f->friendId);
|
emit cancelCall(callId, f->friendId);
|
||||||
|
|
|
@ -72,7 +72,7 @@ private:
|
||||||
QGridLayout *mainChatLayout;
|
QGridLayout *mainChatLayout;
|
||||||
QLabel *avatar, *name, *statusMessage;
|
QLabel *avatar, *name, *statusMessage;
|
||||||
ChatTextEdit *msgEdit;
|
ChatTextEdit *msgEdit;
|
||||||
QPushButton *sendButton, *fileButton, *emoteButton, *callButton;
|
QPushButton *sendButton, *fileButton, *emoteButton, *callButton, *videoButton;
|
||||||
QScrollArea *chatArea;
|
QScrollArea *chatArea;
|
||||||
QWidget *main, *head, *chatAreaWidget;
|
QWidget *main, *head, *chatAreaWidget;
|
||||||
QString previousName;
|
QString previousName;
|
||||||
|
|
|
@ -45,13 +45,17 @@ GroupChatForm::GroupChatForm(Group* chatGroup)
|
||||||
mainChatLayout->setColumnStretch(1,1);
|
mainChatLayout->setColumnStretch(1,1);
|
||||||
mainChatLayout->setHorizontalSpacing(10);
|
mainChatLayout->setHorizontalSpacing(10);
|
||||||
|
|
||||||
sendButton->setIcon(QIcon("img/button icons/sendmessage_2x.png"));
|
QString sendButtonStylesheet = "";
|
||||||
sendButton->setIconSize(QSize(32,32));
|
try
|
||||||
sendButton->setFlat(true);
|
{
|
||||||
QPalette pal;
|
QFile f("ui/sendButton/sendButton.css");
|
||||||
pal.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
f.open(QFile::ReadOnly | QFile::Text);
|
||||||
sendButton->setPalette(pal);
|
QTextStream sendButtonStylesheetStream(&f);
|
||||||
sendButton->setAutoFillBackground(true);
|
sendButtonStylesheet = sendButtonStylesheetStream.readAll();
|
||||||
|
}
|
||||||
|
catch (int e) {}
|
||||||
|
sendButton->setStyleSheet(sendButtonStylesheet);
|
||||||
|
|
||||||
msgEdit->setFixedHeight(50);
|
msgEdit->setFixedHeight(50);
|
||||||
sendButton->setFixedSize(50, 50);
|
sendButton->setFixedSize(50, 50);
|
||||||
|
|
||||||
|
|
|
@ -350,13 +350,13 @@ void Widget::onFriendMessageReceived(int friendId, const QString& message)
|
||||||
if ((f->friendId != f2->friendId) || isFriendWidgetActive == 0)
|
if ((f->friendId != f2->friendId) || isFriendWidgetActive == 0)
|
||||||
{
|
{
|
||||||
f->hasNewMessages = 1;
|
f->hasNewMessages = 1;
|
||||||
playMessageNotification();
|
newMessageAlert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
f->hasNewMessages = 1;
|
f->hasNewMessages = 1;
|
||||||
playMessageNotification();
|
newMessageAlert();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateFriendStatusLights(friendId);
|
updateFriendStatusLights(friendId);
|
||||||
|
@ -380,8 +380,9 @@ void Widget::updateFriendStatusLights(int friendId)
|
||||||
f->widget->statusPic.setPixmap(QPixmap("img/status/dot_away_notification.png"));
|
f->widget->statusPic.setPixmap(QPixmap("img/status/dot_away_notification.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::playMessageNotification()
|
void Widget::newMessageAlert()
|
||||||
{
|
{
|
||||||
|
QApplication::alert(this, 1000);
|
||||||
QSound::play("audio/notification.wav");
|
QSound::play("audio/notification.wav");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,7 +428,7 @@ void Widget::onGroupMessageReceived(int groupnumber, int friendgroupnumber, cons
|
||||||
{
|
{
|
||||||
if (message.contains(Settings::getInstance().getUsername(), Qt::CaseInsensitive))
|
if (message.contains(Settings::getInstance().getUsername(), Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
playMessageNotification();
|
newMessageAlert();
|
||||||
g->hasNewMessages = 1;
|
g->hasNewMessages = 1;
|
||||||
g->userWasMentioned = 1;
|
g->userWasMentioned = 1;
|
||||||
g->widget->statusPic.setPixmap(QPixmap("img/status/dot_groupchat_notification.png"));
|
g->widget->statusPic.setPixmap(QPixmap("img/status/dot_groupchat_notification.png"));
|
||||||
|
|
|
@ -84,7 +84,7 @@ private:
|
||||||
GroupWidget* activeGroupWidget;
|
GroupWidget* activeGroupWidget;
|
||||||
void updateFriendStatusLights(int friendId);
|
void updateFriendStatusLights(int friendId);
|
||||||
int isFriendWidgetActive, isGroupWidgetActive;
|
int isFriendWidgetActive, isGroupWidgetActive;
|
||||||
void playMessageNotification();
|
void newMessageAlert();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WIDGET_H
|
#endif // WIDGET_H
|
||||||
|
|