Commit ff7967cb authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Namespace ProgressBar and FadeWidgetHack appropriately

They're internal classes of the core plugin.
parent 0981b1c7
......@@ -43,9 +43,33 @@
#include <utils/stylehelper.h>
using namespace Core;
using namespace Core::Internal;
const int notificationTimeout = 8000;
namespace Core {
namespace Internal {
class FadeWidgetHack : public QWidget
{
Q_OBJECT
Q_PROPERTY(float opacity READ opacity WRITE setOpacity)
public:
FadeWidgetHack(QWidget *parent):QWidget(parent), m_opacity(0){
setAttribute(Qt::WA_TransparentForMouseEvents);
}
void paintEvent(QPaintEvent *);
void setOpacity(float o) { m_opacity = o; update(); }
float opacity() const { return m_opacity; }
private:
float m_opacity;
};
} // namespace Internal
} // namespace Core
void FadeWidgetHack::paintEvent(QPaintEvent *)
{
if (m_opacity == 0)
......@@ -285,3 +309,5 @@ void FutureProgress::fadeAway()
animation->start(QAbstractAnimation::DeleteWhenStopped);
connect(animation, SIGNAL(finished()), this, SIGNAL(removeMe()));
}
#include "futureprogress.moc"
......@@ -42,26 +42,12 @@ class QProgressBar;
class QHBoxLayout;
QT_END_NAMESPACE
class ProgressBar;
namespace Core {
class FadeWidgetHack : public QWidget
{
Q_OBJECT
Q_PROPERTY(float opacity READ opacity WRITE setOpacity)
public:
FadeWidgetHack(QWidget *parent):QWidget(parent), m_opacity(0){
setAttribute(Qt::WA_TransparentForMouseEvents);
}
void paintEvent(QPaintEvent *);
void setOpacity(float o) { m_opacity = o; update(); }
float opacity() const { return m_opacity; }
private:
float m_opacity;
};
namespace Internal {
class ProgressBar;
class FadeWidgetHack;
} // namespace Internal
class CORE_EXPORT FutureProgress : public QWidget
{
......@@ -111,14 +97,13 @@ private slots:
private:
QFutureWatcher<void> m_watcher;
ProgressBar *m_progress;
Internal::ProgressBar *m_progress;
QWidget *m_widget;
QHBoxLayout *m_widgetLayout;
QString m_type;
bool m_keep;
bool m_waitingForUserInteraction;
FadeWidgetHack *m_faderWidget;
Internal::FadeWidgetHack *m_faderWidget;
};
} // namespace Core
......
......@@ -37,7 +37,9 @@
#include <QtGui/QBrush>
#include <QtGui/QColor>
#include <QtGui/QMouseEvent>
#include <QtDebug>
using namespace Core;
using namespace Core::Internal;
#define PROGRESSBAR_HEIGHT 13
#define CANCELBUTTON_SIZE 15
......
......@@ -33,6 +33,9 @@
#include <QtCore/QString>
#include <QtGui/QWidget>
namespace Core {
namespace Internal {
class ProgressBar : public QWidget
{
Q_OBJECT
......@@ -77,7 +80,9 @@ private:
int m_maximum;
int m_value;
float m_fader;
};
} // namespace Internal
} // namespace Core
#endif // PROGRESSPIE_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment