mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Add hover color for timestamp.
Update dark and system themes to provide colors for the hover states for title, subtitle, and timestamp.
This commit is contained in:
parent
ae91bab07d
commit
3fceaeb203
5 changed files with 19 additions and 2 deletions
|
@ -93,6 +93,9 @@ RoomInfoListItem {
|
||||||
qproperty-titleColor: #e4e5e8;
|
qproperty-titleColor: #e4e5e8;
|
||||||
qproperty-subtitleColor: #caccd1;
|
qproperty-subtitleColor: #caccd1;
|
||||||
|
|
||||||
|
qproperty-hoverTitleColor: #f4f5f8;
|
||||||
|
qproperty-hoverSubtitleColor: white;
|
||||||
|
|
||||||
qproperty-highlightedTitleColor: #f4f4f5;
|
qproperty-highlightedTitleColor: #f4f4f5;
|
||||||
qproperty-highlightedSubtitleColor: #e4e5e8;
|
qproperty-highlightedSubtitleColor: #e4e5e8;
|
||||||
|
|
||||||
|
@ -101,6 +104,7 @@ RoomInfoListItem {
|
||||||
|
|
||||||
qproperty-timestampColor: #727274;
|
qproperty-timestampColor: #727274;
|
||||||
qproperty-highlightedTimestampColor: #e7e7e9;
|
qproperty-highlightedTimestampColor: #e7e7e9;
|
||||||
|
qproperty-hoverTimestampColor: #f4f5f8;
|
||||||
|
|
||||||
qproperty-avatarBgColor: #202228;
|
qproperty-avatarBgColor: #202228;
|
||||||
qproperty-avatarFgColor: white;
|
qproperty-avatarFgColor: white;
|
||||||
|
|
|
@ -100,6 +100,7 @@ RoomInfoListItem {
|
||||||
|
|
||||||
qproperty-timestampColor: #707070;
|
qproperty-timestampColor: #707070;
|
||||||
qproperty-highlightedTimestampColor: #f4f4f5;
|
qproperty-highlightedTimestampColor: #f4f4f5;
|
||||||
|
qproperty-hoverTimestampColor: white;
|
||||||
|
|
||||||
qproperty-avatarBgColor: #eee;
|
qproperty-avatarBgColor: #eee;
|
||||||
qproperty-avatarFgColor: black;
|
qproperty-avatarFgColor: black;
|
||||||
|
|
|
@ -92,11 +92,15 @@ RoomInfoListItem {
|
||||||
qproperty-highlightedTitleColor: palette(highlightedtext);
|
qproperty-highlightedTitleColor: palette(highlightedtext);
|
||||||
qproperty-highlightedSubtitleColor: palette(highlightedtext);
|
qproperty-highlightedSubtitleColor: palette(highlightedtext);
|
||||||
|
|
||||||
|
qproperty-hoverTitleColor: palette(highlightedtext);
|
||||||
|
qproperty-hoverSubtitleColor: palette(highlightedtext);
|
||||||
|
|
||||||
qproperty-btnColor: palette(button);
|
qproperty-btnColor: palette(button);
|
||||||
qproperty-btnTextColor: palette(buttonText);
|
qproperty-btnTextColor: palette(buttonText);
|
||||||
|
|
||||||
qproperty-timestampColor: palette(text);
|
qproperty-timestampColor: palette(text);
|
||||||
qproperty-highlightedTimestampColor: palette(highlightedtext);
|
qproperty-highlightedTimestampColor: palette(highlightedtext);
|
||||||
|
qproperty-hoverTimestampColor: palette(highlightedtext);
|
||||||
|
|
||||||
qproperty-avatarBgColor: palette(base);
|
qproperty-avatarBgColor: palette(base);
|
||||||
qproperty-avatarFgColor: palette(text);
|
qproperty-avatarFgColor: palette(text);
|
||||||
|
|
|
@ -227,10 +227,13 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
|
||||||
|
|
||||||
// We show the last message timestamp.
|
// We show the last message timestamp.
|
||||||
p.save();
|
p.save();
|
||||||
if (isPressed_)
|
if (isPressed_) {
|
||||||
p.setPen(QPen(highlightedTimestampColor_));
|
p.setPen(QPen(highlightedTimestampColor_));
|
||||||
else
|
} else if (underMouse()) {
|
||||||
|
p.setPen(QPen(hoverTimestampColor_));
|
||||||
|
} else {
|
||||||
p.setPen(QPen(timestampColor_));
|
p.setPen(QPen(timestampColor_));
|
||||||
|
}
|
||||||
|
|
||||||
p.setFont(tsFont);
|
p.setFont(tsFont);
|
||||||
p.drawText(QPoint(width() - wm.padding - msgStampWidth, top_y),
|
p.drawText(QPoint(width() - wm.padding - msgStampWidth, top_y),
|
||||||
|
|
|
@ -49,6 +49,8 @@ class RoomInfoListItem : public QWidget
|
||||||
Q_PROPERTY(QColor timestampColor READ timestampColor WRITE setTimestampColor)
|
Q_PROPERTY(QColor timestampColor READ timestampColor WRITE setTimestampColor)
|
||||||
Q_PROPERTY(QColor highlightedTimestampColor READ highlightedTimestampColor WRITE
|
Q_PROPERTY(QColor highlightedTimestampColor READ highlightedTimestampColor WRITE
|
||||||
setHighlightedTimestampColor)
|
setHighlightedTimestampColor)
|
||||||
|
Q_PROPERTY(QColor hoverTimestampColor READ hoverTimestampColor WRITE
|
||||||
|
setHoverTimestampColor)
|
||||||
|
|
||||||
Q_PROPERTY(
|
Q_PROPERTY(
|
||||||
QColor highlightedTitleColor READ highlightedTitleColor WRITE setHighlightedTitleColor)
|
QColor highlightedTitleColor READ highlightedTitleColor WRITE setHighlightedTitleColor)
|
||||||
|
@ -81,6 +83,7 @@ public:
|
||||||
QColor hoverBackgroundColor() const { return hoverBackgroundColor_; }
|
QColor hoverBackgroundColor() const { return hoverBackgroundColor_; }
|
||||||
QColor hoverTitleColor() const { return hoverTitleColor_; }
|
QColor hoverTitleColor() const { return hoverTitleColor_; }
|
||||||
QColor hoverSubtitleColor() const { return hoverSubtitleColor_; }
|
QColor hoverSubtitleColor() const { return hoverSubtitleColor_; }
|
||||||
|
QColor hoverTimestampColor() const { return hoverTimestampColor_; }
|
||||||
QColor backgroundColor() const { return backgroundColor_; }
|
QColor backgroundColor() const { return backgroundColor_; }
|
||||||
QColor avatarBgColor() const { return avatarBgColor_; }
|
QColor avatarBgColor() const { return avatarBgColor_; }
|
||||||
QColor avatarFgColor() const { return avatarFgColor_; }
|
QColor avatarFgColor() const { return avatarFgColor_; }
|
||||||
|
@ -102,6 +105,7 @@ public:
|
||||||
void setHoverBackgroundColor(QColor &color) { hoverBackgroundColor_ = color; }
|
void setHoverBackgroundColor(QColor &color) { hoverBackgroundColor_ = color; }
|
||||||
void setHoverSubtitleColor(QColor &color) { hoverSubtitleColor_ = color; }
|
void setHoverSubtitleColor(QColor &color) { hoverSubtitleColor_ = color; }
|
||||||
void setHoverTitleColor(QColor &color) { hoverTitleColor_ = color; }
|
void setHoverTitleColor(QColor &color) { hoverTitleColor_ = color; }
|
||||||
|
void setHoverTimestampColor(QColor &color) { hoverTimestampColor_ = color; }
|
||||||
void setBackgroundColor(QColor &color) { backgroundColor_ = color; }
|
void setBackgroundColor(QColor &color) { backgroundColor_ = color; }
|
||||||
void setTimestampColor(QColor &color) { timestampColor_ = color; }
|
void setTimestampColor(QColor &color) { timestampColor_ = color; }
|
||||||
void setAvatarFgColor(QColor &color) { avatarFgColor_ = color; }
|
void setAvatarFgColor(QColor &color) { avatarFgColor_ = color; }
|
||||||
|
@ -210,6 +214,7 @@ private:
|
||||||
|
|
||||||
QColor timestampColor_;
|
QColor timestampColor_;
|
||||||
QColor highlightedTimestampColor_;
|
QColor highlightedTimestampColor_;
|
||||||
|
QColor hoverTimestampColor_;
|
||||||
|
|
||||||
QColor avatarBgColor_;
|
QColor avatarBgColor_;
|
||||||
QColor avatarFgColor_;
|
QColor avatarFgColor_;
|
||||||
|
|
Loading…
Reference in a new issue