Swiftray  1.0
layer-list-item.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QWidget>
4 #include <QMenu>
5 #include <layer.h>
6 
7 namespace Ui {
8  class LayerListItem;
9 }
10 
11 class LayerListItem : public QWidget {
12 Q_OBJECT
13 
14 public:
15  // explicit LayerListItem(QWidget *parent = nullptr);
16  LayerListItem(QWidget *parent, Canvas *canvas, LayerPtr &layer, bool active);
17 
18  void paintEvent(QPaintEvent *event) override;
19 
21 
23 
24  void mouseDoubleClickEvent(QMouseEvent *event) override;
25 
26 private:
27  void createIcon();
28 
29  void loadStyles();
30 
31  void registerEvents();
32 
33  void setContextMenu();
34 
35  void showPopMenu(const QPoint& );
36 
37  void onLockLayer();
38 
39  void onUnlockLayer();
40 
41  Canvas *canvas_;
42  QMenu *popMenu_;
43  QAction *lockLayerAction_;
44  QAction *unlockLayerAction_;
45 
46  Ui::LayerListItem *ui;
47  bool active_;
48 };
Definition: canvas.h:27
Definition: layer-list-item.h:11
LayerListItem(QWidget *parent, Canvas *canvas, LayerPtr &layer, bool active)
Definition: layer-list-item.cpp:11
~LayerListItem()
Definition: layer-list-item.cpp:31
void paintEvent(QPaintEvent *event) override
Definition: layer-list-item.cpp:108
LayerPtr layer_
Definition: layer-list-item.h:22
void mouseDoubleClickEvent(QMouseEvent *event) override
Definition: layer-list-item.cpp:84
shared_ptr< Layer > LayerPtr
Definition: layer.h:127
Definition: layer-list-item.h:7