summaryrefslogtreecommitdiffstats
path: root/src/widget/wcuemenupopup.h
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2019-11-22 11:51:38 +0100
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2019-11-22 11:51:38 +0100
commitd26d6b4c057a520521e1aa4de426e72cfac791e8 (patch)
tree03e559bf5b3ae685eaef95fe7989896378f927e0 /src/widget/wcuemenupopup.h
parent036de53eae3c26e7115016b73a61acc988f3e18c (diff)
widget: Rename CueMenu widget to WCueMenuPopup
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;
+};