mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix #416, cleanup
This commit is contained in:
parent
118b67a970
commit
2913326fb2
1
res.qrc
1
res.qrc
|
@ -140,5 +140,6 @@
|
|||
<file>ui/settings/mainContent.css</file>
|
||||
<file>ui/settings/mainHead.css</file>
|
||||
<file>translations/pirate.qm</file>
|
||||
<file>ui/chatArea/chatHead.css</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -39,15 +39,16 @@
|
|||
|
||||
ChatForm::ChatForm(Friend* chatFriend)
|
||||
: f(chatFriend)
|
||||
, audioInputFlag(false)
|
||||
, callId(0)
|
||||
{
|
||||
nameLabel->setText(f->getName());
|
||||
|
||||
avatar->setPixmap(QPixmap(":/img/contact_dark.png"), Qt::transparent);
|
||||
|
||||
statusMessageLabel = new CroppingLabel();
|
||||
statusMessageLabel->setObjectName("statusLabel");
|
||||
statusMessageLabel->setFont(Style::getFont(Style::Medium));
|
||||
QPalette pal; pal.setColor(QPalette::WindowText, Style::getColor(Style::MediumGrey));
|
||||
statusMessageLabel->setPalette(pal);
|
||||
|
||||
netcam = new NetCamView();
|
||||
|
||||
|
@ -466,15 +467,11 @@ void ChatForm::onMicMuteToggle()
|
|||
{
|
||||
emit micMuteToggle(callId);
|
||||
if (micButton->objectName() == "red")
|
||||
{
|
||||
micButton->setObjectName("green");
|
||||
micButton->style()->polish(micButton);
|
||||
}
|
||||
else
|
||||
{
|
||||
micButton->setObjectName("red");
|
||||
micButton->style()->polish(micButton);
|
||||
}
|
||||
|
||||
Style::repolish(micButton);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,9 +37,7 @@ GenericChatForm::GenericChatForm(QWidget *parent) :
|
|||
headWidget = new QWidget();
|
||||
|
||||
nameLabel = new CroppingLabel();
|
||||
nameLabel->setFont(Style::getFont(Style::MediumBold));
|
||||
QPalette pal; pal.setColor(QPalette::WindowText, Style::getColor(Style::DarkGrey));
|
||||
nameLabel->setPalette(pal);
|
||||
nameLabel->setObjectName("nameLabel");
|
||||
|
||||
avatar = new MaskablePixmapWidget(this, QSize(40,40), ":/img/avatar_mask.png");
|
||||
QHBoxLayout *headLayout = new QHBoxLayout(), *mainFootLayout = new QHBoxLayout();
|
||||
|
@ -48,8 +46,6 @@ GenericChatForm::GenericChatForm(QWidget *parent) :
|
|||
QVBoxLayout *footButtonsSmall = new QVBoxLayout(), *volMicLayout = new QVBoxLayout();
|
||||
|
||||
chatWidget = new ChatAreaWidget();
|
||||
chatWidget->document()->setDefaultStyleSheet(Style::getStylesheet(":ui/chatArea/innerStyle.css"));
|
||||
chatWidget->setStyleSheet(Style::getStylesheet(":/ui/chatArea/chatArea.css"));
|
||||
|
||||
msgEdit = new ChatTextEdit();
|
||||
|
||||
|
@ -62,10 +58,6 @@ GenericChatForm::GenericChatForm(QWidget *parent) :
|
|||
volButton = new QPushButton();
|
||||
micButton = new QPushButton();
|
||||
|
||||
QFont bold;
|
||||
bold.setBold(true);
|
||||
nameLabel->setFont(bold);
|
||||
|
||||
footButtonsSmall->setSpacing(2);
|
||||
|
||||
msgEdit->setStyleSheet(Style::getStylesheet(":/ui/msgEdit/msgEdit.css"));
|
||||
|
@ -125,6 +117,10 @@ GenericChatForm::GenericChatForm(QWidget *parent) :
|
|||
|
||||
connect(emoteButton, SIGNAL(clicked()), this, SLOT(onEmoteButtonClicked()));
|
||||
connect(chatWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onChatContextMenuRequested(QPoint)));
|
||||
|
||||
chatWidget->document()->setDefaultStyleSheet(Style::getStylesheet(":ui/chatArea/innerStyle.css"));
|
||||
chatWidget->setStyleSheet(Style::getStylesheet(":/ui/chatArea/chatArea.css"));
|
||||
headWidget->setStyleSheet(Style::getStylesheet(":/ui/chatArea/chatHead.css"));
|
||||
}
|
||||
|
||||
int GenericChatForm::getNumberOfMessages()
|
||||
|
|
|
@ -31,6 +31,7 @@ GroupChatForm::GroupChatForm(Group* chatGroup)
|
|||
{
|
||||
nusersLabel = new QLabel();
|
||||
namesList = new QLabel();
|
||||
namesList->setObjectName("peersLabel");
|
||||
|
||||
fileButton->setEnabled(false);
|
||||
callButton->setVisible(false);
|
||||
|
@ -38,24 +39,15 @@ GroupChatForm::GroupChatForm(Group* chatGroup)
|
|||
volButton->setVisible(false);
|
||||
micButton->setVisible(false);
|
||||
|
||||
QFont small;
|
||||
small.setPixelSize(10);
|
||||
|
||||
nameLabel->setText(group->widget->getName());
|
||||
|
||||
nusersLabel->setFont(Style::getFont(Style::Medium));
|
||||
nusersLabel->setText(GroupChatForm::tr("%1 users in chat","Number of users in chat").arg(group->peers.size()));
|
||||
QPalette pal; pal.setColor(QPalette::WindowText, Style::getColor(Style::MediumGrey));
|
||||
nusersLabel->setPalette(pal);
|
||||
nusersLabel->setObjectName("statusLabel");
|
||||
|
||||
avatar->setPixmap(QPixmap(":/img/group_dark.png"), Qt::transparent);
|
||||
|
||||
QString names;
|
||||
for (QString& s : group->peers)
|
||||
names.append(s+", ");
|
||||
names.chop(2);
|
||||
namesList->setText(names);
|
||||
namesList->setFont(small);
|
||||
namesList->setText(QStringList(group->peers.values()).join(", "));
|
||||
|
||||
msgEdit->setObjectName("group");
|
||||
|
||||
|
@ -83,11 +75,7 @@ void GroupChatForm::onSendTriggered()
|
|||
void GroupChatForm::onUserListChanged()
|
||||
{
|
||||
nusersLabel->setText(tr("%1 users in chat").arg(group->nPeers));
|
||||
QString names;
|
||||
for (QString& s : group->peers)
|
||||
names.append(s+", ");
|
||||
names.chop(2);
|
||||
namesList->setText(names);
|
||||
namesList->setText(QStringList(group->peers.values()).join(", "));
|
||||
}
|
||||
|
||||
void GroupChatForm::dragEnterEvent(QDragEnterEvent *ev)
|
||||
|
|
14
ui/chatArea/chatHead.css
Normal file
14
ui/chatArea/chatHead.css
Normal file
|
@ -0,0 +1,14 @@
|
|||
#nameLabel {
|
||||
color: @black;
|
||||
font: @mediumBold;
|
||||
}
|
||||
|
||||
#statusLabel {
|
||||
color: @mediumGrey;
|
||||
font: @medium;
|
||||
}
|
||||
|
||||
#peersLabel {
|
||||
color: @mediumGrey;
|
||||
font: @medium;
|
||||
}
|
Loading…
Reference in New Issue
Block a user