summaryrefslogtreecommitdiffstats
path: root/toolwindow.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2017-04-09 02:53:39 +0200
committerArno <arno@disconnect.de>2017-04-09 02:53:39 +0200
commit8d0f7783a4db453ccb0ac5f05798f277f5c01f65 (patch)
treee9e180cb7279bb39f6c029ef3e884bb9c47e6222 /toolwindow.cpp
parent1355b93895e68f6ccc8709f919a65b04238e126c (diff)
downloadBeetPlayer-8d0f7783a4db453ccb0ac5f05798f277f5c01f65.tar.gz
BeetPlayer-8d0f7783a4db453ccb0ac5f05798f277f5c01f65.tar.bz2
BeetPlayer-8d0f7783a4db453ccb0ac5f05798f277f5c01f65.zip
Remove tool window
It was kinda useless, didn't work out, sorry, ToolWindow :)
Diffstat (limited to 'toolwindow.cpp')
-rw-r--r--toolwindow.cpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/toolwindow.cpp b/toolwindow.cpp
deleted file mode 100644
index 240017c..0000000
--- a/toolwindow.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <QLabel>
-#include <QTimer>
-#include <QHBoxLayout>
-#include <QDesktopWidget>
-#include <QApplication>
-#include <kwindowsystem.h>
-
-#include "toolwindow.h"
-
-ToolWindow::ToolWindow(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f){
- setWindowOpacity(0.8);
- KWindowSystem::setOnAllDesktops(winId(), true);
- KWindowSystem::setState(winId(), NET::KeepAbove | NET::SkipTaskbar | NET::SkipPager);
- mLabel = new QLabel;
- mLabel->setFrameStyle(QFrame::Panel | QFrame::Plain);
- mLabel->setFont(QFont("courier", 16, QFont::Bold));
- mLabel->setAlignment(Qt::AlignCenter);
- QHBoxLayout *mainLayout = new QHBoxLayout;
- mainLayout->addWidget(mLabel);
- mHideTimer = new QTimer(this);
- connect(mHideTimer, &QTimer::timeout, this, &QWidget::hide);
- setLayout(mainLayout);
-}
-
-void ToolWindow::setText(const QString &text){
- mLabel->setText(text);
-}
-
-void ToolWindow::toHTML(const QString &text){
- QString html;
- html.append(QString("<p style=\"margin:7px;\"><span style=\"font-weight: bold; font-size: large;\">%1</span></p>").arg(text));
- mLabel->setText(html);
-}
-
-void ToolWindow::showMe(){
- QDesktopWidget *dw = QApplication::desktop();
- QRect screenRect = dw->screenGeometry(QCursor::pos());
- QPoint screenCenter = screenRect.center();
- QPoint where(screenCenter.x() - width() / 2, 150);
- move(where);
- KWindowSystem::setOnDesktop(winId(), KWindowSystem::currentDesktop());
- mHideTimer->stop();
- mHideTimer->start(5000);
- show();
- raise();
-}