]> git.sesse.net Git - kdenlive/blobdiff - src/dvdwizardmenu.h
Several small adjustments for monitor switching
[kdenlive] / src / dvdwizardmenu.h
index 6374d2c3549f58a516a84c6c45af30392f28d196..8c9931ec621cfd7acdae5f888502d060d244d1e2 100644 (file)
@@ -36,7 +36,9 @@ class DvdScene : public QGraphicsScene
 {
 
 public:
-    DvdScene(QObject * parent = 0): QGraphicsScene(parent) {}
+    DvdScene(QObject * parent = 0): QGraphicsScene(parent) {
+        m_width = 0; m_height = 0;
+    }
     void setProfile(int width, int height) {
         m_width = width;
         m_height = height;
@@ -57,8 +59,12 @@ class DvdButton : public QGraphicsTextItem
 {
 
 public:
-    DvdButton(const QString & text): QGraphicsTextItem(text), m_target(0), m_command(QString("jump title 1")), m_backToMenu(false) {}
-    enum { Type = UserType + 1 };
+    DvdButton(const QString & text): QGraphicsTextItem(text), m_target(0), m_command(QString("jump title 1")), m_backToMenu(false) {
+        setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
+#if QT_VERSION >= 0x040600
+        setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
+#endif
+    }
     void setTarget(int t, QString c) {
         m_target = t;
         m_command = c;
@@ -74,7 +80,7 @@ public:
     }
     int type() const {
         // Enable the use of qgraphicsitem_cast with this item.
-        return Type;
+        return UserType + 1;
     }
     void setBackMenu(bool back) {
         m_backToMenu = back;
@@ -89,7 +95,6 @@ protected:
 
     virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) {
         if (change == ItemPositionChange && scene()) {
-
             QPointF newPos = value.toPointF();
             QRectF sceneShape = sceneBoundingRect();
             DvdScene *sc = static_cast < DvdScene * >(scene());
@@ -127,6 +132,7 @@ public:
     void createButtonImages(const QString &img1, const QString &img2, const QString &img3);
     void setTargets(QStringList list, QStringList targetlist);
     QMap <QString, QRect> buttonsInfo();
+    bool loopMovie() const;
     bool menuMovie() const;
     QString menuMoviePath() const;
     bool isPalMenu() const;