summary refs log tree commit diff
path: root/src/ui
diff options
context:
space:
mode:
authorMax Sandholm <max@sandholm.org>2017-11-16 16:33:52 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-11-16 16:33:52 +0200
commit19b526d4533841ca91209929f0d6aef6042a8eeb (patch)
tree596400e11b6275a961b9d57b02b0c0b502df38c4 /src/ui
parentDon't send empty messages (diff)
downloadnheko-19b526d4533841ca91209929f0d6aef6042a8eeb.tar.xz
Use system color scheme (using a Qt stylesheet) #104
The color scheme of nheko obeys the default color theme of Qt
(i.e. the system theme). It uses a Qt stylesheet to accomplish this,
which means replacing the color theme with a custom theme would only
be a matter of writing a new style sheet and loading it into the app.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/Badge.cc1
-rw-r--r--src/ui/OverlayWidget.cc11
-rw-r--r--src/ui/TextField.cc2
3 files changed, 11 insertions, 3 deletions
diff --git a/src/ui/Badge.cc b/src/ui/Badge.cc

index 6e73eca0..016ed64f 100644 --- a/src/ui/Badge.cc +++ b/src/ui/Badge.cc
@@ -176,7 +176,6 @@ Badge::paintEvent(QPaintEvent *) QBrush brush; brush.setStyle(Qt::SolidPattern); - brush.setColor(isEnabled() ? backgroundColor() : QColor("#cccccc")); painter.setBrush(brush); painter.setPen(Qt::NoPen); diff --git a/src/ui/OverlayWidget.cc b/src/ui/OverlayWidget.cc
index c69f81f7..ccac0116 100644 --- a/src/ui/OverlayWidget.cc +++ b/src/ui/OverlayWidget.cc
@@ -59,3 +59,14 @@ OverlayWidget::overlayGeometry() const return widget->rect(); } + +void +OverlayWidget::paintEvent(QPaintEvent *event) +{ + Q_UNUSED(event); + + QStyleOption opt; + opt.init(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); +} diff --git a/src/ui/TextField.cc b/src/ui/TextField.cc
index e038f2dd..d80d6466 100644 --- a/src/ui/TextField.cc +++ b/src/ui/TextField.cc
@@ -197,8 +197,6 @@ TextField::paintEvent(QPaintEvent *event) if (text().isEmpty()) { painter.setOpacity(1 - state_machine_->progress()); - // painter.fillRect(rect(), - // parentWidget()->palette().color(backgroundRole())); painter.fillRect(rect(), backgroundColor()); }