aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-pdf/PresentationLabel.h
blob: 198152298cef493f080ff76447208ab347ef6dc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//===========================================
//  Lumina Desktop source code
//  Copyright (c) 2017, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
// Simple subclass of QLabel to provide
// some overlay information as a presentation window
//===========================================
#ifndef _PRESENTATION_LABEL_WIDGET_H
#define _PRESENTATION_LABEL_WIDGET_H

#include <QDebug>
#include <QLabel>
#include <QMouseEvent>

class PresentationLabel : public QLabel {
  Q_OBJECT

signals:
  void nextSlide();

public:
  PresentationLabel()
      : QLabel(0, Qt::Window | Qt::FramelessWindowHint |
                      Qt::WindowStaysOnTopHint) {
    this->setContextMenuPolicy(Qt::CustomContextMenu);
  }

protected:
  void mousePressEvent(QMouseEvent *ev) {
    QLabel::mousePressEvent(ev);
    if (ev->button() == Qt::LeftButton) {
      emit nextSlide();
    }
  }
};

#endif
bgstack15