X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fdvdwizardmenu.h;h=8c4dd999ab2ea84c083a1cf9f1228aa4561837e7;hb=e9235a9040bdcbb522d9de879de641e7fddfb34e;hp=5c5794f09a9c07487f5845ad6dcffc0104f932d3;hpb=5eaf1ee0d7dd737ab4bd544e2c4f7467a2e0ea9a;p=kdenlive diff --git a/src/dvdwizardmenu.h b/src/dvdwizardmenu.h index 5c5794f0..8c4dd999 100644 --- a/src/dvdwizardmenu.h +++ b/src/dvdwizardmenu.h @@ -40,7 +40,7 @@ class DvdScene : public QGraphicsScene { - +Q_OBJECT public: DvdScene(QObject * parent = 0): QGraphicsScene(parent) { m_width = 0; m_height = 0; @@ -59,6 +59,26 @@ public: private: int m_width; int m_height; + +protected: + void mouseReleaseEvent( QGraphicsSceneMouseEvent * mouseEvent ) { + QGraphicsScene::mouseReleaseEvent(mouseEvent); + emit sceneChanged(); + } +signals: + void sceneChanged(); +}; + +class DvdButtonUnderline : public QGraphicsRectItem +{ + +public: + DvdButtonUnderline( const QRectF & rect, QGraphicsItem * parent = 0 ) : QGraphicsRectItem(rect, parent) {} + + int type() const { + // Enable the use of qgraphicsitem_cast with this item. + return UserType + 2; + } }; class DvdButton : public QGraphicsTextItem @@ -101,11 +121,11 @@ protected: virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) { if (change == ItemPositionChange && scene()) { - QPointF newPos = value.toPointF(); + QPoint newPos = value.toPoint(); QRectF sceneShape = sceneBoundingRect(); DvdScene *sc = static_cast < DvdScene * >(scene()); - newPos.setX(qMax(newPos.x(), (qreal)0)); - newPos.setY(qMax(newPos.y(), (qreal)0)); + newPos.setX(qMax(newPos.x(), 0)); + newPos.setY(qMax(newPos.y(), 0)); if (newPos.x() + sceneShape.width() > sc->width()) newPos.setX(sc->width() - sceneShape.width()); if (newPos.y() + sceneShape.height() > sc->height()) newPos.setY(sc->height() - sceneShape.height()); @@ -134,8 +154,8 @@ public: virtual ~DvdWizardMenu(); virtual bool isComplete() const; bool createMenu() const; - void createBackgroundImage(const QString &overlayMenu, const QString &img1); - void createButtonImages(const QString &img1, const QString &img2, const QString &img3, bool letterbox = false); + void createBackgroundImage(const QString &img1, bool letterbox); + void createButtonImages(const QString &selected_image, const QString &highlighted_image, bool letterbox); void setTargets(QStringList list, QStringList targetlist); QMap buttonsInfo(bool letterbox = false); bool loopMovie() const;