aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2020-04-03 13:08:06 -0400
committerKen Moore <moorekou@gmail.com>2020-04-03 13:08:06 -0400
commitcf5996b52e17cd392d7fecc417fef321c870cfcb (patch)
treeead9b504c6177df998230963806a2a24633dbdb4
parentUpdate lthemeengine.cpp (diff)
downloadlumina-cf5996b52e17cd392d7fecc417fef321c870cfcb.tar.gz
lumina-cf5996b52e17cd392d7fecc417fef321c870cfcb.tar.bz2
lumina-cf5996b52e17cd392d7fecc417fef321c870cfcb.zip
Add a new tool: lumina-pingcursor.
This just shows a 1second popup around the current mouse position and above all windows
-rw-r--r--src-qt5/core/lumina-pingcursor/lumina-pingcursor.pro14
-rw-r--r--src-qt5/core/lumina-pingcursor/main.cpp31
2 files changed, 45 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-pingcursor/lumina-pingcursor.pro b/src-qt5/core/lumina-pingcursor/lumina-pingcursor.pro
new file mode 100644
index 00000000..5609a35b
--- /dev/null
+++ b/src-qt5/core/lumina-pingcursor/lumina-pingcursor.pro
@@ -0,0 +1,14 @@
+include("$${PWD}/../../OS-detect.pri")
+
+QT += core gui
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+
+TARGET = lumina-pingcursor
+target.path = $${L_BINDIR}
+
+TEMPLATE = app
+
+SOURCES += main.cpp
+
+INSTALLS += target
diff --git a/src-qt5/core/lumina-pingcursor/main.cpp b/src-qt5/core/lumina-pingcursor/main.cpp
new file mode 100644
index 00000000..19d4690e
--- /dev/null
+++ b/src-qt5/core/lumina-pingcursor/main.cpp
@@ -0,0 +1,31 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2020, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+
+#include <QApplication>
+#include <QPixmap>
+#include <QLabel>
+#include <QDateTime>
+#include <QPoint>
+int main(int argc, char **argv){
+ //Setup the application
+ QApplication App(argc, argv);
+ App.setAttribute(Qt::AA_UseHighDpiPixmaps);
+ //Display the OSD
+ QWidget splash(0, Qt::Window | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
+ splash.setWindowTitle("");
+ splash.setStyleSheet("background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0 transparent, stop:0.52 transparent, stop:0.565 rgba(82, 121, 76, 33), stop:0.65 rgba(159, 235, 148, 64), stop:0.721925 rgba(255, 238, 150, 129), stop:0.77 rgba(255, 128, 128, 204), stop:0.89 rgba(191, 128, 255, 64), stop:1 transparent);");
+ splash.setWindowOpacity(0);
+ splash.resize(100,100);
+ //Make sure it is centered on the current screen
+ QPoint center = QCursor::pos();
+ splash.move(center.x()-(splash.size().width()/2), center.y()-(splash.size().height()/2));
+ splash.show();
+ QDateTime end = QDateTime::currentDateTime().addMSecs(1000);
+ while(QDateTime::currentDateTime() < end){ App.processEvents(); }
+ splash.hide();
+ return 0;
+}
bgstack15