Initial work on stylesheet support (broken)
This commit is contained in:
parent
4fc663db7c
commit
9521e692c0
@ -42,7 +42,6 @@
|
|||||||
<file>icons/emoji-categories/flags.png</file>
|
<file>icons/emoji-categories/flags.png</file>
|
||||||
<file>icons/emoji-categories/flags@2x.png</file>
|
<file>icons/emoji-categories/flags@2x.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
|
||||||
<qresource prefix="/logos">
|
<qresource prefix="/logos">
|
||||||
<file>nheko.png</file>
|
<file>nheko.png</file>
|
||||||
|
|
||||||
@ -62,13 +61,14 @@
|
|||||||
<file>nheko-32.png</file>
|
<file>nheko-32.png</file>
|
||||||
<file>nheko-16.png</file>
|
<file>nheko-16.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
|
||||||
<qresource prefix="/fonts">
|
<qresource prefix="/fonts">
|
||||||
<file>fonts/OpenSans/OpenSans-Regular.ttf</file>
|
<file>fonts/OpenSans/OpenSans-Regular.ttf</file>
|
||||||
<file>fonts/OpenSans/OpenSans-Italic.ttf</file>
|
<file>fonts/OpenSans/OpenSans-Italic.ttf</file>
|
||||||
<file>fonts/OpenSans/OpenSans-Bold.ttf</file>
|
<file>fonts/OpenSans/OpenSans-Bold.ttf</file>
|
||||||
<file>fonts/OpenSans/OpenSans-Semibold.ttf</file>
|
<file>fonts/OpenSans/OpenSans-Semibold.ttf</file>
|
||||||
|
|
||||||
<file>fonts/EmojiOne/emojione-android.ttf</file>
|
<file>fonts/EmojiOne/emojione-android.ttf</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
<qresource prefix="/styles">
|
||||||
|
<file>styles/system.qss</file>
|
||||||
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
2
resources/styles/system.qss
Normal file
2
resources/styles/system.qss
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
TimelineView { background-color: red; }
|
||||||
|
TimelineItem { background-color: rgba(255,0,0,255); }
|
@ -55,7 +55,6 @@ ChatPage::ChatPage(QSharedPointer<MatrixClient> client, QWidget *parent)
|
|||||||
|
|
||||||
auto splitter = new Splitter(this);
|
auto splitter = new Splitter(this);
|
||||||
splitter->setHandleWidth(1);
|
splitter->setHandleWidth(1);
|
||||||
splitter->setStyleSheet("QSplitter::handle { background-color: palette(base); }");
|
|
||||||
|
|
||||||
topLayout_->addWidget(splitter);
|
topLayout_->addWidget(splitter);
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
{
|
{
|
||||||
setWindowTitle("nheko");
|
setWindowTitle("nheko");
|
||||||
setObjectName("MainWindow");
|
setObjectName("MainWindow");
|
||||||
// setStyleSheet("QWidget#MainWindow {background-color: #fff}");
|
|
||||||
|
|
||||||
restoreWindowSize();
|
restoreWindowSize();
|
||||||
|
|
||||||
|
@ -182,7 +182,6 @@ TextInputWidget::TextInputWidget(QWidget *parent)
|
|||||||
send_file_icon.addFile(":/icons/icons/ui/paper-clip-outline.png");
|
send_file_icon.addFile(":/icons/icons/ui/paper-clip-outline.png");
|
||||||
|
|
||||||
sendFileBtn_ = new FlatButton(this);
|
sendFileBtn_ = new FlatButton(this);
|
||||||
sendFileBtn_->setForegroundColor(palette().color(QPalette::Text));
|
|
||||||
sendFileBtn_->setIcon(send_file_icon);
|
sendFileBtn_->setIcon(send_file_icon);
|
||||||
sendFileBtn_->setIconSize(QSize(24, 24));
|
sendFileBtn_->setIconSize(QSize(24, 24));
|
||||||
|
|
||||||
@ -203,7 +202,6 @@ TextInputWidget::TextInputWidget(QWidget *parent)
|
|||||||
input_->setStyleSheet("border: none; padding-top: 5px; background-color: rgba(0,0,0,0);");
|
input_->setStyleSheet("border: none; padding-top: 5px; background-color: rgba(0,0,0,0);");
|
||||||
|
|
||||||
sendMessageBtn_ = new FlatButton(this);
|
sendMessageBtn_ = new FlatButton(this);
|
||||||
sendMessageBtn_->setForegroundColor(palette().color(QPalette::Text));
|
|
||||||
|
|
||||||
QIcon send_message_icon;
|
QIcon send_message_icon;
|
||||||
send_message_icon.addFile(":/icons/icons/ui/cursor.png");
|
send_message_icon.addFile(":/icons/icons/ui/cursor.png");
|
||||||
@ -211,7 +209,6 @@ TextInputWidget::TextInputWidget(QWidget *parent)
|
|||||||
sendMessageBtn_->setIconSize(QSize(24, 24));
|
sendMessageBtn_->setIconSize(QSize(24, 24));
|
||||||
|
|
||||||
emojiBtn_ = new EmojiPickButton(this);
|
emojiBtn_ = new EmojiPickButton(this);
|
||||||
emojiBtn_->setForegroundColor(palette().color(QPalette::Text));
|
|
||||||
|
|
||||||
QIcon emoji_icon;
|
QIcon emoji_icon;
|
||||||
emoji_icon.addFile(":/icons/icons/ui/smile.png");
|
emoji_icon.addFile(":/icons/icons/ui/smile.png");
|
||||||
|
@ -67,7 +67,6 @@ TimelineItem::init()
|
|||||||
headerLayout_->setMargin(0);
|
headerLayout_->setMargin(0);
|
||||||
headerLayout_->setSpacing(conf::timeline::headerSpacing);
|
headerLayout_->setSpacing(conf::timeline::headerSpacing);
|
||||||
|
|
||||||
setStyleSheet("background-color: rgba(0,0,0,0);");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -399,9 +399,6 @@ TimelineView::init()
|
|||||||
const int max = scroll_area_->verticalScrollBar()->maximum();
|
const int max = scroll_area_->verticalScrollBar()->maximum();
|
||||||
scroll_area_->verticalScrollBar()->setValue(max);
|
scroll_area_->verticalScrollBar()->setValue(max);
|
||||||
});
|
});
|
||||||
|
|
||||||
setBackgroundRole(QPalette::Base);
|
|
||||||
|
|
||||||
top_layout_ = new QVBoxLayout(this);
|
top_layout_ = new QVBoxLayout(this);
|
||||||
top_layout_->setSpacing(0);
|
top_layout_->setSpacing(0);
|
||||||
top_layout_->setMargin(0);
|
top_layout_->setMargin(0);
|
||||||
@ -418,6 +415,7 @@ TimelineView::init()
|
|||||||
scroll_layout_ = new QVBoxLayout(scroll_widget_);
|
scroll_layout_ = new QVBoxLayout(scroll_widget_);
|
||||||
scroll_layout_->addStretch(1);
|
scroll_layout_->addStretch(1);
|
||||||
scroll_layout_->setSpacing(0);
|
scroll_layout_->setSpacing(0);
|
||||||
|
scroll_layout_->setObjectName("timelinescrollarea");
|
||||||
|
|
||||||
scroll_area_->setWidget(scroll_widget_);
|
scroll_area_->setWidget(scroll_widget_);
|
||||||
|
|
||||||
|
@ -70,7 +70,6 @@ TopRoomBar::TopRoomBar(QWidget *parent)
|
|||||||
textLayout_->addWidget(topicLabel_);
|
textLayout_->addWidget(topicLabel_);
|
||||||
|
|
||||||
settingsBtn_ = new FlatButton(this);
|
settingsBtn_ = new FlatButton(this);
|
||||||
settingsBtn_->setForegroundColor(palette().color(QPalette::ToolTipText));
|
|
||||||
settingsBtn_->setFixedSize(buttonSize_, buttonSize_);
|
settingsBtn_->setFixedSize(buttonSize_, buttonSize_);
|
||||||
settingsBtn_->setCornerRadius(buttonSize_ / 2);
|
settingsBtn_->setCornerRadius(buttonSize_ / 2);
|
||||||
|
|
||||||
|
@ -77,7 +77,6 @@ UserInfoWidget::UserInfoWidget(QWidget *parent)
|
|||||||
buttonLayout_->setMargin(0);
|
buttonLayout_->setMargin(0);
|
||||||
|
|
||||||
logoutButton_ = new FlatButton(this);
|
logoutButton_ = new FlatButton(this);
|
||||||
logoutButton_->setForegroundColor(palette().color(QPalette::Text));
|
|
||||||
logoutButton_->setCornerRadius(logoutButtonSize_ / 2);
|
logoutButton_->setCornerRadius(logoutButtonSize_ / 2);
|
||||||
|
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
|
@ -70,6 +70,12 @@ main(int argc, char *argv[])
|
|||||||
app.setWindowIcon(QIcon(":/logos/nheko.png"));
|
app.setWindowIcon(QIcon(":/logos/nheko.png"));
|
||||||
qSetMessagePattern("%{time process}: [%{type}] - %{message}");
|
qSetMessagePattern("%{time process}: [%{type}] - %{message}");
|
||||||
|
|
||||||
|
QFile stylefile(":/styles/styles/system.qss");
|
||||||
|
stylefile.open(QFile::ReadOnly);
|
||||||
|
QString stylesheet = QString(stylefile.readAll());
|
||||||
|
|
||||||
|
app.setStyleSheet(stylesheet);
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
// Set the default if a value has not been set.
|
// Set the default if a value has not been set.
|
||||||
|
Loading…
Reference in New Issue
Block a user