summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <[email protected]>2018-01-31 10:51:39 -0500
committerKurt Hindenburg <[email protected]>2018-01-31 10:51:39 -0500
commit3589c3b7d0c1cd2b08755a654f2a27a1071017ef (patch)
treec2d4d3c49be62d4c9d9f039c3688d7ccd73d7e10
parentde2525ca6b638d270cc72557631704a4062ebb62 (diff)
demo_konsolepart: allow profiles' transparency to work
Add notes about why EditProfileDialog transparency warning show up
-rw-r--r--src/tests/demo_konsolepart/src/CMakeLists.txt1
-rw-r--r--src/tests/demo_konsolepart/src/demo_konsolepart.cpp20
2 files changed, 18 insertions, 3 deletions
diff --git a/src/tests/demo_konsolepart/src/CMakeLists.txt b/src/tests/demo_konsolepart/src/CMakeLists.txt
index 828ac54..4e61708 100644
--- a/src/tests/demo_konsolepart/src/CMakeLists.txt
+++ b/src/tests/demo_konsolepart/src/CMakeLists.txt
@@ -12,4 +12,5 @@ target_link_libraries(demo_konsolepart
KF5::Pty
Qt5::Widgets
KF5::XmlGui
+ KF5::WindowSystem
)
diff --git a/src/tests/demo_konsolepart/src/demo_konsolepart.cpp b/src/tests/demo_konsolepart/src/demo_konsolepart.cpp
index b1b8d49..993c8f5 100644
--- a/src/tests/demo_konsolepart/src/demo_konsolepart.cpp
+++ b/src/tests/demo_konsolepart/src/demo_konsolepart.cpp
@@ -20,14 +20,18 @@
#include "demo_konsolepart.h"
+#include <QApplication>
+#include <QMenu>
+#include <QMenuBar>
+
#include <KPluginLoader>
#include <KPluginFactory>
#include <KService>
#include <KStandardAction>
+#include <KWindowSystem>
-#include <QApplication>
-#include <QMenu>
-#include <QMenuBar>
+// see below notes
+//#include "../../../WindowSystemInfo.h"
demo_konsolepart::demo_konsolepart()
: KMainWindow(),
@@ -35,6 +39,16 @@ demo_konsolepart::demo_konsolepart()
_terminalPart(nullptr),
_terminal(nullptr)
{
+ const bool useTranslucency = KWindowSystem::compositingActive();
+
+ setAttribute(Qt::WA_TranslucentBackground, useTranslucency);
+ setAttribute(Qt::WA_NoSystemBackground, false);
+
+ // This is used in EditProfileDialog to show the warnings about
+ // transparency issues - needs refactoring as the above
+ // include does not work
+// WindowSystemInfo::HAVE_TRANSPARENCY = useTranslucency;
+
// Create terminal part and embed in into the main window
_terminalPart = createPart();
if (_terminalPart == nullptr) {