Browse Source

Added tox-style videoButton

pull/14/head
Flynn 11 years ago
parent
commit
2621ce4ef7
  1. 68
      ui/videoButton/videoButton.css
  2. BIN
      ui/videoButton/videoButton.png
  3. BIN
      ui/videoButton/videoButton.xcf
  4. BIN
      ui/videoButton/videoButtonDisabled.png
  5. BIN
      ui/videoButton/videoButtonHover.png
  6. BIN
      ui/videoButton/videoButtonPressed.png
  7. BIN
      ui/videoButton/videoButtonRed.png
  8. BIN
      ui/videoButton/videoButtonRedHover.png
  9. BIN
      ui/videoButton/videoButtonRedPressed.png
  10. BIN
      ui/videoButton/videoButtonYellow.png
  11. BIN
      ui/videoButton/videoButtonYellowHover.png
  12. BIN
      ui/videoButton/videoButtonYellowPressed.png
  13. 15
      widget/form/chatform.cpp
  14. 2
      widget/form/chatform.h
  15. 18
      widget/form/groupchatform.cpp

68
ui/videoButton/videoButton.css

@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
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;
}

BIN
ui/videoButton/videoButton.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

BIN
ui/videoButton/videoButton.xcf

Binary file not shown.

BIN
ui/videoButton/videoButtonDisabled.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

BIN
ui/videoButton/videoButtonHover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

BIN
ui/videoButton/videoButtonPressed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

BIN
ui/videoButton/videoButtonRed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

BIN
ui/videoButton/videoButtonRedHover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

BIN
ui/videoButton/videoButtonRedPressed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

BIN
ui/videoButton/videoButtonYellow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

BIN
ui/videoButton/videoButtonYellowHover.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

BIN
ui/videoButton/videoButtonYellowPressed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

15
widget/form/chatform.cpp

@ -18,7 +18,7 @@ ChatForm::ChatForm(Friend* chatFriend) @@ -18,7 +18,7 @@ ChatForm::ChatForm(Friend* chatFriend)
headTextLayout = new QVBoxLayout(), mainLayout = new QVBoxLayout(), footButtonsSmall = new QVBoxLayout();
mainChatLayout = new QGridLayout();
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();
QFont bold;
@ -89,7 +89,17 @@ ChatForm::ChatForm(Friend* chatFriend) @@ -89,7 +89,17 @@ ChatForm::ChatForm(Friend* chatFriend)
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);
mainLayout->addWidget(chatArea);
@ -110,6 +120,7 @@ ChatForm::ChatForm(Friend* chatFriend) @@ -110,6 +120,7 @@ ChatForm::ChatForm(Friend* chatFriend)
headLayout->addLayout(headTextLayout);
headLayout->addStretch();
headLayout->addWidget(callButton);
headLayout->addWidget(videoButton);
headTextLayout->addStretch();
headTextLayout->addWidget(name);

2
widget/form/chatform.h

@ -72,7 +72,7 @@ private: @@ -72,7 +72,7 @@ private:
QGridLayout *mainChatLayout;
QLabel *avatar, *name, *statusMessage;
ChatTextEdit *msgEdit;
QPushButton *sendButton, *fileButton, *emoteButton, *callButton;
QPushButton *sendButton, *fileButton, *emoteButton, *callButton, *videoButton;
QScrollArea *chatArea;
QWidget *main, *head, *chatAreaWidget;
QString previousName;

18
widget/form/groupchatform.cpp

@ -45,13 +45,17 @@ GroupChatForm::GroupChatForm(Group* chatGroup) @@ -45,13 +45,17 @@ GroupChatForm::GroupChatForm(Group* chatGroup)
mainChatLayout->setColumnStretch(1,1);
mainChatLayout->setHorizontalSpacing(10);
sendButton->setIcon(QIcon("img/button icons/sendmessage_2x.png"));
sendButton->setIconSize(QSize(32,32));
sendButton->setFlat(true);
QPalette pal;
pal.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
sendButton->setPalette(pal);
sendButton->setAutoFillBackground(true);
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);
msgEdit->setFixedHeight(50);
sendButton->setFixedSize(50, 50);

Loading…
Cancel
Save