From ad8b0fd05cba6d32c5af6873c5f1ee18d9156acb Mon Sep 17 00:00:00 2001 From: Till Theato Date: Sat, 19 Feb 2011 23:02:03 +0000 Subject: [PATCH] Get rid of most of the place consuming tooltips. Most of their content is now visible in the statusbar. svn path=/trunk/kdenlive/; revision=5432 --- src/abstractclipitem.cpp | 1 - src/clipitem.cpp | 19 +------------------ src/customtrackview.cpp | 33 +++++++++++++++++++++++++-------- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/abstractclipitem.cpp b/src/abstractclipitem.cpp index 079a5812..8fb767be 100644 --- a/src/abstractclipitem.cpp +++ b/src/abstractclipitem.cpp @@ -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(); diff --git a/src/clipitem.cpp b/src/clipitem.cpp index f7e2b985..49fe48e4 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -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 = "" + m_clipName + ""; - if (!baseClip()->fileURL().isEmpty()) - tooltip.append("
" + baseClip()->fileURL().path()); - if (!baseClip()->description().isEmpty()) - tooltip.append("
" + baseClip()->description()); - setToolTip(tooltip); + return MOVE; } diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index ac35ec30..e52731ac 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -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 (item); + QString message; if (opMode == MOVE) { setCursor(Qt::OpenHandCursor); - if (item->type() == AVWIDGET) { - ClipItem *ci = static_cast (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(); -- 2.39.2