[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9
kenneth at webkit.org
kenneth at webkit.org
Thu Feb 4 21:32:33 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit d3dbc8645aacabc9f468845bcbee298c60e8d012
Author: kenneth at webkit.org <kenneth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 29 19:46:56 2010 +0000
[Qt] Show progress reaching 100% for loads.
Reviewed by Ariya Hidayat.
* QtLauncher/locationedit.cpp:
(LocationEdit::LocationEdit):
(LocationEdit::setProgress):
(LocationEdit::reset):
(LocationEdit::paintEvent):
* QtLauncher/locationedit.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 2e2d0ad..e9289a0 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-29 Kenneth Rohde Christiansen <kenneth at webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Show progress reaching 100% for loads.
+
+ * QtLauncher/locationedit.cpp:
+ (LocationEdit::LocationEdit):
+ (LocationEdit::setProgress):
+ (LocationEdit::reset):
+ (LocationEdit::paintEvent):
+ * QtLauncher/locationedit.h:
+
2010-01-29 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKitTools/QtLauncher/locationedit.cpp b/WebKitTools/QtLauncher/locationedit.cpp
index 977f39b..d67bd1e 100644
--- a/WebKitTools/QtLauncher/locationedit.cpp
+++ b/WebKitTools/QtLauncher/locationedit.cpp
@@ -28,33 +28,45 @@
#include "locationedit.h"
LocationEdit::LocationEdit(QWidget* parent)
- : QLineEdit(parent),
- m_progress(0)
+ : QLineEdit(parent)
+ , m_progress(0)
{
+ m_clearTimer.setSingleShot(true);
+ connect(&m_clearTimer, SIGNAL(timeout()), this, SLOT(reset()));
}
void LocationEdit::setProgress(int progress)
{
+ m_clearTimer.stop();
m_progress = progress;
update();
}
+void LocationEdit::reset()
+{
+ setProgress(0);
+}
+
void LocationEdit::paintEvent(QPaintEvent* ev)
{
QColor backgroundColor = QApplication::palette().color(QPalette::Base);
QColor progressColor = QColor(120, 180, 240);
QPalette p = palette();
- if (!m_progress || m_progress == 100)
+ if (!m_progress)
p.setBrush(QPalette::Base, backgroundColor);
else {
QLinearGradient gradient(0, 0, width(), 0);
gradient.setColorAt(0, progressColor);
- gradient.setColorAt(((double)m_progress) / 100, progressColor);
- gradient.setColorAt(((double)m_progress) / 100 + 0.001, backgroundColor);
+ gradient.setColorAt(((double) m_progress) / 100, progressColor);
+ if (m_progress != 100)
+ gradient.setColorAt((double) m_progress / 100 + 0.001, backgroundColor);
p.setBrush(QPalette::Base, gradient);
}
setPalette(p);
QLineEdit::paintEvent(ev);
+
+ if (m_progress == 100)
+ m_clearTimer.start(100);
}
diff --git a/WebKitTools/QtLauncher/locationedit.h b/WebKitTools/QtLauncher/locationedit.h
index 93cbe88..9991954 100644
--- a/WebKitTools/QtLauncher/locationedit.h
+++ b/WebKitTools/QtLauncher/locationedit.h
@@ -39,11 +39,15 @@ public:
public slots:
void setProgress(int progress);
+private slots:
+ void reset();
+
protected:
- void paintEvent(QPaintEvent*);
+ virtual void paintEvent(QPaintEvent*);
private:
int m_progress;
+ QTimer m_clearTimer;
};
#endif
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list