]> git.sesse.net Git - kdenlive/commitdiff
Get rid of most of the place consuming tooltips. Most of their content is now visible...
authorTill Theato <root@ttill.de>
Sat, 19 Feb 2011 23:02:03 +0000 (23:02 +0000)
committerTill Theato <root@ttill.de>
Sat, 19 Feb 2011 23:02:03 +0000 (23:02 +0000)
svn path=/trunk/kdenlive/; revision=5432

src/abstractclipitem.cpp
src/clipitem.cpp
src/customtrackview.cpp

index 079a58128d38d9b7435691f54ed82d89112ada05..8fb767be27c83b8fa7548537e5776f389a10c172 100644 (file)
@@ -130,7 +130,6 @@ void AbstractClipItem::resizeStart(int posx, bool hasSizeLimit)
 {
     GenTime durationDiff = GenTime(posx, m_fps) - m_info.startPos;
     if (durationDiff == GenTime()) return;
-    //kDebug() << "-- RESCALE DIFF=" << durationDiff.frames(25) << ", CLIP: " << startPos().frames(25) << "-" << endPos().frames(25);
 
     if (type() == AVWIDGET && hasSizeLimit && (cropStart() + durationDiff < GenTime())) {
         durationDiff = GenTime() - cropStart();
index f7e2b985b46b53aa378d1cea967e2553bd58c9e1..49fe48e4eac8ced663ec6391fdb62659e839db8d 100644 (file)
@@ -946,36 +946,19 @@ OPERATIONTYPE ClipItem::operationMode(QPointF pos)
     if (rect.height() < 30) addtransitionOffset = 0;
 
     if (qAbs((int)(pos.x() - (rect.x() + m_startFade))) < maximumOffset  && qAbs((int)(pos.y() - rect.y())) < 6) {
-        if (m_startFade == 0) setToolTip(i18n("Add audio fade"));
-        // xgettext:no-c-format
-        else setToolTip(i18n("Audio fade duration: %1s", GenTime(m_startFade, m_fps).seconds()));
         return FADEIN;
     } else if (pos.x() - rect.x() < maximumOffset && (rect.bottom() - pos.y() > addtransitionOffset)) {
-        // xgettext:no-c-format
-        setToolTip(i18n("Crop from start: %1s", cropStart().seconds()));
         return RESIZESTART;
     } else if (qAbs((int)(pos.x() - (rect.x() + rect.width() - m_endFade))) < maximumOffset && qAbs((int)(pos.y() - rect.y())) < 6) {
-        if (m_endFade == 0) setToolTip(i18n("Add audio fade"));
-        // xgettext:no-c-format
-        else setToolTip(i18n("Audio fade duration: %1s", GenTime(m_endFade, m_fps).seconds()));
         return FADEOUT;
     } else if ((rect.right() - pos.x() < maximumOffset) && (rect.bottom() - pos.y() > addtransitionOffset)) {
-        // xgettext:no-c-format
-        setToolTip(i18n("Clip duration: %1s", cropDuration().seconds()));
         return RESIZEEND;
     } else if ((pos.x() - rect.x() < 16 / scale) && (rect.bottom() - pos.y() <= addtransitionOffset)) {
-        setToolTip(i18n("Add transition"));
         return TRANSITIONSTART;
     } else if ((rect.right() - pos.x() < 16 / scale) && (rect.bottom() - pos.y() <= addtransitionOffset)) {
-        setToolTip(i18n("Add transition"));
         return TRANSITIONEND;
     }
-    QString tooltip = "<b>" + m_clipName + "</b>";
-    if (!baseClip()->fileURL().isEmpty())
-        tooltip.append("<br />" + baseClip()->fileURL().path());
-    if (!baseClip()->description().isEmpty())
-        tooltip.append("<br />" + baseClip()->description());
-    setToolTip(tooltip);
+
     return MOVE;
 }
 
index ac35ec30e2c694dcd28e85c50c74baa4e081795e..e52731ac632a19837466183596fa63b37f056836 100644 (file)
@@ -595,11 +595,14 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
         }
         m_moveOpMode = opMode;
         setTipAnimation(clip, opMode, size);
+        ClipItem *ci;
+        if (item->type() == AVWIDGET)
+            ci = static_cast <ClipItem *>(item);
+        QString message;
         if (opMode == MOVE) {
             setCursor(Qt::OpenHandCursor);
-            if (item->type() == AVWIDGET) {
-                ClipItem *ci = static_cast <ClipItem *>(item);
-                QString message = ci->clipName() + i18n(":");
+            if (ci) {
+                message = ci->clipName() + i18n(":");
                 message.append(i18n(" Position:") + m_document->timecode().getDisplayTimecode(ci->info().startPos, KdenliveSettings::frametimecode()));
                 message.append(i18n(" Duration:") + m_document->timecode().getDisplayTimecode(ci->cropDuration(),  KdenliveSettings::frametimecode()));
                 if (clip->parentItem() && clip->parentItem()->type() == GROUPWIDGET) {
@@ -614,26 +617,40 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
                         message.append(i18n(" Selection duration:") + m_document->timecode().getDisplayTimecode(parent2->duration(), KdenliveSettings::frametimecode()));
                     }
                 }
-                emit displayMessage(message, InformationMessage);
             }
         } else if (opMode == RESIZESTART) {
             setCursor(KCursor("left_side", Qt::SizeHorCursor));
+            if (ci)
+                message = i18n("Crop from start: ") + m_document->timecode().getDisplayTimecode(ci->cropStart(), KdenliveSettings::frametimecode());
             if (item->type() == AVWIDGET && item->parentItem() && item->parentItem() != m_selectionGroup)
-                emit displayMessage(i18n("Use Ctrl to resize only current item, otherwise all items in this group will be resized at once."), InformationMessage);
+                message.append(i18n("Use Ctrl to resize only current item, otherwise all items in this group will be resized at once."));
         } else if (opMode == RESIZEEND) {
             setCursor(KCursor("right_side", Qt::SizeHorCursor));
+            if (ci)
+                message = i18n("Duration: ") + m_document->timecode().getDisplayTimecode(ci->cropDuration(), KdenliveSettings::frametimecode());
             if (item->type() == AVWIDGET && item->parentItem() && item->parentItem() != m_selectionGroup)
-                emit displayMessage(i18n("Use Ctrl to resize only current item, otherwise all items in this group will be resized at once."), InformationMessage);
+                message.append(i18n("Use Ctrl to resize only current item, otherwise all items in this group will be resized at once."));
         } else if (opMode == FADEIN || opMode == FADEOUT) {
             setCursor(Qt::PointingHandCursor);
-            emit displayMessage(i18n("Drag to add or resize a fade effect."), InformationMessage);
+            if (ci && opMode == FADEIN && ci->fadeIn()) {
+                message = i18n("Fade in duration: ");
+                message.append(m_document->timecode().getDisplayTimecodeFromFrames(ci->fadeIn(), KdenliveSettings::frametimecode()));
+            } else if (ci && opMode == FADEOUT && ci->fadeOut()) {
+                message = i18n("Fade out duration: ");
+                message.append(m_document->timecode().getDisplayTimecodeFromFrames(ci->fadeOut(), KdenliveSettings::frametimecode()));
+            } else {
+                message = i18n("Drag to add or resize a fade effect.");
+            }
         } else if (opMode == TRANSITIONSTART || opMode == TRANSITIONEND) {
             setCursor(Qt::PointingHandCursor);
-            emit displayMessage(i18n("Click to add a transition."), InformationMessage);
+            message = i18n("Click to add a transition.");
         } else if (opMode == KEYFRAME) {
             setCursor(Qt::PointingHandCursor);
             emit displayMessage(i18n("Move keyframe above or below clip to remove it, double click to add a new one."), InformationMessage);
         }
+
+        if (!message.isEmpty())
+            emit displayMessage(message, InformationMessage);
     } // no clip under mouse
     else if (m_tool == RAZORTOOL) {
         event->accept();