]> git.sesse.net Git - kdenlive/commitdiff
r6479@lapL: simon | 2010-06-02 20:38:08 +0200
authorSimon A. Eugster <simon.eu@gmail.com>
Wed, 2 Jun 2010 18:39:14 +0000 (18:39 +0000)
committerSimon A. Eugster <simon.eu@gmail.com>
Wed, 2 Jun 2010 18:39:14 +0000 (18:39 +0000)
 http://www.kdenlive.org/mantis/view.php?id=1610
 * Icons for selecting (all, images, rects, texts) added
 * Shortcuts on buttons now appended in *bold font*

svn path=/trunk/kdenlive/; revision=4494

24 files changed:
icons/cp-oxicons-hisc.sh
icons/hi16-action-kdenlive-select-all.png [new file with mode: 0644]
icons/hi16-action-kdenlive-select-images.png [new file with mode: 0644]
icons/hi16-action-kdenlive-select-rects.png [new file with mode: 0644]
icons/hi16-action-kdenlive-select-texts.png [new file with mode: 0644]
icons/hi16-action-kdenlive-unselect-all.png [new file with mode: 0644]
icons/hisc-action-kdenlive-insert-rect.svgz [new file with mode: 0644]
icons/hisc-action-kdenlive-select-all.svgz [new file with mode: 0644]
icons/hisc-action-kdenlive-select-rects.svgz [new file with mode: 0644]
icons/hisc-action-kdenlive-select-texts.svgz [new file with mode: 0644]
icons/hisc-action-kdenlive-unselect-all.svgz [new file with mode: 0644]
icons/ox16-action-kdenlive-select-all.png [new file with mode: 0644]
icons/ox16-action-kdenlive-select-images.png [new file with mode: 0644]
icons/ox16-action-kdenlive-select-rects.png [new file with mode: 0644]
icons/ox16-action-kdenlive-select-texts.png [new file with mode: 0644]
icons/ox16-action-kdenlive-unselect-all.png [new file with mode: 0644]
icons/oxsc-action-kdenlive-insert-rect.svgz [new file with mode: 0644]
icons/oxsc-action-kdenlive-select-all.svgz [new file with mode: 0644]
icons/oxsc-action-kdenlive-select-images.svgz [new file with mode: 0644]
icons/oxsc-action-kdenlive-select-rects.svgz [new file with mode: 0644]
icons/oxsc-action-kdenlive-select-texts.svgz [new file with mode: 0644]
icons/oxsc-action-kdenlive-unselect-all.svgz [new file with mode: 0644]
src/titlewidget.cpp
src/titlewidget.h

index 74662ea0f18954fb7b05cddae7c9d6c0148d234c..187912845537e06620aa4ad28f2d5ca490f0dd37 100755 (executable)
@@ -11,3 +11,13 @@ cp ox16-action-kdenlive-object-width.png hi16-action-kdenlive-object-width.png
 cp oxsc-action-kdenlive-object-width.svgz hisc-action-kdenlive-object-width.svgz
 cp ox16-action-kdenlive-object-height.png hi16-action-kdenlive-object-height.png
 cp oxsc-action-kdenlive-object-height.svgz hisc-action-kdenlive-object-height.svgz
+cp oxsc-action-kdenlive-insert-rect.svgz hisc-action-kdenlive-insert-rect.svgz
+cp oxsc-action-kdenlive-select-rects.svgz hisc-action-kdenlive-select-rects.svgz
+cp ox16-action-kdenlive-select-rects.png hi16-action-kdenlive-select-rects.png
+cp oxsc-action-kdenlive-select-texts.svgz hisc-action-kdenlive-select-texts.svgz
+cp oxsc-action-kdenlive-unselect-all.svgz hisc-action-kdenlive-unselect-all.svgz
+cp oxsc-action-kdenlive-select-all.svgz hisc-action-kdenlive-select-all.svgz
+cp ox16-action-kdenlive-unselect-all.png hi16-action-kdenlive-unselect-all.png
+cp ox16-action-kdenlive-select-texts.png hi16-action-kdenlive-select-texts.png
+cp ox16-action-kdenlive-select-images.png hi16-action-kdenlive-select-images.png
+cp ox16-action-kdenlive-select-all.png hi16-action-kdenlive-select-all.png
\ No newline at end of file
diff --git a/icons/hi16-action-kdenlive-select-all.png b/icons/hi16-action-kdenlive-select-all.png
new file mode 100644 (file)
index 0000000..4194fc7
Binary files /dev/null and b/icons/hi16-action-kdenlive-select-all.png differ
diff --git a/icons/hi16-action-kdenlive-select-images.png b/icons/hi16-action-kdenlive-select-images.png
new file mode 100644 (file)
index 0000000..67c1a2f
Binary files /dev/null and b/icons/hi16-action-kdenlive-select-images.png differ
diff --git a/icons/hi16-action-kdenlive-select-rects.png b/icons/hi16-action-kdenlive-select-rects.png
new file mode 100644 (file)
index 0000000..5948f50
Binary files /dev/null and b/icons/hi16-action-kdenlive-select-rects.png differ
diff --git a/icons/hi16-action-kdenlive-select-texts.png b/icons/hi16-action-kdenlive-select-texts.png
new file mode 100644 (file)
index 0000000..de00cb9
Binary files /dev/null and b/icons/hi16-action-kdenlive-select-texts.png differ
diff --git a/icons/hi16-action-kdenlive-unselect-all.png b/icons/hi16-action-kdenlive-unselect-all.png
new file mode 100644 (file)
index 0000000..fd8544e
Binary files /dev/null and b/icons/hi16-action-kdenlive-unselect-all.png differ
diff --git a/icons/hisc-action-kdenlive-insert-rect.svgz b/icons/hisc-action-kdenlive-insert-rect.svgz
new file mode 100644 (file)
index 0000000..0e4e8db
Binary files /dev/null and b/icons/hisc-action-kdenlive-insert-rect.svgz differ
diff --git a/icons/hisc-action-kdenlive-select-all.svgz b/icons/hisc-action-kdenlive-select-all.svgz
new file mode 100644 (file)
index 0000000..bb63136
Binary files /dev/null and b/icons/hisc-action-kdenlive-select-all.svgz differ
diff --git a/icons/hisc-action-kdenlive-select-rects.svgz b/icons/hisc-action-kdenlive-select-rects.svgz
new file mode 100644 (file)
index 0000000..32db6fe
Binary files /dev/null and b/icons/hisc-action-kdenlive-select-rects.svgz differ
diff --git a/icons/hisc-action-kdenlive-select-texts.svgz b/icons/hisc-action-kdenlive-select-texts.svgz
new file mode 100644 (file)
index 0000000..8e39fdf
Binary files /dev/null and b/icons/hisc-action-kdenlive-select-texts.svgz differ
diff --git a/icons/hisc-action-kdenlive-unselect-all.svgz b/icons/hisc-action-kdenlive-unselect-all.svgz
new file mode 100644 (file)
index 0000000..ba883d4
Binary files /dev/null and b/icons/hisc-action-kdenlive-unselect-all.svgz differ
diff --git a/icons/ox16-action-kdenlive-select-all.png b/icons/ox16-action-kdenlive-select-all.png
new file mode 100644 (file)
index 0000000..4194fc7
Binary files /dev/null and b/icons/ox16-action-kdenlive-select-all.png differ
diff --git a/icons/ox16-action-kdenlive-select-images.png b/icons/ox16-action-kdenlive-select-images.png
new file mode 100644 (file)
index 0000000..67c1a2f
Binary files /dev/null and b/icons/ox16-action-kdenlive-select-images.png differ
diff --git a/icons/ox16-action-kdenlive-select-rects.png b/icons/ox16-action-kdenlive-select-rects.png
new file mode 100644 (file)
index 0000000..5948f50
Binary files /dev/null and b/icons/ox16-action-kdenlive-select-rects.png differ
diff --git a/icons/ox16-action-kdenlive-select-texts.png b/icons/ox16-action-kdenlive-select-texts.png
new file mode 100644 (file)
index 0000000..de00cb9
Binary files /dev/null and b/icons/ox16-action-kdenlive-select-texts.png differ
diff --git a/icons/ox16-action-kdenlive-unselect-all.png b/icons/ox16-action-kdenlive-unselect-all.png
new file mode 100644 (file)
index 0000000..fd8544e
Binary files /dev/null and b/icons/ox16-action-kdenlive-unselect-all.png differ
diff --git a/icons/oxsc-action-kdenlive-insert-rect.svgz b/icons/oxsc-action-kdenlive-insert-rect.svgz
new file mode 100644 (file)
index 0000000..0e4e8db
Binary files /dev/null and b/icons/oxsc-action-kdenlive-insert-rect.svgz differ
diff --git a/icons/oxsc-action-kdenlive-select-all.svgz b/icons/oxsc-action-kdenlive-select-all.svgz
new file mode 100644 (file)
index 0000000..bb63136
Binary files /dev/null and b/icons/oxsc-action-kdenlive-select-all.svgz differ
diff --git a/icons/oxsc-action-kdenlive-select-images.svgz b/icons/oxsc-action-kdenlive-select-images.svgz
new file mode 100644 (file)
index 0000000..b4491b7
Binary files /dev/null and b/icons/oxsc-action-kdenlive-select-images.svgz differ
diff --git a/icons/oxsc-action-kdenlive-select-rects.svgz b/icons/oxsc-action-kdenlive-select-rects.svgz
new file mode 100644 (file)
index 0000000..32db6fe
Binary files /dev/null and b/icons/oxsc-action-kdenlive-select-rects.svgz differ
diff --git a/icons/oxsc-action-kdenlive-select-texts.svgz b/icons/oxsc-action-kdenlive-select-texts.svgz
new file mode 100644 (file)
index 0000000..8e39fdf
Binary files /dev/null and b/icons/oxsc-action-kdenlive-select-texts.svgz differ
diff --git a/icons/oxsc-action-kdenlive-unselect-all.svgz b/icons/oxsc-action-kdenlive-unselect-all.svgz
new file mode 100644 (file)
index 0000000..ba883d4
Binary files /dev/null and b/icons/oxsc-action-kdenlive-unselect-all.svgz differ
index d2b831b6d5845700b15eb1a9cadfe8a4de3b4c73..d7db11fa25b8cd28cc12d8af96bdcb27dd7f730d 100644 (file)
@@ -259,7 +259,7 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render
 
     m_unicodeAction = new QAction(KIcon("kdenlive-insert-unicode"), QString(), this);
     m_unicodeAction->setShortcut(Qt::SHIFT + Qt::CTRL + Qt::Key_U);
-    m_unicodeAction->setToolTip(i18n("Insert Unicode character") + ' ' + m_unicodeAction->shortcut().toString());
+    m_unicodeAction->setToolTip(getTooltipWithShortcut(i18n("Insert Unicode character"), m_unicodeAction));
     connect(m_unicodeAction, SIGNAL(triggered()), this, SLOT(slotInsertUnicode()));
     buttonInsertUnicode->setDefaultAction(m_unicodeAction);
 
@@ -289,31 +289,35 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render
     m_zBottom->setToolTip(i18n("Lower object to bottom"));
     connect(m_zBottom, SIGNAL(triggered()), this, SLOT(slotZIndexBottom()));
     zBottom->setDefaultAction(m_zBottom);
-    
-    m_selectAll = new QAction(KIcon("kdenlive-zindex-bottom"), QString(), this);
+
+    m_selectAll = new QAction(KIcon("kdenlive-select-all"), QString(), this);
     m_selectAll->setShortcut(Qt::CTRL + Qt::Key_A);
     connect(m_selectAll, SIGNAL(triggered()), this, SLOT(slotSelectAll()));
     buttonSelectAll->setDefaultAction(m_selectAll);
-    
-    m_selectText = new QAction(KIcon("kdenlive-zindex-bottom"), QString(), this);
+
+    m_selectText = new QAction(KIcon("kdenlive-select-texts"), QString(), this);
     m_selectText->setShortcut(Qt::CTRL + Qt::Key_T);
     connect(m_selectText, SIGNAL(triggered()), this, SLOT(slotSelectText()));
     buttonSelectText->setDefaultAction(m_selectText);
-    
-    m_selectRects = new QAction(KIcon("kdenlive-zindex-bottom"), QString(), this);
+    buttonSelectText->setEnabled(false);
+
+    m_selectRects = new QAction(KIcon("kdenlive-select-rects"), QString(), this);
     m_selectRects->setShortcut(Qt::CTRL + Qt::Key_R);
     connect(m_selectRects, SIGNAL(triggered()), this, SLOT(slotSelectRects()));
     buttonSelectRects->setDefaultAction(m_selectRects);
-    
-    m_selectImages = new QAction(KIcon("kdenlive-zindex-bottom"), QString(), this);
+    buttonSelectRects->setEnabled(false);
+
+    m_selectImages = new QAction(KIcon("kdenlive-select-images"), QString(), this);
     m_selectImages->setShortcut(Qt::CTRL + Qt::Key_I);
     connect(m_selectImages, SIGNAL(triggered()), this, SLOT(slotSelectImages()));
     buttonSelectImages->setDefaultAction(m_selectImages);
-    
-    m_unselectAll = new QAction(KIcon("kdenlive-zindex-bottom"), QString(), this);
+    buttonSelectImages->setEnabled(false);
+
+    m_unselectAll = new QAction(KIcon("kdenlive-unselect-all"), QString(), this);
     m_unselectAll->setShortcut(Qt::SHIFT + Qt::CTRL + Qt::Key_A);
     connect(m_unselectAll, SIGNAL(triggered()), this, SLOT(slotSelectNone()));
     buttonUnselectAll->setDefaultAction(m_unselectAll);
+    buttonUnselectAll->setEnabled(false);
 
     zDown->setIcon(KIcon("kdenlive-zindex-down"));
     zTop->setIcon(KIcon("kdenlive-zindex-top"));
@@ -333,11 +337,11 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render
     buttonFitZoom->setToolTip(i18n("Fit zoom"));
     backgroundColor->setToolTip(i18n("Select background color"));
     backgroundAlpha->setToolTip(i18n("Background opacity"));
-    buttonSelectAll->setToolTip(i18n("Select all"));
-    buttonSelectText->setToolTip(i18n("Select text items in current selection"));
-    buttonSelectRects->setToolTip(i18n("Select rect items in current selection"));
-    buttonSelectImages->setToolTip(i18n("Select image items in current selection"));
-    buttonUnselectAll->setToolTip(i18n("Unselect all"));
+    buttonSelectAll->setToolTip(getTooltipWithShortcut(i18n("Select all"), m_selectAll));
+    buttonSelectText->setToolTip(getTooltipWithShortcut(i18n("Select text items in current selection"), m_selectText));
+    buttonSelectRects->setToolTip(getTooltipWithShortcut(i18n("Select rect items in current selection"), m_selectRects));
+    buttonSelectImages->setToolTip(getTooltipWithShortcut(i18n("Select image items in current selection"), m_selectImages));
+    buttonUnselectAll->setToolTip(getTooltipWithShortcut(i18n("Unselect all"), m_unselectAll));
 
     itemhcenter->setIcon(KIcon("kdenlive-align-hor"));
     itemhcenter->setToolTip(i18n("Align item horizontally"));
@@ -914,13 +918,13 @@ void TitleWidget::selectionChanged()
     }
 
     l = graphicsView->scene()->selectedItems();
-    
-    if (l.size() > 0) {
+
+    if(l.size() > 0) {
         buttonUnselectAll->setEnabled(true);
     } else {
         buttonUnselectAll->setEnabled(false);
     }
-    if (l.size() >= 2) {
+    if(l.size() >= 2) {
         buttonSelectText->setEnabled(true);
         buttonSelectRects->setEnabled(true);
         buttonSelectImages->setEnabled(true);
@@ -929,8 +933,8 @@ void TitleWidget::selectionChanged()
         buttonSelectRects->setEnabled(false);
         buttonSelectImages->setEnabled(false);
     }
-    
-    
+
+
     //toolBox->setItemEnabled(2, false);
     //toolBox->setItemEnabled(3, false);
     effect_list->blockSignals(true);
@@ -2410,7 +2414,7 @@ void TitleWidget::slotSelectAll()
 {
     graphicsView->blockSignals(true);
     QList<QGraphicsItem*> l = graphicsView->scene()->items();
-    for (int i = 0; i < l.size(); i++) {
+    for(int i = 0; i < l.size(); i++) {
         l.at(i)->setSelected(true);
     }
     graphicsView->blockSignals(false);
@@ -2422,17 +2426,17 @@ void TitleWidget::selectItems(int itemType)
 {
     graphicsView->blockSignals(true);
     QList<QGraphicsItem*> l;
-    if (graphicsView->scene()->selectedItems().size() > 0) {
+    if(graphicsView->scene()->selectedItems().size() > 0) {
         l = graphicsView->scene()->selectedItems();
-        for (int i = 0; i < l.size(); i++) {
-            if (l.at(i)->type() != itemType) {
+        for(int i = 0; i < l.size(); i++) {
+            if(l.at(i)->type() != itemType) {
                 l.at(i)->setSelected(false);
             }
         }
     } else {
         l = graphicsView->scene()->items();
-        for (int i = 0; i < l.size(); i++) {
-            if (l.at(i)->type() == itemType) {
+        for(int i = 0; i < l.size(); i++) {
+            if(l.at(i)->type() == itemType) {
                 l.at(i)->setSelected(true);
             }
         }
@@ -2460,9 +2464,14 @@ void TitleWidget::slotSelectNone()
 {
     graphicsView->blockSignals(true);
     QList<QGraphicsItem*> l = graphicsView->scene()->items();
-    for (int i = 0; i < l.size(); i++) {
+    for(int i = 0; i < l.size(); i++) {
         l.at(i)->setSelected(false);
     }
     graphicsView->blockSignals(false);
     selectionChanged();
-}
\ No newline at end of file
+}
+
+QString TitleWidget::getTooltipWithShortcut(const QString text, QAction *button)
+{
+    return text + "  <b>" + button->shortcut().toString() + "</b>";
+}
index 54a5ff2426a7bfea3d126c167bdd93a3d882f94b..655f5625ea6ae1184b043244534b2798701640d5 100644 (file)
@@ -215,9 +215,12 @@ private:
     qreal zIndexBounds(bool maxBound, bool intersectingOnly);
 
     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);
@@ -290,13 +293,13 @@ private slots:
     void slotUpdateZoom(int pos);
     void slotAdjustZoom();
     void slotZoomOneToOne();
-    
+
     void slotSelectAll();
     void slotSelectText();
     void slotSelectRects();
     void slotSelectImages();
     void slotSelectNone();
-    
+
 
     /** Called whenever text properties change (font e.g.) */
     void slotUpdateText();