mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
use Style::get
This commit is contained in:
parent
0d748b93d6
commit
1c27b55470
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "emoticonswidget.h"
|
||||
#include "smileypack.h"
|
||||
#include "style.h"
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
|
@ -26,11 +27,7 @@
|
|||
EmoticonsWidget::EmoticonsWidget(QWidget *parent) :
|
||||
QMenu(parent)
|
||||
{
|
||||
QFile f(":/ui/emoticonWidget/emoticonWidget.css");
|
||||
f.open(QFile::ReadOnly | QFile::Text);
|
||||
QString pageButtonCss = f.readAll();
|
||||
setStyleSheet(pageButtonCss);
|
||||
|
||||
setStyleSheet(Style::get(":/ui/emoticonWidget/emoticonWidget.css"));
|
||||
setLayout(&layout);
|
||||
layout.addWidget(&stack);
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "widget.h"
|
||||
#include "core.h"
|
||||
#include "math.h"
|
||||
#include "style.h"
|
||||
#include <QFileDialog>
|
||||
#include <QPixmap>
|
||||
#include <QPainter>
|
||||
|
@ -36,10 +37,7 @@ FileTransfertWidget::FileTransfertWidget(ToxFile File)
|
|||
QFont prettysmall;
|
||||
prettysmall.setPixelSize(10);
|
||||
this->setObjectName("default");
|
||||
QFile f0(":/ui/fileTransferWidget/fileTransferWidget.css");
|
||||
f0.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream fileTransfertWidgetStylesheet(&f0);
|
||||
this->setStyleSheet(fileTransfertWidgetStylesheet.readAll());
|
||||
this->setStyleSheet(Style::get(":/ui/fileTransferWidget/fileTransferWidget.css"));
|
||||
QPalette greybg;
|
||||
greybg.setColor(QPalette::Window, QColor(209,209,209));
|
||||
greybg.setColor(QPalette::Base, QColor(150,150,150));
|
||||
|
@ -71,20 +69,9 @@ FileTransfertWidget::FileTransfertWidget(ToxFile File)
|
|||
buttonWidget->setAutoFillBackground(true);
|
||||
buttonWidget->setLayout(buttonLayout);
|
||||
|
||||
QFile f1(":/ui/stopFileButton/style.css");
|
||||
f1.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream stopFileButtonStylesheetStream(&f1);
|
||||
stopFileButtonStylesheet = stopFileButtonStylesheetStream.readAll();
|
||||
|
||||
QFile f2(":/ui/pauseFileButton/style.css");
|
||||
f2.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream pauseFileButtonStylesheetStream(&f2);
|
||||
pauseFileButtonStylesheet = pauseFileButtonStylesheetStream.readAll();
|
||||
|
||||
QFile f3(":/ui/acceptFileButton/style.css");
|
||||
f3.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream acceptFileButtonStylesheetStream(&f3);
|
||||
acceptFileButtonStylesheet = acceptFileButtonStylesheetStream.readAll();
|
||||
stopFileButtonStylesheet = Style::get(":/ui/stopFileButton/style.css");
|
||||
pauseFileButtonStylesheet = Style::get(":/ui/pauseFileButton/style.css");
|
||||
acceptFileButtonStylesheet = Style::get(":/ui/acceptFileButton/style.css");
|
||||
|
||||
topright->setStyleSheet(stopFileButtonStylesheet);
|
||||
if (File.direction == ToxFile::SENDING)
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "widget/widget.h"
|
||||
#include "friend.h"
|
||||
#include "friendlist.h"
|
||||
#include "style.h"
|
||||
#include <QFont>
|
||||
#include <QTime>
|
||||
#include <QScrollBar>
|
||||
|
@ -55,16 +56,8 @@ GroupChatForm::GroupChatForm(Group* chatGroup)
|
|||
namesList->setFont(small);
|
||||
|
||||
chatAreaWidget->setLayout(mainChatLayout);
|
||||
QString chatAreaStylesheet = "";
|
||||
try
|
||||
{
|
||||
QFile f(":/ui/chatArea/chatArea.css");
|
||||
f.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream chatAreaStylesheetStream(&f);
|
||||
chatAreaStylesheet = chatAreaStylesheetStream.readAll();
|
||||
}
|
||||
catch (int e) {}
|
||||
chatArea->setStyleSheet(chatAreaStylesheet);
|
||||
|
||||
chatArea->setStyleSheet(Style::get(":/ui/chatArea/chatArea.css"));
|
||||
chatArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
chatArea->setWidgetResizable(true);
|
||||
chatArea->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
@ -73,35 +66,15 @@ GroupChatForm::GroupChatForm(Group* chatGroup)
|
|||
mainChatLayout->setColumnStretch(1,1);
|
||||
mainChatLayout->setSpacing(10);
|
||||
|
||||
|
||||
QString msgEditStylesheet = "";
|
||||
try
|
||||
{
|
||||
QFile f(":/ui/msgEdit/msgEdit.css");
|
||||
f.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream msgEditStylesheetStream(&f);
|
||||
msgEditStylesheet = msgEditStylesheetStream.readAll();
|
||||
}
|
||||
catch (int e) {}
|
||||
msgEdit->setObjectName("group");
|
||||
msgEdit->setStyleSheet(msgEditStylesheet);
|
||||
msgEdit->setStyleSheet(Style::get(":/ui/msgEdit/msgEdit.css"));
|
||||
msgEdit->setFixedHeight(50);
|
||||
msgEdit->setFrameStyle(QFrame::NoFrame);
|
||||
|
||||
mainChatLayout->setColumnStretch(1,1);
|
||||
mainChatLayout->setHorizontalSpacing(10);
|
||||
|
||||
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);
|
||||
|
||||
sendButton->setStyleSheet(Style::get(":/ui/sendButton/sendButton.css"));
|
||||
sendButton->setFixedSize(50, 50);
|
||||
|
||||
main->setLayout(mainLayout);
|
||||
|
|
Loading…
Reference in New Issue
Block a user