X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fdvdwizardmenu.h;h=8c4dd999ab2ea84c083a1cf9f1228aa4561837e7;hb=054ff5c40ed015661e7cea3eaf683239e5b0839a;hp=4e5100fb1453b8099f1875e9aa1c47fa9aa272b5;hpb=8601faf56e4773ac857820002055b1eee016e6f6;p=kdenlive diff --git a/src/dvdwizardmenu.h b/src/dvdwizardmenu.h index 4e5100fb..8c4dd999 100644 --- a/src/dvdwizardmenu.h +++ b/src/dvdwizardmenu.h @@ -29,14 +29,22 @@ #include #include +#include +#if KDE_IS_VERSION(4,7,0) +#include +#endif + +#include "dvdwizardvob.h" #include "ui_dvdwizardmenu_ui.h" class DvdScene : public QGraphicsScene { - +Q_OBJECT 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; @@ -51,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 @@ -93,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()); @@ -122,30 +150,38 @@ class DvdWizardMenu : public QWizardPage Q_OBJECT public: - explicit DvdWizardMenu(const QString &profile, QWidget * parent = 0); + explicit DvdWizardMenu(DVDFORMAT format, QWidget * parent = 0); virtual ~DvdWizardMenu(); virtual bool isComplete() const; bool createMenu() const; - void createBackgroundImage(const QString &img1); - void createButtonImages(const QString &img1, const QString &img2, const QString &img3); + 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(); + QMap buttonsInfo(bool letterbox = false); + bool loopMovie() const; bool menuMovie() const; QString menuMoviePath() const; - bool isPalMenu() const; - void changeProfile(bool isPal); + int menuMovieLength() const; + void changeProfile(DVDFORMAT format); QDomElement toXml() const; - void loadXml(QDomElement xml); + void loadXml(DVDFORMAT format, QDomElement xml); + void prepareUnderLines(); + void resetUnderLines(); private: Ui::DvdWizardMenu_UI m_view; - bool m_isPal; + DVDFORMAT m_format; DvdScene *m_scene; QGraphicsPixmapItem *m_background; QGraphicsRectItem *m_color; QGraphicsRectItem *m_safeRect; int m_width; int m_height; + QSize m_finalSize; + int m_movieLength; +#if KDE_IS_VERSION(4,7,0) + KMessageWidget *m_menuMessage; +#endif private slots: void buildButton(); @@ -160,9 +196,11 @@ private slots: void deleteButton(); void updateColor(); void updateColor(QColor c); + void updateUnderlineColor(QColor c); void setBackToMenu(bool backToMenu); void slotZoom(); void slotUnZoom(); + void slotEnableShadows(int enable); }; #endif