summaryrefslogtreecommitdiffstats
path: root/src/widget/wcuemenupopup.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget/wcuemenupopup.h')
-rw-r--r--src/widget/wcuemenupopup.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/widget/wcuemenupopup.h b/src/widget/wcuemenupopup.h
new file mode 100644
index 0000000000..04be43e085
--- /dev/null
+++ b/src/widget/wcuemenupopup.h
@@ -0,0 +1,67 @@
+#pragma once
+
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+
+#include "track/cue.h"
+#include "track/track.h"
+#include "widget/wcolorpicker.h"
+
+class WCueMenuPopup : public QWidget {
+ Q_OBJECT
+ public:
+ WCueMenuPopup(QWidget* parent = nullptr);
+
+ ~WCueMenuPopup() {
+ delete m_pCueNumber;
+ delete m_pCuePosition;
+ delete m_pEditLabel;
+ delete m_pColorPicker;
+ delete m_pRemoveCue;
+ }
+
+ void setTrackAndCue(TrackPointer pTrack, CuePointer pCue);
+
+ void useColorSet(PredefinedColorsRepresentation* pColorRepresentation) {
+ if (m_pColorPicker != nullptr) {
+ m_pColorPicker->useColorSet(pColorRepresentation);
+ }
+ }
+
+ void popup(const QPoint& p, QAction* atAction = nullptr) {
+ Q_UNUSED(atAction);
+ qDebug() << "Showing menu at" << p;
+ move(p);
+ show();
+ }
+
+ void hide() {
+ emit(aboutToHide());
+ QWidget::hide();
+ }
+
+ void show() {
+ emit(aboutToShow());
+ QWidget::show();
+ }
+
+ signals:
+ void aboutToHide();
+ void aboutToShow();
+
+ private slots:
+ void slotEditLabel();
+ void slotRemoveCue();
+ void slotChangeCueColor(PredefinedColorPointer pColor);
+
+ private:
+ CuePointer m_pCue;
+ TrackPointer m_pTrack;
+
+ QLabel* m_pCueNumber;
+ QLabel* m_pCuePosition;
+ QLineEdit* m_pEditLabel;
+ WColorPicker* m_pColorPicker;
+ QPushButton* m_pRemoveCue;
+};