This commit is contained in:
Max Sandholm 2017-10-30 15:14:08 +02:00
parent ee893c5adf
commit 8fa01e2cd6
13 changed files with 72 additions and 73 deletions

View File

@ -38,15 +38,11 @@ struct DescInfo
class RoomInfoListItem : public QWidget class RoomInfoListItem : public QWidget
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QColor highlightedBackgroundColor Q_PROPERTY(QColor highlightedBackgroundColor READ highlightedBackgroundColor WRITE
READ highlightedBackgroundColor setHighlightedBackgroundColor)
WRITE setHighlightedBackgroundColor) Q_PROPERTY(
Q_PROPERTY(QColor hoverBackgroundColor QColor hoverBackgroundColor READ hoverBackgroundColor WRITE setHoverBackgroundColor)
READ hoverBackgroundColor Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
WRITE setHoverBackgroundColor)
Q_PROPERTY(QColor backgroundColor
READ backgroundColor
WRITE setBackgroundColor)
public: public:
RoomInfoListItem(QSharedPointer<RoomSettings> settings, RoomInfoListItem(QSharedPointer<RoomSettings> settings,
@ -71,7 +67,10 @@ public:
inline QColor hoverBackgroundColor() const { return hoverBackgroundColor_; } inline QColor hoverBackgroundColor() const { return hoverBackgroundColor_; }
inline QColor backgroundColor() const { return backgroundColor_; } inline QColor backgroundColor() const { return backgroundColor_; }
inline void setHighlightedBackgroundColor(QColor &color) { highlightedBackgroundColor_ = color; } inline void setHighlightedBackgroundColor(QColor &color)
{
highlightedBackgroundColor_ = color;
}
inline void setHoverBackgroundColor(QColor &color) { hoverBackgroundColor_ = color; } inline void setHoverBackgroundColor(QColor &color) { hoverBackgroundColor_ = color; }
inline void setBackgroundColor(QColor &color) { backgroundColor_ = color; } inline void setBackgroundColor(QColor &color) { backgroundColor_ = color; }

View File

@ -19,9 +19,9 @@
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QLabel> #include <QLabel>
#include <QPainter>
#include <QStyle> #include <QStyle>
#include <QStyleOption> #include <QStyleOption>
#include <QPainter>
#include "Emote.h" #include "Emote.h"
#include "Image.h" #include "Image.h"

View File

@ -64,7 +64,8 @@ struct PendingMessage
, filename(filename) , filename(filename)
, event_id(event_id) , event_id(event_id)
, widget(widget) , widget(widget)
{} {
}
}; };
// In which place new TimelineItems should be inserted. // In which place new TimelineItems should be inserted.

View File

@ -542,7 +542,7 @@ ChatPage::showQuickSwitcher()
new OverlayModal(MainWindow::instance(), quickSwitcher_.data()), new OverlayModal(MainWindow::instance(), quickSwitcher_.data()),
[=](OverlayModal *modal) { modal->deleteLater(); }); [=](OverlayModal *modal) { modal->deleteLater(); });
quickSwitcherModal_->setDuration(0); quickSwitcherModal_->setDuration(0);
// quickSwitcherModal_->setColor(QColor(30, 30, 30, 170)); // quickSwitcherModal_->setColor(QColor(30, 30, 30, 170));
} }
QMap<QString, QString> rooms; QMap<QString, QString> rooms;

View File

@ -32,18 +32,18 @@ EmojiPanel::EmojiPanel(QWidget *parent)
, animationDuration_{100} , animationDuration_{100}
, categoryIconSize_{20} , categoryIconSize_{20}
{ {
// setStyleSheet( // setStyleSheet(
// "QWidget {background: #fff; color: #e8e8e8; border: none;}" // "QWidget {background: #fff; color: #e8e8e8; border: none;}"
// "QScrollBar:vertical { background-color: #fff; width: 8px; margin: 0px 2px 0 2px; }" // "QScrollBar:vertical { background-color: #fff; width: 8px; margin: 0px 2px 0
// "QScrollBar::handle:vertical { background-color: #d6dde3; min-height: 20px; }" // 2px; }"
// "QScrollBar::add-line:vertical { border: none; background: none; }" // "QScrollBar::handle:vertical { background-color: #d6dde3; min-height: 20px; }"
// "QScrollBar::sub-line:vertical { border: none; background: none; }"); // "QScrollBar::add-line:vertical { border: none; background: none; }"
setStyleSheet( // "QScrollBar::sub-line:vertical { border: none; background: none; }");
"QWidget {border: none;}" setStyleSheet("QWidget {border: none;}"
"QScrollBar:vertical { width: 8px; margin: 0px 2px 0 2px; }" "QScrollBar:vertical { width: 8px; margin: 0px 2px 0 2px; }"
"QScrollBar::handle:vertical { min-height: 20px; }" "QScrollBar::handle:vertical { min-height: 20px; }"
"QScrollBar::add-line:vertical { border: none; background: none; }" "QScrollBar::add-line:vertical { border: none; background: none; }"
"QScrollBar::sub-line:vertical { border: none; background: none; }"); "QScrollBar::sub-line:vertical { border: none; background: none; }");
setAttribute(Qt::WA_TranslucentBackground, true); setAttribute(Qt::WA_TranslucentBackground, true);
setAttribute(Qt::WA_ShowWithoutActivating, true); setAttribute(Qt::WA_ShowWithoutActivating, true);
@ -60,7 +60,7 @@ EmojiPanel::EmojiPanel(QWidget *parent)
contentLayout->setMargin(0); contentLayout->setMargin(0);
auto emojiCategories = new QFrame(mainWidget); auto emojiCategories = new QFrame(mainWidget);
//emojiCategories->setStyleSheet("background-color: #f2f2f2"); // emojiCategories->setStyleSheet("background-color: #f2f2f2");
auto categoriesLayout = new QHBoxLayout(emojiCategories); auto categoriesLayout = new QHBoxLayout(emojiCategories);
categoriesLayout->setSpacing(6); categoriesLayout->setSpacing(6);

View File

@ -30,7 +30,7 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent)
, inferredServerAddress_() , inferredServerAddress_()
, client_{client} , client_{client}
{ {
// setStyleSheet("background-color: #fff"); // setStyleSheet("background-color: #fff");
top_layout_ = new QVBoxLayout(); top_layout_ = new QVBoxLayout();
@ -40,7 +40,7 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent)
back_button_ = new FlatButton(this); back_button_ = new FlatButton(this);
back_button_->setMinimumSize(QSize(30, 30)); back_button_->setMinimumSize(QSize(30, 30));
//back_button_->setForegroundColor("#333333"); // back_button_->setForegroundColor("#333333");
top_bar_layout_->addWidget(back_button_, 0, Qt::AlignLeft | Qt::AlignVCenter); top_bar_layout_->addWidget(back_button_, 0, Qt::AlignLeft | Qt::AlignVCenter);
top_bar_layout_->addStretch(1); top_bar_layout_->addStretch(1);
@ -75,10 +75,10 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent)
form_wrapper_->addStretch(1); form_wrapper_->addStretch(1);
matrixid_input_ = new TextField(this); matrixid_input_ = new TextField(this);
// matrixid_input_->setTextColor("#333333"); // matrixid_input_->setTextColor("#333333");
matrixid_input_->setLabel(tr("Matrix ID")); matrixid_input_->setLabel(tr("Matrix ID"));
// matrixid_input_->setInkColor("#555459"); // matrixid_input_->setInkColor("#555459");
// matrixid_input_->setBackgroundColor("#fff"); // matrixid_input_->setBackgroundColor("#fff");
matrixid_input_->setPlaceholderText(tr("e.g @joe:matrix.org")); matrixid_input_->setPlaceholderText(tr("e.g @joe:matrix.org"));
spinner_ = new LoadingIndicator(this); spinner_ = new LoadingIndicator(this);
@ -95,17 +95,17 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent)
matrixidLayout_->addWidget(matrixid_input_, 0, Qt::AlignVCenter); matrixidLayout_->addWidget(matrixid_input_, 0, Qt::AlignVCenter);
password_input_ = new TextField(this); password_input_ = new TextField(this);
// password_input_->setTextColor("#333333"); // password_input_->setTextColor("#333333");
password_input_->setLabel(tr("Password")); password_input_->setLabel(tr("Password"));
// password_input_->setInkColor("#555459"); // password_input_->setInkColor("#555459");
// password_input_->setBackgroundColor("#fff"); // password_input_->setBackgroundColor("#fff");
password_input_->setEchoMode(QLineEdit::Password); password_input_->setEchoMode(QLineEdit::Password);
serverInput_ = new TextField(this); serverInput_ = new TextField(this);
// serverInput_->setTextColor("#333333"); // serverInput_->setTextColor("#333333");
serverInput_->setLabel("Homeserver address"); serverInput_->setLabel("Homeserver address");
// serverInput_->setInkColor("#555459"); // serverInput_->setInkColor("#555459");
// serverInput_->setBackgroundColor("#fff"); // serverInput_->setBackgroundColor("#fff");
serverInput_->setPlaceholderText("matrix.org"); serverInput_->setPlaceholderText("matrix.org");
serverInput_->hide(); serverInput_->hide();
@ -121,8 +121,8 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent)
button_layout_->setContentsMargins(0, 0, 0, 30); button_layout_->setContentsMargins(0, 0, 0, 30);
login_button_ = new RaisedButton(tr("LOGIN"), this); login_button_ = new RaisedButton(tr("LOGIN"), this);
// login_button_->setBackgroundColor(QColor("#333333")); // login_button_->setBackgroundColor(QColor("#333333"));
// login_button_->setForegroundColor(QColor("white")); // login_button_->setForegroundColor(QColor("white"));
login_button_->setMinimumSize(350, 65); login_button_->setMinimumSize(350, 65);
login_button_->setFontSize(20); login_button_->setFontSize(20);
login_button_->setCornerRadius(3); login_button_->setCornerRadius(3);
@ -136,7 +136,7 @@ LoginPage::LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent)
error_label_ = new QLabel(this); error_label_ = new QLabel(this);
error_label_->setFont(font); error_label_->setFont(font);
// error_label_->setStyleSheet("color: #E22826"); // error_label_->setStyleSheet("color: #E22826");
top_layout_->addLayout(top_bar_layout_); top_layout_->addLayout(top_bar_layout_);
top_layout_->addStretch(1); top_layout_->addStretch(1);

View File

@ -27,7 +27,7 @@ LogoutDialog::LogoutDialog(QWidget *parent)
: QFrame(parent) : QFrame(parent)
{ {
setMaximumSize(400, 400); setMaximumSize(400, 400);
// setStyleSheet("background-color: #fff"); // setStyleSheet("background-color: #fff");
auto layout = new QVBoxLayout(this); auto layout = new QVBoxLayout(this);
layout->setSpacing(30); layout->setSpacing(30);
@ -52,7 +52,7 @@ LogoutDialog::LogoutDialog(QWidget *parent)
auto label = new QLabel(tr("Logout. Are you sure?"), this); auto label = new QLabel(tr("Logout. Are you sure?"), this);
label->setFont(font); label->setFont(font);
// label->setStyleSheet("color: #333333"); // label->setStyleSheet("color: #333333");
layout->addWidget(label); layout->addWidget(label);
layout->addLayout(buttonLayout); layout->addLayout(buttonLayout);

View File

@ -28,7 +28,7 @@ RegisterPage::RegisterPage(QSharedPointer<MatrixClient> client, QWidget *parent)
: QWidget(parent) : QWidget(parent)
, client_(client) , client_(client)
{ {
// setStyleSheet("background-color: #fff"); // setStyleSheet("background-color: #fff");
top_layout_ = new QVBoxLayout(); top_layout_ = new QVBoxLayout();
@ -73,30 +73,30 @@ RegisterPage::RegisterPage(QSharedPointer<MatrixClient> client, QWidget *parent)
form_wrapper_->addStretch(1); form_wrapper_->addStretch(1);
username_input_ = new TextField(); username_input_ = new TextField();
// username_input_->setTextColor("#333333"); // username_input_->setTextColor("#333333");
username_input_->setLabel(tr("Username")); username_input_->setLabel(tr("Username"));
// username_input_->setInkColor("#555459"); // username_input_->setInkColor("#555459");
// username_input_->setBackgroundColor("#fff"); // username_input_->setBackgroundColor("#fff");
password_input_ = new TextField(); password_input_ = new TextField();
// password_input_->setTextColor("#333333"); // password_input_->setTextColor("#333333");
password_input_->setLabel(tr("Password")); password_input_->setLabel(tr("Password"));
// password_input_->setInkColor("#555459"); // password_input_->setInkColor("#555459");
// password_input_->setBackgroundColor("#fff"); // password_input_->setBackgroundColor("#fff");
password_input_->setEchoMode(QLineEdit::Password); password_input_->setEchoMode(QLineEdit::Password);
password_confirmation_ = new TextField(); password_confirmation_ = new TextField();
// password_confirmation_->setTextColor("#333333"); // password_confirmation_->setTextColor("#333333");
password_confirmation_->setLabel(tr("Password confirmation")); password_confirmation_->setLabel(tr("Password confirmation"));
// password_confirmation_->setInkColor("#555459"); // password_confirmation_->setInkColor("#555459");
// password_confirmation_->setBackgroundColor("#fff"); // password_confirmation_->setBackgroundColor("#fff");
password_confirmation_->setEchoMode(QLineEdit::Password); password_confirmation_->setEchoMode(QLineEdit::Password);
server_input_ = new TextField(); server_input_ = new TextField();
// server_input_->setTextColor("#333333"); // server_input_->setTextColor("#333333");
server_input_->setLabel(tr("Home Server")); server_input_->setLabel(tr("Home Server"));
// server_input_->setInkColor("#555459"); // server_input_->setInkColor("#555459");
// server_input_->setBackgroundColor("#fff"); // server_input_->setBackgroundColor("#fff");
form_layout_->addWidget(username_input_, Qt::AlignHCenter, 0); form_layout_->addWidget(username_input_, Qt::AlignHCenter, 0);
form_layout_->addWidget(password_input_, Qt::AlignHCenter, 0); form_layout_->addWidget(password_input_, Qt::AlignHCenter, 0);
@ -112,11 +112,11 @@ RegisterPage::RegisterPage(QSharedPointer<MatrixClient> client, QWidget *parent)
error_label_ = new QLabel(this); error_label_ = new QLabel(this);
error_label_->setFont(font); error_label_->setFont(font);
// error_label_->setStyleSheet("color: #E22826"); // error_label_->setStyleSheet("color: #E22826");
register_button_ = new RaisedButton(tr("REGISTER"), this); register_button_ = new RaisedButton(tr("REGISTER"), this);
// register_button_->setBackgroundColor(QColor("#333333")); // register_button_->setBackgroundColor(QColor("#333333"));
// register_button_->setForegroundColor(QColor("white")); // register_button_->setForegroundColor(QColor("white"));
register_button_->setMinimumSize(350, 65); register_button_->setMinimumSize(350, 65);
register_button_->setFontSize(conf::btn::fontSize); register_button_->setFontSize(conf::btn::fontSize);
register_button_->setCornerRadius(conf::btn::cornerRadius); register_button_->setCornerRadius(conf::btn::cornerRadius);

View File

@ -106,7 +106,7 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
font.setPixelSize(conf::fontSize); font.setPixelSize(conf::fontSize);
QFontMetrics metrics(font); QFontMetrics metrics(font);
//p.setPen(QColor("#333")); // p.setPen(QColor("#333"));
QRect avatarRegion(Padding, Padding, IconSize, IconSize); QRect avatarRegion(Padding, Padding, IconSize, IconSize);

View File

@ -66,7 +66,6 @@ TimelineItem::init()
headerLayout_->setMargin(0); headerLayout_->setMargin(0);
headerLayout_->setSpacing(conf::timeline::headerSpacing); headerLayout_->setSpacing(conf::timeline::headerSpacing);
} }
/* /*
@ -400,8 +399,8 @@ TimelineItem::setupAvatarLayout(const QString &userName)
userAvatar_ = new Avatar(this); userAvatar_ = new Avatar(this);
userAvatar_->setLetter(QChar(userName[0]).toUpper()); userAvatar_->setLetter(QChar(userName[0]).toUpper());
// userAvatar_->setBackgroundColor(QColor("#eee")); // userAvatar_->setBackgroundColor(QColor("#eee"));
// userAvatar_->setTextColor(QColor("black")); // userAvatar_->setTextColor(QColor("black"));
userAvatar_->setSize(conf::timeline::avatarSize); userAvatar_->setSize(conf::timeline::avatarSize);
// TODO: The provided user name should be a UserId class // TODO: The provided user name should be a UserId class
@ -472,8 +471,8 @@ TimelineItem::~TimelineItem() {}
void void
TimelineItem::paintEvent(QPaintEvent *) TimelineItem::paintEvent(QPaintEvent *)
{ {
QStyleOption opt; QStyleOption opt;
opt.init(this); opt.init(this);
QPainter p(this); QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
} }

View File

@ -643,8 +643,8 @@ TimelineView::handleFailedMessage(int txnid)
void void
TimelineView::paintEvent(QPaintEvent *) TimelineView::paintEvent(QPaintEvent *)
{ {
QStyleOption opt; QStyleOption opt;
opt.init(this); opt.init(this);
QPainter p(this); QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
} }

View File

@ -45,8 +45,8 @@ UserInfoWidget::UserInfoWidget(QWidget *parent)
userAvatar_ = new Avatar(this); userAvatar_ = new Avatar(this);
userAvatar_->setLetter(QChar('?')); userAvatar_->setLetter(QChar('?'));
userAvatar_->setSize(55); userAvatar_->setSize(55);
// userAvatar_->setBackgroundColor("#fff"); // userAvatar_->setBackgroundColor("#fff");
// userAvatar_->setTextColor("#333333"); // userAvatar_->setTextColor("#333333");
QFont nameFont("Open Sans SemiBold"); QFont nameFont("Open Sans SemiBold");
nameFont.setPixelSize(conf::userInfoWidget::fonts::displayName); nameFont.setPixelSize(conf::userInfoWidget::fonts::displayName);

View File

@ -17,12 +17,12 @@
#include <QApplication> #include <QApplication>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QFile>
#include <QFontDatabase> #include <QFontDatabase>
#include <QLibraryInfo> #include <QLibraryInfo>
#include <QNetworkProxy> #include <QNetworkProxy>
#include <QSettings> #include <QSettings>
#include <QTranslator> #include <QTranslator>
#include <QFile>
#include "MainWindow.h" #include "MainWindow.h"