Fix minor stylistic issues on the nheko theme

This commit is contained in:
Konstantinos Sideris 2017-11-22 19:52:38 +02:00
parent 929b2df6fb
commit 552941118b
13 changed files with 107 additions and 8 deletions

View file

@ -10,6 +10,9 @@ class LeaveRoomDialog : public QFrame
public:
explicit LeaveRoomDialog(QWidget *parent = nullptr);
protected:
void paintEvent(QPaintEvent *event) override;
signals:
void closing(bool isLeaving);

View file

@ -42,6 +42,9 @@ public:
signals:
void backButtonClicked();
protected:
void paintEvent(QPaintEvent *event) override;
public slots:
// Displays errors produced during the login.
void loginError(QString error_message);

View file

@ -27,6 +27,9 @@ class LogoutDialog : public QFrame
public:
explicit LogoutDialog(QWidget *parent = nullptr);
protected:
void paintEvent(QPaintEvent *event) override;
signals:
void closing(bool isLoggingOut);

View file

@ -35,6 +35,9 @@ public:
RegisterPage(QSharedPointer<MatrixClient> client, QWidget *parent = 0);
~RegisterPage();
protected:
void paintEvent(QPaintEvent *event) override;
signals:
void backButtonClicked();

View file

@ -65,6 +65,7 @@ public:
protected:
void showEvent(QShowEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void paintEvent(QPaintEvent *event) override;
signals:
void moveBack();

View file

@ -28,6 +28,9 @@ class WelcomePage : public QWidget
public:
explicit WelcomePage(QWidget *parent = 0);
protected:
void paintEvent(QPaintEvent *event) override;
signals:
// Notify that the user wants to login in.
void userLogin();

View file

@ -1,7 +1,3 @@
* {
color: #333;
}
QLabel {
color: #333;
}
@ -10,8 +6,6 @@ QLabel {
TimelineView, TimelineView > * { background-color: white; }
QMenu, QMenu > * { background-color: white; }
FlatButton { qproperty-foregroundColor: #333; }
RaisedButton { qproperty-foregroundColor: white; }
@ -42,6 +36,10 @@ UserInfoWidget, UserInfoWidget > * {
color: #ebebeb;
}
UserSettingsPage {
background-color: white;
}
Avatar {
qproperty-textColor: black;
qproperty-backgroundColor: #eee;
@ -54,3 +52,28 @@ Avatar {
#userIdLabel {
color: #555459;
}
LogoutDialog {
background-color: white;
color: #333;
}
LeaveRoomDialog {
background-color: white;
color: #333;
}
WelcomePage {
background-color: white;
color: #333;
}
LoginPage {
background-color: white;
color: #333;
}
RegisterPage {
background-color: white;
color: #333;
}

View file

@ -1,5 +1,6 @@
#include <QLabel>
#include <QVBoxLayout>
#include <QStyleOption>
#include "Config.h"
#include "FlatButton.h"
@ -43,3 +44,12 @@ LeaveRoomDialog::LeaveRoomDialog(QWidget *parent)
connect(confirmBtn_, &QPushButton::clicked, [=]() { emit closing(true); });
connect(cancelBtn_, &QPushButton::clicked, [=]() { emit closing(false); });
}
void
LeaveRoomDialog::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}

View file

@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QStyleOption>
#include "LoginPage.h"
#include "Config.h"
#include "FlatButton.h"
@ -301,4 +303,13 @@ LoginPage::onBackButtonClicked()
emit backButtonClicked();
}
void
LoginPage::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
LoginPage::~LoginPage() {}

View file

@ -17,6 +17,8 @@
#include <QLabel>
#include <QVBoxLayout>
#include <QPaintEvent>
#include <QStyleOption>
#include "Config.h"
#include "FlatButton.h"
@ -27,7 +29,6 @@ LogoutDialog::LogoutDialog(QWidget *parent)
: QFrame(parent)
{
setMaximumSize(400, 400);
// setStyleSheet("background-color: #fff");
auto layout = new QVBoxLayout(this);
layout->setSpacing(30);
@ -52,7 +53,6 @@ LogoutDialog::LogoutDialog(QWidget *parent)
auto label = new QLabel(tr("Logout. Are you sure?"), this);
label->setFont(font);
// label->setStyleSheet("color: #333333");
layout->addWidget(label);
layout->addLayout(buttonLayout);
@ -60,3 +60,12 @@ LogoutDialog::LogoutDialog(QWidget *parent)
connect(confirmBtn_, &QPushButton::clicked, [=]() { emit closing(true); });
connect(cancelBtn_, &QPushButton::clicked, [=]() { emit closing(false); });
}
void
LogoutDialog::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}

View file

@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QStyleOption>
#include "RegisterPage.h"
#include "Avatar.h"
#include "Config.h"
@ -186,4 +188,13 @@ RegisterPage::onRegisterButtonClicked()
}
}
void
RegisterPage::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
RegisterPage::~RegisterPage() {}

View file

@ -152,3 +152,12 @@ UserSettingsPage::resizeEvent(QResizeEvent *event)
QWidget::resizeEvent(event);
}
void
UserSettingsPage::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}

View file

@ -15,6 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QStyleOption>
#include <QLabel>
#include <QLayout>
@ -83,3 +84,12 @@ WelcomePage::WelcomePage(QWidget *parent)
connect(registerBtn_, &QPushButton::clicked, this, &WelcomePage::userRegister);
connect(loginBtn_, &QPushButton::clicked, this, &WelcomePage::userLogin);
}
void
WelcomePage::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}