aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.h
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-12-05 09:26:43 +0100
committerJonas Schnelli <dev@jonasschnelli.ch>2016-12-05 13:58:00 +0100
commit89a3723bdc5d563f036c1a579c3d3539cc8fc6e7 (patch)
tree08c295ecb2a409cf536c049e0a33e86b902ee470 /src/qt/guiutil.h
parentd04aebaec7bbf4095bd4f6a715eb6ee834857115 (diff)
[Qt] Show ModalOverlay by pressing the progress bar, disabled show() in sync mode
Diffstat (limited to 'src/qt/guiutil.h')
-rw-r--r--src/qt/guiutil.h43
1 files changed, 28 insertions, 15 deletions
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h
index 9a17d24f07..4ea2aa36e7 100644
--- a/src/qt/guiutil.h
+++ b/src/qt/guiutil.h
@@ -202,20 +202,6 @@ namespace GUIUtil
QString formateNiceTimeOffset(qint64 secs);
-#if defined(Q_OS_MAC) && QT_VERSION >= 0x050000
- // workaround for Qt OSX Bug:
- // https://bugreports.qt-project.org/browse/QTBUG-15631
- // QProgressBar uses around 10% CPU even when app is in background
- class ProgressBar : public QProgressBar
- {
- bool event(QEvent *e) {
- return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false;
- }
- };
-#else
- typedef QProgressBar ProgressBar;
-#endif
-
class ClickableLabel : public QLabel
{
Q_OBJECT
@@ -226,8 +212,35 @@ namespace GUIUtil
*/
void clicked(const QPoint& point);
protected:
- void mousePressEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ };
+
+ class ClickableProgressBar : public QProgressBar
+ {
+ Q_OBJECT
+
+ Q_SIGNALS:
+ /** Emitted when the progressbar is clicked. The relative mouse coordinates of the click are
+ * passed to the signal.
+ */
+ void clicked(const QPoint& point);
+ protected:
+ void mouseReleaseEvent(QMouseEvent *event);
+ };
+
+#if defined(Q_OS_MAC) && QT_VERSION >= 0x050000
+ // workaround for Qt OSX Bug:
+ // https://bugreports.qt-project.org/browse/QTBUG-15631
+ // QProgressBar uses around 10% CPU even when app is in background
+ class ProgressBar : public ClickableProgressBar
+ {
+ bool event(QEvent *e) {
+ return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false;
+ }
};
+#else
+ typedef ClickableProgressBar ProgressBar;
+#endif
} // namespace GUIUtil