X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftitlewidget.h;h=a5892692e25a117ebe7e543bc913ffb3386b1532;hb=6cefbd3fbc436ec4cc3a44b38b738244a0037922;hp=ea2b025e8f560f1f5f8d0109b7d414e5cf83c5f9;hpb=d78291d1846407eefd3cc7746c9a39251cc22d49;p=kdenlive diff --git a/src/titlewidget.h b/src/titlewidget.h index ea2b025e..a5892692 100644 --- a/src/titlewidget.h +++ b/src/titlewidget.h @@ -100,7 +100,7 @@ public: /** @brief Returns clip out position. */ int outPoint() const; - /** @brief Loads title templates. */ + /** @brief Retrieves a list of all available title templates. */ static void refreshTitleTemplates(); protected: @@ -125,7 +125,7 @@ private: QGraphicsPixmapItem *m_frameImage; int m_frameWidth; int m_frameHeight; - Render *m_render; + Render *m_render; // TODO Is NOT destroyed in the destructor. Deliberately? int m_count; QAction *m_buttonRect; QAction *m_buttonText; @@ -139,6 +139,11 @@ private: QAction *m_zDown; QAction *m_zTop; QAction *m_zBottom; + QAction *m_selectAll; + QAction *m_selectText; + QAction *m_selectRects; + QAction *m_selectImages; + QAction *m_unselectAll; /** @brief Dialog for entering Unicode characters in text fields. */ UnicodeDialog *m_unicodeDialog; @@ -151,7 +156,7 @@ private: // See http://doc.trolltech.com/4.5/signalsandslots.html#advanced-signals-and-slots-usage. QSignalMapper *m_signalMapper; - enum ValueType { ValueWidth = 0, ValueHeight = 1 }; + enum ValueType { ValueWidth = 1, ValueHeight = 2, ValueX = 4, ValueY = 8 }; /** @brief Sets the font weight value in the combo box. (#909) */ void setFontBoxWeight(int weight); @@ -165,14 +170,16 @@ private: /** @brief Updates the displayed X/Y coordinates. */ void updateCoordinates(QGraphicsItem *i); - /** @brief Updates the displayed width/height values. */ + /** @brief Updates the displayed width/height/zindex values. */ void updateDimension(QGraphicsItem *i); - /** @brief Updates the displayed rotation/zoom values. */ + /** @brief Updates the displayed rotation/zoom values. Changes values of rotation/zoom GUI elements. */ void updateRotZoom(QGraphicsItem *i); - /** @brief Updates the item position. */ + /** @brief Updates the item position (position read directly from the GUI). Does not change GUI elements. */ void updatePosition(QGraphicsItem *i); + /** @brief Updates the item position. Does not change GUI elements. */ + void updatePosition(QGraphicsItem *i, int x, int y); void textChanged(QGraphicsTextItem *i); void updateAxisButtons(QGraphicsItem *i); @@ -185,6 +192,9 @@ private: /** @brief Shows the toolbars suiting to toolType. */ void showToolbars(TITLETOOL toolType); + + /** @brief Set up the tools suiting referenceItem */ + void prepareTools(QGraphicsItem *referenceItem); /** @brief Checks a tool button. */ void checkButton(TITLETOOL toolType); @@ -211,12 +221,17 @@ private: void itemRotate(qreal val, int axis); + void selectItems(int itemType); + + /** @brief Appends the shortcut of a QAction to a tooltip text */ + QString getTooltipWithShortcut(const QString& text, QAction *button); + public slots: void slotNewText(QGraphicsTextItem *tt); void slotNewRect(QGraphicsRectItem *rect); void slotChangeBackground(); - /** @brief Sets up the tools according to the selected item. */ + /** @brief Sets up the tools (toolbars etc.) according to the selected item. */ void selectionChanged(); void rectChanged(); void setupViewports(); @@ -225,14 +240,13 @@ public slots: void itemRotateX(qreal); void itemRotateY(qreal); void itemRotateZ(qreal); + /** Save a title to a title file */ void saveTitle(KUrl url = KUrl()); + /** Load a title from a title file */ void loadTitle(KUrl url = KUrl()); private slots: - /** @brief Updates position/size of the selected item when a value changes. */ - void slotAdjustSelectedItem(); - /** @brief Switches the origin of the X axis between left and right border. * * It's called when the origin of the X coordinate has been changed. The X @@ -274,7 +288,11 @@ private slots: * It's called when something changes in the QGraphicsScene. */ void slotChanged(); - /** @param valueType of type ValueType */ + /** + * Reacts to changes of widht/height/x/y QSpinBox values. + * @brief Updates width, height, and position of the selected items. + * @param valueType of type ValueType + */ void slotValueChanged(int valueType); void slotZoom(bool up); @@ -282,6 +300,14 @@ private slots: void slotAdjustZoom(); void slotZoomOneToOne(); + void slotSelectAll(); + void slotSelectText(); + void slotSelectRects(); + void slotSelectImages(); + void slotSelectNone(); + + + /** Called whenever text properties change (font e.g.) */ void slotUpdateText(); void slotInsertUnicode(); void slotInsertUnicodeString(QString); @@ -332,6 +358,7 @@ private slots: void slotZIndexDown(); void slotZIndexTop(); void slotZIndexBottom(); + /** Called when the user wants to apply a different template to the title */ void templateIndexChanged(int); };