Skip to content
This repository has been archived by the owner on Oct 17, 2019. It is now read-only.

Commit

Permalink
Paint RoomList's background (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
mujx committed Nov 25, 2017
1 parent f0ecf6e commit 54cf341
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
3 changes: 3 additions & 0 deletions include/RoomList.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public slots:
void closeLeaveRoomDialog(bool leaving, const QString &room_id);
void clearRoomMessageCount(const QString &room_id);

protected:
void paintEvent(QPaintEvent *event) override;

private:
void calculateUnreadMessageCount();

Expand Down
5 changes: 5 additions & 0 deletions resources/styles/nheko-dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ TimelineView > * {
background-color: #383c4a;
}

RoomList,
RoomList > * {
background-color: #383c4a;
}

FlatButton {
qproperty-foregroundColor: #caccd1;
qproperty-backgroundColor: #333;
Expand Down
19 changes: 12 additions & 7 deletions resources/styles/nheko.qss
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ QLabel {
}

#chatPage,
#chatPage > * {
background-color: white;
#chatPage > * {
background-color: white;
}

TimelineView,
TimelineView > * {
background-color: white;
background-color: white;
}

RoomList,
RoomList > * {
background-color: white;
}

FlatButton {
qproperty-foregroundColor: #333;
FlatButton {
qproperty-foregroundColor: #333;
}

RaisedButton {
qproperty-foregroundColor: white;
RaisedButton {
qproperty-foregroundColor: white;
}

RoomInfoListItem {
Expand Down
9 changes: 9 additions & 0 deletions src/RoomList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,12 @@ RoomList::closeLeaveRoomDialog(bool leaving, const QString &room_id)
client_->leaveRoom(room_id);
}
}

void
RoomList::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}

0 comments on commit 54cf341

Please sign in to comment.