[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/apps/plasma/applets/folderview
From: Aaron J. Seigo <aseigo () kde ! org>
Date: 2010-04-13 17:53:35
Message-ID: 20100413175335.9BAC2AC897 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1114478 by aseigo:
delay showing the busy widget; less visual noise on local browsing
M +11 -3 popupview.cpp
M +2 -0 popupview.h
--- trunk/KDE/kdebase/apps/plasma/applets/folderview/popupview.cpp #1114477:1114478
@@ -435,14 +435,22 @@
void PopupView::setBusy(bool busy)
{
+ m_busy = busy;
if (busy && !m_busyWidget) {
+ QTimer::singleShot(100, this, SLOT(createBusyWidgetIfNeeded()));
+ } else {
+ delete m_busyWidget;
+ m_busyWidget = 0;
+ }
+}
+
+void PopupView::createBusyWidgetIfNeeded()
+{
+ if (m_busy && !m_busyWidget) {
const int size = qMin(width(), height()) * .3;
m_busyWidget = new Plasma::BusyWidget;
m_busyWidget->setGeometry(QStyle::alignedRect(layoutDirection(), \
Qt::AlignCenter, QSize(size, size), contentsRect())); \
m_scene->addItem(m_busyWidget);
- } else {
- delete m_busyWidget;
- m_busyWidget = 0;
}
}
--- trunk/KDE/kdebase/apps/plasma/applets/folderview/popupview.h #1114477:1114478
@@ -84,6 +84,7 @@
void init();
void activated(const QModelIndex &index);
void setBusy(bool);
+ void createBusyWidgetIfNeeded();
void contextMenuRequest(QWidget *widget, const QPoint &screenPos);
void maybeClose();
void closeThisAndParentPopup();
@@ -120,6 +121,7 @@
QBasicTimer m_hideTimer;
bool m_showingMenu;
bool m_showPreview;
+ bool m_busy;
QStringList m_previewPlugins;
static QTime s_lastOpenClose;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic