diff --git a/include/RoomInfoListItem.h b/include/RoomInfoListItem.h index a00610fa..eba98bed 100644 --- a/include/RoomInfoListItem.h +++ b/include/RoomInfoListItem.h @@ -38,15 +38,11 @@ struct DescInfo class RoomInfoListItem : public QWidget { Q_OBJECT - Q_PROPERTY(QColor highlightedBackgroundColor - READ highlightedBackgroundColor - WRITE setHighlightedBackgroundColor) - Q_PROPERTY(QColor hoverBackgroundColor - READ hoverBackgroundColor - WRITE setHoverBackgroundColor) - Q_PROPERTY(QColor backgroundColor - READ backgroundColor - WRITE setBackgroundColor) + Q_PROPERTY(QColor highlightedBackgroundColor READ highlightedBackgroundColor WRITE + setHighlightedBackgroundColor) + Q_PROPERTY( + QColor hoverBackgroundColor READ hoverBackgroundColor WRITE setHoverBackgroundColor) + Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor) public: RoomInfoListItem(QSharedPointer settings, @@ -71,7 +67,10 @@ public: inline QColor hoverBackgroundColor() const { return hoverBackgroundColor_; } 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 setBackgroundColor(QColor &color) { backgroundColor_ = color; } diff --git a/include/TimelineItem.h b/include/TimelineItem.h index 126ce584..d90810d5 100644 --- a/include/TimelineItem.h +++ b/include/TimelineItem.h @@ -19,9 +19,9 @@ #include #include +#include #include #include -#include #include "Emote.h" #include "Image.h" diff --git a/include/TimelineView.h b/include/TimelineView.h index 09a583b1..50060ced 100644 --- a/include/TimelineView.h +++ b/include/TimelineView.h @@ -64,7 +64,8 @@ struct PendingMessage , filename(filename) , event_id(event_id) , widget(widget) - {} + { + } }; // In which place new TimelineItems should be inserted. diff --git a/src/ChatPage.cc b/src/ChatPage.cc index 814ddad2..66fbdb09 100644 --- a/src/ChatPage.cc +++ b/src/ChatPage.cc @@ -542,7 +542,7 @@ ChatPage::showQuickSwitcher() new OverlayModal(MainWindow::instance(), quickSwitcher_.data()), [=](OverlayModal *modal) { modal->deleteLater(); }); quickSwitcherModal_->setDuration(0); -// quickSwitcherModal_->setColor(QColor(30, 30, 30, 170)); + // quickSwitcherModal_->setColor(QColor(30, 30, 30, 170)); } QMap rooms; diff --git a/src/EmojiPanel.cc b/src/EmojiPanel.cc index 704e5c55..bc7934bf 100644 --- a/src/EmojiPanel.cc +++ b/src/EmojiPanel.cc @@ -32,18 +32,18 @@ EmojiPanel::EmojiPanel(QWidget *parent) , animationDuration_{100} , categoryIconSize_{20} { -// setStyleSheet( -// "QWidget {background: #fff; color: #e8e8e8; border: none;}" -// "QScrollBar:vertical { background-color: #fff; width: 8px; margin: 0px 2px 0 2px; }" -// "QScrollBar::handle:vertical { background-color: #d6dde3; min-height: 20px; }" -// "QScrollBar::add-line:vertical { border: none; background: none; }" -// "QScrollBar::sub-line:vertical { border: none; background: none; }"); - setStyleSheet( - "QWidget {border: none;}" - "QScrollBar:vertical { width: 8px; margin: 0px 2px 0 2px; }" - "QScrollBar::handle:vertical { min-height: 20px; }" - "QScrollBar::add-line:vertical { border: none; background: none; }" - "QScrollBar::sub-line:vertical { border: none; background: none; }"); + // setStyleSheet( + // "QWidget {background: #fff; color: #e8e8e8; border: none;}" + // "QScrollBar:vertical { background-color: #fff; width: 8px; margin: 0px 2px 0 + // 2px; }" + // "QScrollBar::handle:vertical { background-color: #d6dde3; min-height: 20px; }" + // "QScrollBar::add-line:vertical { border: none; background: none; }" + // "QScrollBar::sub-line:vertical { border: none; background: none; }"); + setStyleSheet("QWidget {border: none;}" + "QScrollBar:vertical { width: 8px; margin: 0px 2px 0 2px; }" + "QScrollBar::handle:vertical { min-height: 20px; }" + "QScrollBar::add-line:vertical { border: none; background: none; }" + "QScrollBar::sub-line:vertical { border: none; background: none; }"); setAttribute(Qt::WA_TranslucentBackground, true); setAttribute(Qt::WA_ShowWithoutActivating, true); @@ -60,7 +60,7 @@ EmojiPanel::EmojiPanel(QWidget *parent) contentLayout->setMargin(0); auto emojiCategories = new QFrame(mainWidget); - //emojiCategories->setStyleSheet("background-color: #f2f2f2"); + // emojiCategories->setStyleSheet("background-color: #f2f2f2"); auto categoriesLayout = new QHBoxLayout(emojiCategories); categoriesLayout->setSpacing(6); diff --git a/src/LoginPage.cc b/src/LoginPage.cc index 2b51385e..5c766b78 100644 --- a/src/LoginPage.cc +++ b/src/LoginPage.cc @@ -30,7 +30,7 @@ LoginPage::LoginPage(QSharedPointer client, QWidget *parent) , inferredServerAddress_() , client_{client} { -// setStyleSheet("background-color: #fff"); + // setStyleSheet("background-color: #fff"); top_layout_ = new QVBoxLayout(); @@ -40,7 +40,7 @@ LoginPage::LoginPage(QSharedPointer client, QWidget *parent) back_button_ = new FlatButton(this); 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_->addStretch(1); @@ -75,10 +75,10 @@ LoginPage::LoginPage(QSharedPointer client, QWidget *parent) form_wrapper_->addStretch(1); matrixid_input_ = new TextField(this); -// matrixid_input_->setTextColor("#333333"); + // matrixid_input_->setTextColor("#333333"); matrixid_input_->setLabel(tr("Matrix ID")); -// matrixid_input_->setInkColor("#555459"); -// matrixid_input_->setBackgroundColor("#fff"); + // matrixid_input_->setInkColor("#555459"); + // matrixid_input_->setBackgroundColor("#fff"); matrixid_input_->setPlaceholderText(tr("e.g @joe:matrix.org")); spinner_ = new LoadingIndicator(this); @@ -95,17 +95,17 @@ LoginPage::LoginPage(QSharedPointer client, QWidget *parent) matrixidLayout_->addWidget(matrixid_input_, 0, Qt::AlignVCenter); password_input_ = new TextField(this); -// password_input_->setTextColor("#333333"); + // password_input_->setTextColor("#333333"); password_input_->setLabel(tr("Password")); -// password_input_->setInkColor("#555459"); -// password_input_->setBackgroundColor("#fff"); + // password_input_->setInkColor("#555459"); + // password_input_->setBackgroundColor("#fff"); password_input_->setEchoMode(QLineEdit::Password); serverInput_ = new TextField(this); -// serverInput_->setTextColor("#333333"); + // serverInput_->setTextColor("#333333"); serverInput_->setLabel("Homeserver address"); -// serverInput_->setInkColor("#555459"); -// serverInput_->setBackgroundColor("#fff"); + // serverInput_->setInkColor("#555459"); + // serverInput_->setBackgroundColor("#fff"); serverInput_->setPlaceholderText("matrix.org"); serverInput_->hide(); @@ -121,8 +121,8 @@ LoginPage::LoginPage(QSharedPointer client, QWidget *parent) button_layout_->setContentsMargins(0, 0, 0, 30); login_button_ = new RaisedButton(tr("LOGIN"), this); -// login_button_->setBackgroundColor(QColor("#333333")); -// login_button_->setForegroundColor(QColor("white")); + // login_button_->setBackgroundColor(QColor("#333333")); + // login_button_->setForegroundColor(QColor("white")); login_button_->setMinimumSize(350, 65); login_button_->setFontSize(20); login_button_->setCornerRadius(3); @@ -136,7 +136,7 @@ LoginPage::LoginPage(QSharedPointer client, QWidget *parent) error_label_ = new QLabel(this); error_label_->setFont(font); -// error_label_->setStyleSheet("color: #E22826"); + // error_label_->setStyleSheet("color: #E22826"); top_layout_->addLayout(top_bar_layout_); top_layout_->addStretch(1); diff --git a/src/LogoutDialog.cc b/src/LogoutDialog.cc index 94eab0ac..c0db1270 100644 --- a/src/LogoutDialog.cc +++ b/src/LogoutDialog.cc @@ -27,7 +27,7 @@ LogoutDialog::LogoutDialog(QWidget *parent) : QFrame(parent) { setMaximumSize(400, 400); -// setStyleSheet("background-color: #fff"); + // setStyleSheet("background-color: #fff"); auto layout = new QVBoxLayout(this); layout->setSpacing(30); @@ -52,7 +52,7 @@ LogoutDialog::LogoutDialog(QWidget *parent) auto label = new QLabel(tr("Logout. Are you sure?"), this); label->setFont(font); -// label->setStyleSheet("color: #333333"); + // label->setStyleSheet("color: #333333"); layout->addWidget(label); layout->addLayout(buttonLayout); diff --git a/src/RegisterPage.cc b/src/RegisterPage.cc index 0fe89fdf..01f3b28f 100644 --- a/src/RegisterPage.cc +++ b/src/RegisterPage.cc @@ -28,7 +28,7 @@ RegisterPage::RegisterPage(QSharedPointer client, QWidget *parent) : QWidget(parent) , client_(client) { -// setStyleSheet("background-color: #fff"); + // setStyleSheet("background-color: #fff"); top_layout_ = new QVBoxLayout(); @@ -73,30 +73,30 @@ RegisterPage::RegisterPage(QSharedPointer client, QWidget *parent) form_wrapper_->addStretch(1); username_input_ = new TextField(); -// username_input_->setTextColor("#333333"); + // username_input_->setTextColor("#333333"); username_input_->setLabel(tr("Username")); -// username_input_->setInkColor("#555459"); -// username_input_->setBackgroundColor("#fff"); + // username_input_->setInkColor("#555459"); + // username_input_->setBackgroundColor("#fff"); password_input_ = new TextField(); -// password_input_->setTextColor("#333333"); + // password_input_->setTextColor("#333333"); password_input_->setLabel(tr("Password")); -// password_input_->setInkColor("#555459"); -// password_input_->setBackgroundColor("#fff"); + // password_input_->setInkColor("#555459"); + // password_input_->setBackgroundColor("#fff"); password_input_->setEchoMode(QLineEdit::Password); password_confirmation_ = new TextField(); -// password_confirmation_->setTextColor("#333333"); + // password_confirmation_->setTextColor("#333333"); password_confirmation_->setLabel(tr("Password confirmation")); -// password_confirmation_->setInkColor("#555459"); -// password_confirmation_->setBackgroundColor("#fff"); + // password_confirmation_->setInkColor("#555459"); + // password_confirmation_->setBackgroundColor("#fff"); password_confirmation_->setEchoMode(QLineEdit::Password); server_input_ = new TextField(); -// server_input_->setTextColor("#333333"); + // server_input_->setTextColor("#333333"); server_input_->setLabel(tr("Home Server")); -// server_input_->setInkColor("#555459"); -// server_input_->setBackgroundColor("#fff"); + // server_input_->setInkColor("#555459"); + // server_input_->setBackgroundColor("#fff"); form_layout_->addWidget(username_input_, Qt::AlignHCenter, 0); form_layout_->addWidget(password_input_, Qt::AlignHCenter, 0); @@ -112,11 +112,11 @@ RegisterPage::RegisterPage(QSharedPointer client, QWidget *parent) error_label_ = new QLabel(this); error_label_->setFont(font); -// error_label_->setStyleSheet("color: #E22826"); + // error_label_->setStyleSheet("color: #E22826"); register_button_ = new RaisedButton(tr("REGISTER"), this); -// register_button_->setBackgroundColor(QColor("#333333")); -// register_button_->setForegroundColor(QColor("white")); + // register_button_->setBackgroundColor(QColor("#333333")); + // register_button_->setForegroundColor(QColor("white")); register_button_->setMinimumSize(350, 65); register_button_->setFontSize(conf::btn::fontSize); register_button_->setCornerRadius(conf::btn::cornerRadius); diff --git a/src/RoomInfoListItem.cc b/src/RoomInfoListItem.cc index 5937e0bd..f50bb40d 100644 --- a/src/RoomInfoListItem.cc +++ b/src/RoomInfoListItem.cc @@ -106,7 +106,7 @@ RoomInfoListItem::paintEvent(QPaintEvent *event) font.setPixelSize(conf::fontSize); QFontMetrics metrics(font); - //p.setPen(QColor("#333")); + // p.setPen(QColor("#333")); QRect avatarRegion(Padding, Padding, IconSize, IconSize); diff --git a/src/TimelineItem.cc b/src/TimelineItem.cc index cdaeac15..279c7561 100644 --- a/src/TimelineItem.cc +++ b/src/TimelineItem.cc @@ -66,7 +66,6 @@ TimelineItem::init() headerLayout_->setMargin(0); headerLayout_->setSpacing(conf::timeline::headerSpacing); - } /* @@ -400,8 +399,8 @@ TimelineItem::setupAvatarLayout(const QString &userName) userAvatar_ = new Avatar(this); userAvatar_->setLetter(QChar(userName[0]).toUpper()); -// userAvatar_->setBackgroundColor(QColor("#eee")); -// userAvatar_->setTextColor(QColor("black")); + // userAvatar_->setBackgroundColor(QColor("#eee")); + // userAvatar_->setTextColor(QColor("black")); userAvatar_->setSize(conf::timeline::avatarSize); // TODO: The provided user name should be a UserId class @@ -472,8 +471,8 @@ TimelineItem::~TimelineItem() {} void TimelineItem::paintEvent(QPaintEvent *) { - QStyleOption opt; - opt.init(this); - QPainter p(this); - style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); + QStyleOption opt; + opt.init(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } diff --git a/src/TimelineView.cc b/src/TimelineView.cc index 4025fc36..267fbbff 100644 --- a/src/TimelineView.cc +++ b/src/TimelineView.cc @@ -643,8 +643,8 @@ TimelineView::handleFailedMessage(int txnid) void TimelineView::paintEvent(QPaintEvent *) { - QStyleOption opt; - opt.init(this); - QPainter p(this); - style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); + QStyleOption opt; + opt.init(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } diff --git a/src/UserInfoWidget.cc b/src/UserInfoWidget.cc index aac3e592..c0278406 100644 --- a/src/UserInfoWidget.cc +++ b/src/UserInfoWidget.cc @@ -45,8 +45,8 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) userAvatar_ = new Avatar(this); userAvatar_->setLetter(QChar('?')); userAvatar_->setSize(55); -// userAvatar_->setBackgroundColor("#fff"); -// userAvatar_->setTextColor("#333333"); + // userAvatar_->setBackgroundColor("#fff"); + // userAvatar_->setTextColor("#333333"); QFont nameFont("Open Sans SemiBold"); nameFont.setPixelSize(conf::userInfoWidget::fonts::displayName); diff --git a/src/main.cc b/src/main.cc index 7daaeefa..341de9aa 100644 --- a/src/main.cc +++ b/src/main.cc @@ -17,12 +17,12 @@ #include #include +#include #include #include #include #include #include -#include #include "MainWindow.h"