[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/apps/plasma/applets/folderview
From:       Fredrik Höglund <fredrik () kde ! org>
Date:       2010-01-19 19:29:37
Message-ID: 1263929377.082592.8296.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1077237 by fredrik:

Increase the delay between hovering an icon and showing the folder popup
to one second when the icon view doesn't have a popup open and it's been
longer than 1.5 seconds since the last popup was opened or closed.

CCBUG: 212882


 M  +6 -1      iconview.cpp  
 M  +4 -0      popupview.cpp  
 M  +4 -0      popupview.h  


--- trunk/KDE/kdebase/apps/plasma/applets/folderview/iconview.cpp #1077236:1077237
@@ -1489,8 +1489,13 @@
 void IconView::triggerToolTip(ToolTipType type)
 {
     if (type == FolderTip && m_hoveredIndex.isValid()) {
-        if (!m_popupView || m_hoveredIndex != m_popupIndex) {
+        // Use a longer delay if we don't have any popup view open or if it's been
+        // longer than 1.5 seconds since the last popup view was opened or closed.
+        if ((m_popupView && m_hoveredIndex != m_popupIndex) ||
+            PopupView::lastOpenCloseTime().elapsed() < 1500) {
             m_toolTipShowTimer.start(500, this);
+        } else {
+            m_toolTipShowTimer.start(1000, this);
         }
     } else {
         // Close the popup view if one is open
--- trunk/KDE/kdebase/apps/plasma/applets/folderview/popupview.cpp #1077236:1077237
@@ -64,6 +64,8 @@
 #endif
 
 
+QTime PopupView::s_lastOpenClose;
+
 PopupView::PopupView(const KUrl &url, const QPoint &pos,
                      const bool &showPreview, const QStringList &previewPlugins,
                      const IconView *parentView)
@@ -135,11 +137,13 @@
     show();
 
     QTimer::singleShot(10, this, SLOT(init()));
+    s_lastOpenClose.restart();
 }
 
 PopupView::~PopupView()
 {
     delete m_newMenu;
+    s_lastOpenClose.restart();
 }
 
 void PopupView::delayedHide()
--- trunk/KDE/kdebase/apps/plasma/applets/folderview/popupview.h #1077236:1077237
@@ -22,6 +22,7 @@
 
 #include <QBasicTimer>
 #include <QWidget>
+#include <QTime>
 
 #include <KActionCollection>
 #include <KUrl>
@@ -59,6 +60,8 @@
     void delayedHide();
     bool dragInProgress();
 
+    static QTime lastOpenCloseTime() { return s_lastOpenClose; }
+
 protected:
     void paintEvent(QPaintEvent *event);
     void contextMenuEvent(QContextMenuEvent *event);
@@ -118,6 +121,7 @@
     bool m_showingMenu;
     bool m_showPreview;
     QStringList m_previewPlugins;
+    static QTime s_lastOpenClose;
 };
 
 #endif
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic