aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-06-16 09:46:48 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-06-16 09:46:48 +0200
commitb936bccd9d0d7f50f37c078b7aad9e75ee9fc981 (patch)
tree8387c8cbce8c4924a71fa34d7df124f8593a0e94 /src/mainwindow
parentBookmarks manager bugfixes (diff)
downloadsmolbote-b936bccd9d0d7f50f37c078b7aad9e75ee9fc981.tar.xz
Add Plasma option to cmake that turns on KF5 blur window effect
Diffstat (limited to 'src/mainwindow')
-rw-r--r--src/mainwindow/mainwindow.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp
index 6558c65..b2c79cc 100644
--- a/src/mainwindow/mainwindow.cpp
+++ b/src/mainwindow/mainwindow.cpp
@@ -30,6 +30,10 @@
#include <QJsonArray>
#include "browser.h"
+#ifdef PLASMA_BLUR
+#include <KWindowEffects>
+#endif
+
MainWindow::MainWindow(std::shared_ptr<Configuration> &config, QWidget *parent)
: QMainWindow(parent)
, mdiArea(new QMdiArea(this))
@@ -37,6 +41,11 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> &config, QWidget *parent)
Q_ASSERT(config);
m_config = config;
+#ifdef PLASMA_BLUR
+ setAttribute(Qt::WA_TranslucentBackground, true);
+ KWindowEffects::enableBlurBehind(this->winId(), true);
+#endif
+
// create UI
setWindowTitle(QString::fromStdString(config->value<std::string>("mainwindow.title").value()));
resize(config->value<int>("mainwindow.width").value(), config->value<int>("mainwindow.height").value());
@@ -55,6 +64,7 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> &config, QWidget *parent)
addressBar = new AddressBar(config->section("addressbar"), this);
navigationToolBar->addWidget(addressBar);
+ mdiArea->setBackground(Qt::NoBrush);
setCentralWidget(mdiArea);
mdiArea->setFocus();