* hide a tooltip if a drag operation has been started
BUG: 173148
CCMAIL: simon@etotheipiplusone.com
svn path=/trunk/KDE/kdebase/apps/; revision=874641
void DolphinColumnWidget::startDrag(Qt::DropActions supportedActions)
{
void DolphinColumnWidget::startDrag(Qt::DropActions supportedActions)
{
- DragAndDropHelper::startDrag(this, supportedActions);
+ DragAndDropHelper::startDrag(this, supportedActions, m_view->m_controller);
}
void DolphinColumnWidget::dragEnterEvent(QDragEnterEvent* event)
}
void DolphinColumnWidget::dragEnterEvent(QDragEnterEvent* event)
+void DolphinController::emitHideToolTip()
+{
+ emit hideToolTip();
+}
+
KFileItem DolphinController::itemForIndex(const QModelIndex& index) const
{
Q_ASSERT(m_itemView != 0);
KFileItem DolphinController::itemForIndex(const QModelIndex& index) const
{
Q_ASSERT(m_itemView != 0);
* - emitItemEntered()
* - emitViewportEntered()
* - replaceUrlByClipboard()
* - emitItemEntered()
* - emitViewportEntered()
* - replaceUrlByClipboard()
*
* The communication of the abstract view to the view implementations is done by:
* - setUrl()
*
* The communication of the abstract view to the view implementations is done by:
* - setUrl()
* nothing will be done.
*/
void replaceUrlByClipboard();
* nothing will be done.
*/
void replaceUrlByClipboard();
+
+ /** Emits the signal hideToolTip(). */
+ void emitHideToolTip();
/**
* Returns the file item for the proxy index \a index of the view \a view.
/**
* Returns the file item for the proxy index \a index of the view \a view.
* must connect to this signal if it supports zooming.
*/
void zoomLevelChanged(int level);
* must connect to this signal if it supports zooming.
*/
void zoomLevelChanged(int level);
+
+ /**
+ * Is emitted if the abstract view should hide an open tooltip.
+ */
+ void hideToolTip();
private slots:
void updateOpenTabState();
private slots:
void updateOpenTabState();
void DolphinDetailsView::startDrag(Qt::DropActions supportedActions)
{
void DolphinDetailsView::startDrag(Qt::DropActions supportedActions)
{
- DragAndDropHelper::startDrag(this, supportedActions);
+ DragAndDropHelper::startDrag(this, supportedActions, m_controller);
m_showElasticBand = false;
}
m_showElasticBand = false;
}
// TODO: invoking KCategorizedView::startDrag() should not be necessary, we'll
// fix this in KDE 4.1
KCategorizedView::startDrag(supportedActions);
// TODO: invoking KCategorizedView::startDrag() should not be necessary, we'll
// fix this in KDE 4.1
KCategorizedView::startDrag(supportedActions);
- DragAndDropHelper::startDrag(this, supportedActions);
+ DragAndDropHelper::startDrag(this, supportedActions, m_controller);
}
void DolphinIconsView::dragEnterEvent(QDragEnterEvent* event)
}
void DolphinIconsView::dragEnterEvent(QDragEnterEvent* event)
if (DolphinSettings::instance().generalSettings()->showToolTips()) {
m_toolTipManager = new ToolTipManager(view, m_proxyModel);
if (DolphinSettings::instance().generalSettings()->showToolTips()) {
m_toolTipManager = new ToolTipManager(view, m_proxyModel);
+ connect(m_controller, SIGNAL(hideToolTip()),
+ m_toolTipManager, SLOT(hideTip()));
}
m_topLayout->insertWidget(1, view);
}
m_topLayout->insertWidget(1, view);
#include "draganddrophelper.h"
#include "dolphiniconsview.h"
#include "draganddrophelper.h"
#include "dolphiniconsview.h"
+#include "dolphincontroller.h"
#include <kdirmodel.h>
#include <kicon.h>
#include <kdirmodel.h>
#include <kicon.h>
#include <QAbstractProxyModel>
#include <QDrag>
#include <QAbstractProxyModel>
#include <QDrag>
-void DragAndDropHelper::startDrag(QAbstractItemView* itemView, Qt::DropActions supportedActions)
+void DragAndDropHelper::startDrag(QAbstractItemView* itemView,
+ Qt::DropActions supportedActions,
+ DolphinController* controller)
{
QModelIndexList indexes = itemView->selectionModel()->selectedIndexes();
if (indexes.count() > 0) {
{
QModelIndexList indexes = itemView->selectionModel()->selectedIndexes();
if (indexes.count() > 0) {
if (data == 0) {
return;
}
if (data == 0) {
return;
}
+
+ if (controller != 0) {
+ controller->emitHideToolTip();
+ }
QDrag* drag = new QDrag(itemView);
QPixmap pixmap;
QDrag* drag = new QDrag(itemView);
QPixmap pixmap;
+class DolphinController;
class QAbstractItemView;
class QBrush;
class QRect;
class QAbstractItemView;
class QBrush;
class QRect;
/**
* Creates a drag object for the view \a itemView for all selected items.
*/
/**
* Creates a drag object for the view \a itemView for all selected items.
*/
- static void startDrag(QAbstractItemView* itemView, Qt::DropActions supportedActions);
+ static void startDrag(QAbstractItemView* itemView,
+ Qt::DropActions supportedActions,
+ DolphinController* controller = 0);
void ToolTipManager::showToolTip(KToolTipItem* tip)
{
void ToolTipManager::showToolTip(KToolTipItem* tip)
{
+ if (QApplication::mouseButtons() & Qt::LeftButton) {
+ delete tip;
+ tip = 0;
+ return;
+ }
+
KStyleOptionToolTip option;
// TODO: get option content from KToolTip or add KToolTip::sizeHint() method
option.direction = QApplication::layoutDirection();
KStyleOptionToolTip option;
// TODO: get option content from KToolTip or add KToolTip::sizeHint() method
option.direction = QApplication::layoutDirection();
DolphinSortFilterProxyModel* model);
virtual ~ToolTipManager();
DolphinSortFilterProxyModel* model);
virtual ~ToolTipManager();
/**
* Hides the currently shown tooltip. Invoking this method is
* only needed when the tooltip should be hidden although
/**
* Hides the currently shown tooltip. Invoking this method is
* only needed when the tooltip should be hidden although