Added mockup-like buttons
68
ui/callButton/callButton.css
Normal file
|
@ -0,0 +1,68 @@
|
|||
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;
|
||||
}
|
||||
|
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 |
18
ui/emoteButton/emoteButton.css
Normal file
|
@ -0,0 +1,18 @@
|
|||
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");
|
||||
}
|
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 |
18
ui/fileButton/fileButton.css
Normal file
|
@ -0,0 +1,18 @@
|
|||
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");
|
||||
}
|
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 |
18
ui/sendButton/sendButton.css
Normal file
|
@ -0,0 +1,18 @@
|
|||
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");
|
||||
}
|
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 |
|
@ -38,32 +38,58 @@ ChatForm::ChatForm(Friend* chatFriend)
|
|||
footButtonsSmall->setSpacing(2);
|
||||
|
||||
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;
|
||||
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);
|
||||
sendButton->setAutoFillBackground(true);
|
||||
sendButton->setFixedSize(50, 50);
|
||||
sendButton->setIconSize(QSize(32,32));
|
||||
fileButton->setIcon(QIcon("img/button icons/attach_2x.png"));
|
||||
fileButton->setFlat(true);
|
||||
fileButton->setPalette(toxgreen);
|
||||
fileButton->setAutoFillBackground(true);
|
||||
fileButton->setIconSize(QSize(16,16));
|
||||
fileButton->setFixedSize(24,24);
|
||||
emoteButton->setIcon(QIcon("img/button icons/emoticon_2x.png"));
|
||||
emoteButton->setFlat(true);
|
||||
emoteButton->setPalette(toxgreen);
|
||||
emoteButton->setAutoFillBackground(true);
|
||||
emoteButton->setIconSize(QSize(16,16));
|
||||
emoteButton->setFixedSize(24,24);
|
||||
callButton->setIcon(QIcon("img/button icons/call_2x.png"));
|
||||
callButton->setFlat(true);
|
||||
callButton->setPalette(toxgreen);
|
||||
callButton->setAutoFillBackground(true);
|
||||
callButton->setIconSize(QSize(25,25));
|
||||
callButton->setFixedSize(50,40);
|
||||
|
||||
|
||||
QString fileButtonStylesheet = "";
|
||||
try
|
||||
{
|
||||
QFile f("ui/fileButton/fileButton.css");
|
||||
f.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream fileButtonStylesheetStream(&f);
|
||||
fileButtonStylesheet = fileButtonStylesheetStream.readAll();
|
||||
}
|
||||
catch (int e) {}
|
||||
fileButton->setStyleSheet(fileButtonStylesheet);
|
||||
|
||||
|
||||
QString emoteButtonStylesheet = "";
|
||||
try
|
||||
{
|
||||
QFile f("ui/emoteButton/emoteButton.css");
|
||||
f.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream emoteButtonStylesheetStream(&f);
|
||||
emoteButtonStylesheet = emoteButtonStylesheetStream.readAll();
|
||||
}
|
||||
catch (int e) {}
|
||||
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);
|
||||
|
||||
|
||||
|
||||
main->setLayout(mainLayout);
|
||||
mainLayout->addWidget(chatArea);
|
||||
|
@ -290,9 +316,8 @@ void ChatForm::onAvInvite(int FriendId, int CallId)
|
|||
if (FriendId != f->friendId)
|
||||
return;
|
||||
callId = CallId;
|
||||
QPalette callinvitePal;
|
||||
callinvitePal.setColor(QPalette::Button, QColor(206, 191, 69)); // Call invite orange
|
||||
callButton->setPalette(callinvitePal);
|
||||
callButton->setObjectName("yellow");
|
||||
callButton->style()->polish(callButton);
|
||||
callButton->disconnect();
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onAnswerCallTriggered()));
|
||||
}
|
||||
|
@ -302,9 +327,8 @@ void ChatForm::onAvStart(int FriendId, int CallId)
|
|||
if (FriendId != f->friendId)
|
||||
return;
|
||||
callId = CallId;
|
||||
QPalette toxred;
|
||||
toxred.setColor(QPalette::Button, QColor(200,78,78)); // Tox Red
|
||||
callButton->setPalette(toxred);
|
||||
callButton->setObjectName("red");
|
||||
callButton->style()->polish(callButton);
|
||||
callButton->disconnect();
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onHangupCallTriggered()));
|
||||
}
|
||||
|
@ -313,9 +337,8 @@ void ChatForm::onAvCancel(int FriendId, int)
|
|||
{
|
||||
if (FriendId != f->friendId)
|
||||
return;
|
||||
QPalette toxgreen;
|
||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
||||
callButton->setPalette(toxgreen);
|
||||
callButton->setObjectName("red");
|
||||
callButton->style()->polish(callButton);
|
||||
callButton->disconnect();
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||
}
|
||||
|
@ -324,9 +347,8 @@ void ChatForm::onAvEnd(int FriendId, int)
|
|||
{
|
||||
if (FriendId != f->friendId)
|
||||
return;
|
||||
QPalette toxgreen;
|
||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
||||
callButton->setPalette(toxgreen);
|
||||
callButton->setObjectName("green");
|
||||
callButton->style()->polish(callButton);
|
||||
callButton->disconnect();
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||
}
|
||||
|
@ -336,9 +358,8 @@ void ChatForm::onAvRinging(int FriendId, int CallId)
|
|||
if (FriendId != f->friendId)
|
||||
return;
|
||||
callId = CallId;
|
||||
QPalette pal;
|
||||
pal.setColor(QPalette::Button, Qt::gray); // Call ringing grey
|
||||
callButton->setPalette(pal);
|
||||
callButton->setObjectName("grey");
|
||||
callButton->style()->polish(callButton);
|
||||
callButton->disconnect();
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCancelCallTriggered()));
|
||||
}
|
||||
|
@ -347,9 +368,8 @@ void ChatForm::onAvStarting(int FriendId, int)
|
|||
{
|
||||
if (FriendId != f->friendId)
|
||||
return;
|
||||
QPalette toxred;
|
||||
toxred.setColor(QPalette::Button, QColor(200,78,78)); // Tox Red
|
||||
callButton->setPalette(toxred);
|
||||
callButton->setObjectName("red");
|
||||
callButton->style()->polish(callButton);
|
||||
callButton->disconnect();
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onHangupCallTriggered()));
|
||||
}
|
||||
|
@ -358,9 +378,8 @@ void ChatForm::onAvEnding(int FriendId, int)
|
|||
{
|
||||
if (FriendId != f->friendId)
|
||||
return;
|
||||
QPalette toxgreen;
|
||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
||||
callButton->setPalette(toxgreen);
|
||||
callButton->setObjectName("green");
|
||||
callButton->style()->polish(callButton);
|
||||
callButton->disconnect();
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||
}
|
||||
|
@ -369,9 +388,8 @@ void ChatForm::onAvRequestTimeout(int FriendId, int)
|
|||
{
|
||||
if (FriendId != f->friendId)
|
||||
return;
|
||||
QPalette toxgreen;
|
||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
||||
callButton->setPalette(toxgreen);
|
||||
callButton->setObjectName("green");
|
||||
callButton->style()->polish(callButton);
|
||||
callButton->disconnect();
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||
}
|
||||
|
@ -380,9 +398,8 @@ void ChatForm::onAvPeerTimeout(int FriendId, int)
|
|||
{
|
||||
if (FriendId != f->friendId)
|
||||
return;
|
||||
QPalette toxgreen;
|
||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
||||
callButton->setPalette(toxgreen);
|
||||
callButton->setObjectName("green");
|
||||
callButton->style()->polish(callButton);
|
||||
callButton->disconnect();
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||
}
|
||||
|
@ -405,9 +422,8 @@ void ChatForm::onCallTriggered()
|
|||
|
||||
void ChatForm::onCancelCallTriggered()
|
||||
{
|
||||
QPalette toxgreen;
|
||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
||||
callButton->setPalette(toxgreen);
|
||||
callButton->setObjectName("green");
|
||||
callButton->style()->polish(callButton);
|
||||
callButton->disconnect();
|
||||
connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered()));
|
||||
emit cancelCall(callId, f->friendId);
|
||||
|
|