summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2019-08-29 18:01:20 -0400
committerJoseph Donofry <joedonofry@gmail.com>2019-08-29 18:01:20 -0400
commit98d4f14bd1ccf4c280be6a5fb965c75217c74b7e (patch)
tree819673ed11f591e1630337bc62143308bf3463af
parent89015b9f187a36b71eed49d03b44545c1976efed (diff)
Fix themeing issues on mentions
-rw-r--r--resources/styles/nheko-dark.qss11
-rw-r--r--resources/styles/nheko.qss11
-rw-r--r--resources/styles/system.qss10
-rw-r--r--src/popups/UserMentions.cpp12
-rw-r--r--src/popups/UserMentions.h4
5 files changed, 47 insertions, 1 deletions
diff --git a/resources/styles/nheko-dark.qss b/resources/styles/nheko-dark.qss
index 1e1333b2..1271e39f 100644
--- a/resources/styles/nheko-dark.qss
+++ b/resources/styles/nheko-dark.qss
@@ -24,6 +24,17 @@ TimelineView > * {
border: none;
}
+UserMentionsWidget,
+UserMentionsWidget > * {
+ background-color: #202228;
+ border: none;
+}
+
+UserMentionsWidget > TimelineItem {
+ qproperty-backgroundColor: #202228;
+ qproperty-hoverColor: rgba(45, 49, 57, 120);
+}
+
#scroll_widget {
background-color: #202228;
}
diff --git a/resources/styles/nheko.qss b/resources/styles/nheko.qss
index a70441be..3c7f3b71 100644
--- a/resources/styles/nheko.qss
+++ b/resources/styles/nheko.qss
@@ -24,6 +24,17 @@ TimelineView > * {
border: none;
}
+UserMentionsWidget,
+UserMentionsWidget > * {
+ background-color: white;
+ border: none;
+}
+
+UserMentionsWidget > TimelineItem {
+ qproperty-backgroundColor: white;
+ qproperty-hoverColor: rgba(192, 193, 195, 120);
+}
+
#scroll_widget {
background-color: white;
}
diff --git a/resources/styles/system.qss b/resources/styles/system.qss
index dfb8ce65..0a8c4b21 100644
--- a/resources/styles/system.qss
+++ b/resources/styles/system.qss
@@ -12,6 +12,16 @@ TimelineView > * {
border: none;
}
+UserMentionsWidget,
+UserMentionsWidget > * {
+ border: none;
+}
+
+UserMentionsWidget > TimelineItem {
+ qproperty-backgroundColor: palette(window);
+ qproperty-hoverColor: palette(base);
+}
+
TextInputWidget {
border: none;
border-top: 1px solid palette(mid);
diff --git a/src/popups/UserMentions.cpp b/src/popups/UserMentions.cpp
index 152cd82d..3480959a 100644
--- a/src/popups/UserMentions.cpp
+++ b/src/popups/UserMentions.cpp
@@ -1,3 +1,5 @@
+#include <QPainter>
+#include <QStyleOption>
#include <QTabWidget>
#include <QTimer>
@@ -140,7 +142,6 @@ UserMentions::pushItem(const QString &event_id,
local_scroll_widget_);
local_view_item->setEventId(event_id);
local_view_item->hide();
-
local_scroll_layout_->addWidget(local_view_item);
QTimer::singleShot(0, this, [local_view_item]() {
@@ -148,4 +149,13 @@ UserMentions::pushItem(const QString &event_id,
local_view_item->adjustSize();
});
}
+}
+
+void
+UserMentions::paintEvent(QPaintEvent *)
+{
+ QStyleOption opt;
+ opt.init(this);
+ QPainter p(this);
+ style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
} \ No newline at end of file
diff --git a/src/popups/UserMentions.h b/src/popups/UserMentions.h
index a74bf2ec..d7dfc575 100644
--- a/src/popups/UserMentions.h
+++ b/src/popups/UserMentions.h
@@ -5,6 +5,7 @@
#include <QApplication>
#include <QEvent>
#include <QMap>
+#include <QPaintEvent>
#include <QScrollArea>
#include <QScrollBar>
#include <QString>
@@ -26,6 +27,9 @@ public:
void initializeMentions(const QMap<QString, mtx::responses::Notifications> &notifs);
void showPopup();
+protected:
+ void paintEvent(QPaintEvent *) override;
+
private:
void pushItem(const QString &event_id,
const QString &user_id,