diff --git a/include/ui/Avatar.h b/include/ui/Avatar.h
index b99ee683..dc089139 100644
--- a/include/ui/Avatar.h
+++ b/include/ui/Avatar.h
@@ -9,40 +9,40 @@
class Avatar : public QWidget
{
- Q_OBJECT
+ Q_OBJECT
- Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
- Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
+ Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
+ Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
public:
- explicit Avatar(QWidget *parent = 0);
- ~Avatar();
+ explicit Avatar(QWidget *parent = 0);
+ ~Avatar();
- void setBackgroundColor(const QColor &color);
- void setIcon(const QIcon &icon);
- void setImage(const QImage &image);
- void setLetter(const QChar &letter);
- void setSize(int size);
- void setTextColor(const QColor &color);
+ void setBackgroundColor(const QColor &color);
+ void setIcon(const QIcon &icon);
+ void setImage(const QImage &image);
+ void setLetter(const QChar &letter);
+ void setSize(int size);
+ void setTextColor(const QColor &color);
- QColor backgroundColor() const;
- QColor textColor() const;
- int size() const;
+ QColor backgroundColor() const;
+ QColor textColor() const;
+ int size() const;
- QSize sizeHint() const override;
+ QSize sizeHint() const override;
protected:
- void paintEvent(QPaintEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
private:
- void init();
-
- ui::AvatarType type_;
- QChar letter_;
- QColor background_color_;
- QColor text_color_;
- QIcon icon_;
- QImage image_;
- QPixmap pixmap_;
- int size_;
+ void init();
+
+ ui::AvatarType type_;
+ QChar letter_;
+ QColor background_color_;
+ QColor text_color_;
+ QIcon icon_;
+ QImage image_;
+ QPixmap pixmap_;
+ int size_;
};
diff --git a/include/ui/Badge.h b/include/ui/Badge.h
index b994cfdf..4084247e 100644
--- a/include/ui/Badge.h
+++ b/include/ui/Badge.h
@@ -9,55 +9,55 @@
class Badge : public OverlayWidget
{
- Q_OBJECT
+ Q_OBJECT
- Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
- Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
- Q_PROPERTY(QPointF relativePosition WRITE setRelativePosition READ relativePosition)
+ Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
+ Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
+ Q_PROPERTY(QPointF relativePosition WRITE setRelativePosition READ relativePosition)
public:
- explicit Badge(QWidget *parent = 0);
- explicit Badge(const QIcon &icon, QWidget *parent = 0);
- explicit Badge(const QString &text, QWidget *parent = 0);
- ~Badge();
-
- void setBackgroundColor(const QColor &color);
- void setTextColor(const QColor &color);
- void setIcon(const QIcon &icon);
- void setRelativePosition(const QPointF &pos);
- void setRelativePosition(qreal x, qreal y);
- void setRelativeXPosition(qreal x);
- void setRelativeYPosition(qreal y);
- void setText(const QString &text);
- void setDiameter(int diameter);
-
- QIcon icon() const;
- QString text() const;
- QColor backgroundColor() const;
- QColor textColor() const;
- QPointF relativePosition() const;
- QSize sizeHint() const override;
- qreal relativeXPosition() const;
- qreal relativeYPosition() const;
-
- int diameter() const;
+ explicit Badge(QWidget *parent = 0);
+ explicit Badge(const QIcon &icon, QWidget *parent = 0);
+ explicit Badge(const QString &text, QWidget *parent = 0);
+ ~Badge();
+
+ void setBackgroundColor(const QColor &color);
+ void setTextColor(const QColor &color);
+ void setIcon(const QIcon &icon);
+ void setRelativePosition(const QPointF &pos);
+ void setRelativePosition(qreal x, qreal y);
+ void setRelativeXPosition(qreal x);
+ void setRelativeYPosition(qreal y);
+ void setText(const QString &text);
+ void setDiameter(int diameter);
+
+ QIcon icon() const;
+ QString text() const;
+ QColor backgroundColor() const;
+ QColor textColor() const;
+ QPointF relativePosition() const;
+ QSize sizeHint() const override;
+ qreal relativeXPosition() const;
+ qreal relativeYPosition() const;
+
+ int diameter() const;
protected:
- void paintEvent(QPaintEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
private:
- void init();
+ void init();
- QColor background_color_;
- QColor text_color_;
+ QColor background_color_;
+ QColor text_color_;
- QIcon icon_;
- QSize size_;
- QString text_;
+ QIcon icon_;
+ QSize size_;
+ QString text_;
- int padding_;
- int diameter_;
+ int padding_;
+ int diameter_;
- qreal x_;
- qreal y_;
+ qreal x_;
+ qreal y_;
};
diff --git a/include/ui/CircularProgress.h b/include/ui/CircularProgress.h
index 5ed8994d..291cce1c 100644
--- a/include/ui/CircularProgress.h
+++ b/include/ui/CircularProgress.h
@@ -9,112 +9,112 @@ class CircularProgressDelegate;
class CircularProgress : public QProgressBar
{
- Q_OBJECT
+ Q_OBJECT
- Q_PROPERTY(qreal lineWidth WRITE setLineWidth READ lineWidth)
- Q_PROPERTY(qreal size WRITE setSize READ size)
- Q_PROPERTY(QColor color WRITE setColor READ color)
+ Q_PROPERTY(qreal lineWidth WRITE setLineWidth READ lineWidth)
+ Q_PROPERTY(qreal size WRITE setSize READ size)
+ Q_PROPERTY(QColor color WRITE setColor READ color)
public:
- explicit CircularProgress(QWidget *parent = nullptr);
- ~CircularProgress();
+ explicit CircularProgress(QWidget *parent = nullptr);
+ ~CircularProgress();
- void setProgressType(ui::ProgressType type);
- void setLineWidth(qreal width);
- void setSize(int size);
- void setColor(const QColor &color);
+ void setProgressType(ui::ProgressType type);
+ void setLineWidth(qreal width);
+ void setSize(int size);
+ void setColor(const QColor &color);
- ui::ProgressType progressType() const;
- qreal lineWidth() const;
- int size() const;
- QColor color() const;
+ ui::ProgressType progressType() const;
+ qreal lineWidth() const;
+ int size() const;
+ QColor color() const;
- QSize sizeHint() const override;
+ QSize sizeHint() const override;
protected:
- void paintEvent(QPaintEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
private:
- CircularProgressDelegate *delegate_;
+ CircularProgressDelegate *delegate_;
- ui::ProgressType progress_type_;
+ ui::ProgressType progress_type_;
- QColor color_;
+ QColor color_;
- // Circle width.
- qreal width_;
+ // Circle width.
+ qreal width_;
- // Circle radius.
- int size_;
+ // Circle radius.
+ int size_;
- // Animation duration.
- int duration_;
+ // Animation duration.
+ int duration_;
};
class CircularProgressDelegate : public QObject
{
- Q_OBJECT
+ Q_OBJECT
- Q_PROPERTY(qreal dashOffset WRITE setDashOffset READ dashOffset)
- Q_PROPERTY(qreal dashLength WRITE setDashLength READ dashLength)
- Q_PROPERTY(int angle WRITE setAngle READ angle)
+ Q_PROPERTY(qreal dashOffset WRITE setDashOffset READ dashOffset)
+ Q_PROPERTY(qreal dashLength WRITE setDashLength READ dashLength)
+ Q_PROPERTY(int angle WRITE setAngle READ angle)
public:
- explicit CircularProgressDelegate(CircularProgress *parent);
- ~CircularProgressDelegate();
+ explicit CircularProgressDelegate(CircularProgress *parent);
+ ~CircularProgressDelegate();
- inline void setDashOffset(qreal offset);
- inline void setDashLength(qreal length);
- inline void setAngle(int angle);
+ inline void setDashOffset(qreal offset);
+ inline void setDashLength(qreal length);
+ inline void setAngle(int angle);
- inline qreal dashOffset() const;
- inline qreal dashLength() const;
- inline int angle() const;
+ inline qreal dashOffset() const;
+ inline qreal dashLength() const;
+ inline int angle() const;
private:
- CircularProgress *const progress_;
+ CircularProgress *const progress_;
- qreal dash_offset_;
- qreal dash_length_;
+ qreal dash_offset_;
+ qreal dash_length_;
- int angle_;
+ int angle_;
};
inline void
CircularProgressDelegate::setDashOffset(qreal offset)
{
- dash_offset_ = offset;
- progress_->update();
+ dash_offset_ = offset;
+ progress_->update();
}
inline void
CircularProgressDelegate::setDashLength(qreal length)
{
- dash_length_ = length;
- progress_->update();
+ dash_length_ = length;
+ progress_->update();
}
inline void
CircularProgressDelegate::setAngle(int angle)
{
- angle_ = angle;
- progress_->update();
+ angle_ = angle;
+ progress_->update();
}
inline qreal
CircularProgressDelegate::dashOffset() const
{
- return dash_offset_;
+ return dash_offset_;
}
inline qreal
CircularProgressDelegate::dashLength() const
{
- return dash_length_;
+ return dash_length_;
}
inline int
CircularProgressDelegate::angle() const
{
- return angle_;
+ return angle_;
}
diff --git a/include/ui/DropShadow.h b/include/ui/DropShadow.h
index 3054d7dd..b7ba1985 100644
--- a/include/ui/DropShadow.h
+++ b/include/ui/DropShadow.h
@@ -7,97 +7,105 @@
class DropShadow
{
public:
- static void draw(QPainter &painter,
- qint16 margin,
- qreal radius,
- QColor start,
- QColor end,
- qreal startPosition,
- qreal endPosition0,
- qreal endPosition1,
- qreal width,
- qreal height)
- {
- painter.setPen(Qt::NoPen);
+ static void draw(QPainter &painter,
+ qint16 margin,
+ qreal radius,
+ QColor start,
+ QColor end,
+ qreal startPosition,
+ qreal endPosition0,
+ qreal endPosition1,
+ qreal width,
+ qreal height)
+ {
+ painter.setPen(Qt::NoPen);
- QLinearGradient gradient;
- gradient.setColorAt(startPosition, start);
- gradient.setColorAt(endPosition0, end);
+ QLinearGradient gradient;
+ gradient.setColorAt(startPosition, start);
+ gradient.setColorAt(endPosition0, end);
- // Right
- QPointF right0(width - margin, height / 2);
- QPointF right1(width, height / 2);
- gradient.setStart(right0);
- gradient.setFinalStop(right1);
- painter.setBrush(QBrush(gradient));
- painter.drawRoundRect(
- QRectF(QPointF(width - margin * radius, margin), QPointF(width, height - margin)), 0.0, 0.0);
+ // Right
+ QPointF right0(width - margin, height / 2);
+ QPointF right1(width, height / 2);
+ gradient.setStart(right0);
+ gradient.setFinalStop(right1);
+ painter.setBrush(QBrush(gradient));
+ painter.drawRoundRect(
+ QRectF(QPointF(width - margin * radius, margin), QPointF(width, height - margin)),
+ 0.0,
+ 0.0);
- // Left
- QPointF left0(margin, height / 2);
- QPointF left1(0, height / 2);
- gradient.setStart(left0);
- gradient.setFinalStop(left1);
- painter.setBrush(QBrush(gradient));
- painter.drawRoundRect(QRectF(QPointF(margin * radius, margin), QPointF(0, height - margin)), 0.0, 0.0);
+ // Left
+ QPointF left0(margin, height / 2);
+ QPointF left1(0, height / 2);
+ gradient.setStart(left0);
+ gradient.setFinalStop(left1);
+ painter.setBrush(QBrush(gradient));
+ painter.drawRoundRect(
+ QRectF(QPointF(margin * radius, margin), QPointF(0, height - margin)), 0.0, 0.0);
- // Top
- QPointF top0(width / 2, margin);
- QPointF top1(width / 2, 0);
- gradient.setStart(top0);
- gradient.setFinalStop(top1);
- painter.setBrush(QBrush(gradient));
- painter.drawRoundRect(QRectF(QPointF(width - margin, 0), QPointF(margin, margin)), 0.0, 0.0);
+ // Top
+ QPointF top0(width / 2, margin);
+ QPointF top1(width / 2, 0);
+ gradient.setStart(top0);
+ gradient.setFinalStop(top1);
+ painter.setBrush(QBrush(gradient));
+ painter.drawRoundRect(
+ QRectF(QPointF(width - margin, 0), QPointF(margin, margin)), 0.0, 0.0);
- // Bottom
- QPointF bottom0(width / 2, height - margin);
- QPointF bottom1(width / 2, height);
- gradient.setStart(bottom0);
- gradient.setFinalStop(bottom1);
- painter.setBrush(QBrush(gradient));
- painter.drawRoundRect(
- QRectF(QPointF(margin, height - margin), QPointF(width - margin, height)), 0.0, 0.0);
+ // Bottom
+ QPointF bottom0(width / 2, height - margin);
+ QPointF bottom1(width / 2, height);
+ gradient.setStart(bottom0);
+ gradient.setFinalStop(bottom1);
+ painter.setBrush(QBrush(gradient));
+ painter.drawRoundRect(
+ QRectF(QPointF(margin, height - margin), QPointF(width - margin, height)),
+ 0.0,
+ 0.0);
- // BottomRight
- QPointF bottomright0(width - margin, height - margin);
- QPointF bottomright1(width, height);
- gradient.setStart(bottomright0);
- gradient.setFinalStop(bottomright1);
- gradient.setColorAt(endPosition1, end);
- painter.setBrush(QBrush(gradient));
- painter.drawRoundRect(QRectF(bottomright0, bottomright1), 0.0, 0.0);
+ // BottomRight
+ QPointF bottomright0(width - margin, height - margin);
+ QPointF bottomright1(width, height);
+ gradient.setStart(bottomright0);
+ gradient.setFinalStop(bottomright1);
+ gradient.setColorAt(endPosition1, end);
+ painter.setBrush(QBrush(gradient));
+ painter.drawRoundRect(QRectF(bottomright0, bottomright1), 0.0, 0.0);
- // BottomLeft
- QPointF bottomleft0(margin, height - margin);
- QPointF bottomleft1(0, height);
- gradient.setStart(bottomleft0);
- gradient.setFinalStop(bottomleft1);
- gradient.setColorAt(endPosition1, end);
- painter.setBrush(QBrush(gradient));
- painter.drawRoundRect(QRectF(bottomleft0, bottomleft1), 0.0, 0.0);
+ // BottomLeft
+ QPointF bottomleft0(margin, height - margin);
+ QPointF bottomleft1(0, height);
+ gradient.setStart(bottomleft0);
+ gradient.setFinalStop(bottomleft1);
+ gradient.setColorAt(endPosition1, end);
+ painter.setBrush(QBrush(gradient));
+ painter.drawRoundRect(QRectF(bottomleft0, bottomleft1), 0.0, 0.0);
- // TopLeft
- QPointF topleft0(margin, margin);
- QPointF topleft1(0, 0);
- gradient.setStart(topleft0);
- gradient.setFinalStop(topleft1);
- gradient.setColorAt(endPosition1, end);
- painter.setBrush(QBrush(gradient));
- painter.drawRoundRect(QRectF(topleft0, topleft1), 0.0, 0.0);
+ // TopLeft
+ QPointF topleft0(margin, margin);
+ QPointF topleft1(0, 0);
+ gradient.setStart(topleft0);
+ gradient.setFinalStop(topleft1);
+ gradient.setColorAt(endPosition1, end);
+ painter.setBrush(QBrush(gradient));
+ painter.drawRoundRect(QRectF(topleft0, topleft1), 0.0, 0.0);
- // TopRight
- QPointF topright0(width - margin, margin);
- QPointF topright1(width, 0);
- gradient.setStart(topright0);
- gradient.setFinalStop(topright1);
- gradient.setColorAt(endPosition1, end);
- painter.setBrush(QBrush(gradient));
- painter.drawRoundRect(QRectF(topright0, topright1), 0.0, 0.0);
+ // TopRight
+ QPointF topright0(width - margin, margin);
+ QPointF topright1(width, 0);
+ gradient.setStart(topright0);
+ gradient.setFinalStop(topright1);
+ gradient.setColorAt(endPosition1, end);
+ painter.setBrush(QBrush(gradient));
+ painter.drawRoundRect(QRectF(topright0, topright1), 0.0, 0.0);
- // Widget
- painter.setBrush(QBrush("#FFFFFF"));
- painter.setRenderHint(QPainter::Antialiasing);
- painter.drawRoundRect(
- QRectF(QPointF(margin, margin), QPointF(width - margin, height - margin)), radius, radius);
- }
+ // Widget
+ painter.setBrush(QBrush("#FFFFFF"));
+ painter.setRenderHint(QPainter::Antialiasing);
+ painter.drawRoundRect(
+ QRectF(QPointF(margin, margin), QPointF(width - margin, height - margin)),
+ radius,
+ radius);
+ }
};
diff --git a/include/ui/FlatButton.h b/include/ui/FlatButton.h
index 1c44d5d7..816563e3 100644
--- a/include/ui/FlatButton.h
+++ b/include/ui/FlatButton.h
@@ -12,167 +12,174 @@ class FlatButton;
class FlatButtonStateMachine : public QStateMachine
{
- Q_OBJECT
+ Q_OBJECT
- Q_PROPERTY(qreal overlayOpacity WRITE setOverlayOpacity READ overlayOpacity)
- Q_PROPERTY(qreal checkedOverlayProgress WRITE setCheckedOverlayProgress READ checkedOverlayProgress)
+ Q_PROPERTY(qreal overlayOpacity WRITE setOverlayOpacity READ overlayOpacity)
+ Q_PROPERTY(
+ qreal checkedOverlayProgress WRITE setCheckedOverlayProgress READ checkedOverlayProgress)
public:
- explicit FlatButtonStateMachine(FlatButton *parent);
- ~FlatButtonStateMachine();
+ explicit FlatButtonStateMachine(FlatButton *parent);
+ ~FlatButtonStateMachine();
- void setOverlayOpacity(qreal opacity);
- void setCheckedOverlayProgress(qreal opacity);
+ void setOverlayOpacity(qreal opacity);
+ void setCheckedOverlayProgress(qreal opacity);
- inline qreal overlayOpacity() const;
- inline qreal checkedOverlayProgress() const;
+ inline qreal overlayOpacity() const;
+ inline qreal checkedOverlayProgress() const;
- void startAnimations();
- void setupProperties();
- void updateCheckedStatus();
+ void startAnimations();
+ void setupProperties();
+ void updateCheckedStatus();
signals:
- void buttonPressed();
- void buttonChecked();
- void buttonUnchecked();
+ void buttonPressed();
+ void buttonChecked();
+ void buttonUnchecked();
protected:
- bool eventFilter(QObject *watched, QEvent *event) override;
+ bool eventFilter(QObject *watched, QEvent *event) override;
private:
- void addTransition(QObject *object, const char *signal, QState *fromState, QState *toState);
- void addTransition(QObject *object, QEvent::Type eventType, QState *fromState, QState *toState);
- void addTransition(QAbstractTransition *transition, QState *fromState, QState *toState);
-
- FlatButton *const button_;
-
- QState *const top_level_state_;
- QState *const config_state_;
- QState *const checkable_state_;
- QState *const checked_state_;
- QState *const unchecked_state_;
- QState *const neutral_state_;
- QState *const neutral_focused_state_;
- QState *const hovered_state_;
- QState *const hovered_focused_state_;
- QState *const pressed_state_;
-
- qreal overlay_opacity_;
- qreal checked_overlay_progress_;
-
- bool was_checked_;
+ void addTransition(QObject *object, const char *signal, QState *fromState, QState *toState);
+ void addTransition(QObject *object,
+ QEvent::Type eventType,
+ QState *fromState,
+ QState *toState);
+ void addTransition(QAbstractTransition *transition, QState *fromState, QState *toState);
+
+ FlatButton *const button_;
+
+ QState *const top_level_state_;
+ QState *const config_state_;
+ QState *const checkable_state_;
+ QState *const checked_state_;
+ QState *const unchecked_state_;
+ QState *const neutral_state_;
+ QState *const neutral_focused_state_;
+ QState *const hovered_state_;
+ QState *const hovered_focused_state_;
+ QState *const pressed_state_;
+
+ qreal overlay_opacity_;
+ qreal checked_overlay_progress_;
+
+ bool was_checked_;
};
inline qreal
FlatButtonStateMachine::overlayOpacity() const
{
- return overlay_opacity_;
+ return overlay_opacity_;
}
inline qreal
FlatButtonStateMachine::checkedOverlayProgress() const
{
- return checked_overlay_progress_;
+ return checked_overlay_progress_;
}
class FlatButton : public QPushButton
{
- Q_OBJECT
+ Q_OBJECT
- Q_PROPERTY(QColor foregroundColor WRITE setForegroundColor READ foregroundColor)
- Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
- Q_PROPERTY(QColor overlayColor WRITE setOverlayColor READ overlayColor)
- Q_PROPERTY(QColor disabledForegroundColor WRITE setDisabledForegroundColor READ disabledForegroundColor)
- Q_PROPERTY(QColor disabledBackgroundColor WRITE setDisabledBackgroundColor READ disabledBackgroundColor)
- Q_PROPERTY(qreal fontSize WRITE setFontSize READ fontSize)
+ Q_PROPERTY(QColor foregroundColor WRITE setForegroundColor READ foregroundColor)
+ Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
+ Q_PROPERTY(QColor overlayColor WRITE setOverlayColor READ overlayColor)
+ Q_PROPERTY(QColor disabledForegroundColor WRITE setDisabledForegroundColor READ
+ disabledForegroundColor)
+ Q_PROPERTY(QColor disabledBackgroundColor WRITE setDisabledBackgroundColor READ
+ disabledBackgroundColor)
+ Q_PROPERTY(qreal fontSize WRITE setFontSize READ fontSize)
public:
- explicit FlatButton(QWidget *parent = 0, ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
- explicit FlatButton(const QString &text,
- QWidget *parent = 0,
- ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
- FlatButton(const QString &text,
- ui::Role role,
- QWidget *parent = 0,
- ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
- ~FlatButton();
-
- void applyPreset(ui::ButtonPreset preset);
-
- void setBackgroundColor(const QColor &color);
- void setBackgroundMode(Qt::BGMode mode);
- void setBaseOpacity(qreal opacity);
- void setCheckable(bool value);
- void setCornerRadius(qreal radius);
- void setDisabledBackgroundColor(const QColor &color);
- void setDisabledForegroundColor(const QColor &color);
- void setFixedRippleRadius(qreal radius);
- void setFontSize(qreal size);
- void setForegroundColor(const QColor &color);
- void setHasFixedRippleRadius(bool value);
- void setIconPlacement(ui::ButtonIconPlacement placement);
- void setOverlayColor(const QColor &color);
- void setOverlayStyle(ui::OverlayStyle style);
- void setRippleStyle(ui::RippleStyle style);
- void setRole(ui::Role role);
-
- QColor foregroundColor() const;
- QColor backgroundColor() const;
- QColor overlayColor() const;
- QColor disabledForegroundColor() const;
- QColor disabledBackgroundColor() const;
-
- qreal fontSize() const;
- qreal cornerRadius() const;
- qreal baseOpacity() const;
-
- bool hasFixedRippleRadius() const;
-
- ui::Role role() const;
- ui::OverlayStyle overlayStyle() const;
- ui::RippleStyle rippleStyle() const;
- ui::ButtonIconPlacement iconPlacement() const;
-
- Qt::BGMode backgroundMode() const;
-
- QSize sizeHint() const override;
+ explicit FlatButton(QWidget *parent = 0,
+ ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
+ explicit FlatButton(const QString &text,
+ QWidget *parent = 0,
+ ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
+ FlatButton(const QString &text,
+ ui::Role role,
+ QWidget *parent = 0,
+ ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
+ ~FlatButton();
+
+ void applyPreset(ui::ButtonPreset preset);
+
+ void setBackgroundColor(const QColor &color);
+ void setBackgroundMode(Qt::BGMode mode);
+ void setBaseOpacity(qreal opacity);
+ void setCheckable(bool value);
+ void setCornerRadius(qreal radius);
+ void setDisabledBackgroundColor(const QColor &color);
+ void setDisabledForegroundColor(const QColor &color);
+ void setFixedRippleRadius(qreal radius);
+ void setFontSize(qreal size);
+ void setForegroundColor(const QColor &color);
+ void setHasFixedRippleRadius(bool value);
+ void setIconPlacement(ui::ButtonIconPlacement placement);
+ void setOverlayColor(const QColor &color);
+ void setOverlayStyle(ui::OverlayStyle style);
+ void setRippleStyle(ui::RippleStyle style);
+ void setRole(ui::Role role);
+
+ QColor foregroundColor() const;
+ QColor backgroundColor() const;
+ QColor overlayColor() const;
+ QColor disabledForegroundColor() const;
+ QColor disabledBackgroundColor() const;
+
+ qreal fontSize() const;
+ qreal cornerRadius() const;
+ qreal baseOpacity() const;
+
+ bool hasFixedRippleRadius() const;
+
+ ui::Role role() const;
+ ui::OverlayStyle overlayStyle() const;
+ ui::RippleStyle rippleStyle() const;
+ ui::ButtonIconPlacement iconPlacement() const;
+
+ Qt::BGMode backgroundMode() const;
+
+ QSize sizeHint() const override;
protected:
- int IconPadding = 0;
+ int IconPadding = 0;
- void checkStateSet() override;
- void mousePressEvent(QMouseEvent *event) override;
- void mouseReleaseEvent(QMouseEvent *event) override;
- void resizeEvent(QResizeEvent *event) override;
- void paintEvent(QPaintEvent *event) override;
+ void checkStateSet() override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
- virtual void paintBackground(QPainter *painter);
- virtual void paintForeground(QPainter *painter);
- virtual void updateClipPath();
+ virtual void paintBackground(QPainter *painter);
+ virtual void paintForeground(QPainter *painter);
+ virtual void updateClipPath();
- void init();
+ void init();
private:
- RippleOverlay *ripple_overlay_;
- FlatButtonStateMachine *state_machine_;
+ RippleOverlay *ripple_overlay_;
+ FlatButtonStateMachine *state_machine_;
- ui::Role role_;
- ui::RippleStyle ripple_style_;
- ui::ButtonIconPlacement icon_placement_;
- ui::OverlayStyle overlay_style_;
+ ui::Role role_;
+ ui::RippleStyle ripple_style_;
+ ui::ButtonIconPlacement icon_placement_;
+ ui::OverlayStyle overlay_style_;
- Qt::BGMode bg_mode_;
+ Qt::BGMode bg_mode_;
- QColor background_color_;
- QColor foreground_color_;
- QColor overlay_color_;
- QColor disabled_color_;
- QColor disabled_background_color_;
+ QColor background_color_;
+ QColor foreground_color_;
+ QColor overlay_color_;
+ QColor disabled_color_;
+ QColor disabled_background_color_;
- qreal fixed_ripple_radius_;
- qreal corner_radius_;
- qreal base_opacity_;
- qreal font_size_;
+ qreal fixed_ripple_radius_;
+ qreal corner_radius_;
+ qreal base_opacity_;
+ qreal font_size_;
- bool use_fixed_ripple_radius_;
+ bool use_fixed_ripple_radius_;
};
diff --git a/include/ui/Menu.h b/include/ui/Menu.h
index 0b4eb6d5..2029b1fd 100644
--- a/include/ui/Menu.h
+++ b/include/ui/Menu.h
@@ -7,24 +7,26 @@
class Menu : public QMenu
{
public:
- Menu(QWidget *parent = nullptr)
- : QMenu(parent)
- {
- QFont font;
- font.setPixelSize(conf::fontSize);
+ Menu(QWidget *parent = nullptr)
+ : QMenu(parent)
+ {
+ QFont font;
+ font.setPixelSize(conf::fontSize);
- setFont(font);
- setStyleSheet("QMenu { color: black; background-color: white; margin: 0px;}"
- "QMenu::item { color: black; padding: 7px 20px; border: 1px solid transparent; margin: "
- "2px 0px; }"
- "QMenu::item:selected { color: black; background: rgba(180, 180, 180, 100); }");
- };
+ setFont(font);
+ setStyleSheet(
+ "QMenu { color: black; background-color: white; margin: 0px;}"
+ "QMenu::item { color: black; padding: 7px 20px; border: 1px solid transparent; "
+ "margin: "
+ "2px 0px; }"
+ "QMenu::item:selected { color: black; background: rgba(180, 180, 180, 100); }");
+ };
protected:
- void leaveEvent(QEvent *e)
- {
- Q_UNUSED(e);
+ void leaveEvent(QEvent *e)
+ {
+ Q_UNUSED(e);
- hide();
- }
+ hide();
+ }
};
diff --git a/include/ui/OverlayModal.h b/include/ui/OverlayModal.h
index 4dea6513..167ba71a 100644
--- a/include/ui/OverlayModal.h
+++ b/include/ui/OverlayModal.h
@@ -26,35 +26,35 @@
class OverlayModal : public OverlayWidget
{
public:
- explicit OverlayModal(QWidget *parent, QWidget *content);
+ explicit OverlayModal(QWidget *parent, QWidget *content);
- void fadeIn();
- void fadeOut();
+ void fadeIn();
+ void fadeOut();
public:
- inline void setDuration(int duration);
- inline void setColor(QColor color);
+ inline void setDuration(int duration);
+ inline void setColor(QColor color);
protected:
- void paintEvent(QPaintEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
private:
- int duration_;
- QColor color_;
+ int duration_;
+ QColor color_;
- QGraphicsOpacityEffect *opacity_;
- QPropertyAnimation *animation_;
+ QGraphicsOpacityEffect *opacity_;
+ QPropertyAnimation *animation_;
};
inline void
OverlayModal::setDuration(int duration)
{
- duration_ = duration;
- animation_->setDuration(duration_);
+ duration_ = duration;
+ animation_->setDuration(duration_);
}
inline void
OverlayModal::setColor(QColor color)
{
- color_ = color;
+ color_ = color;
}
diff --git a/include/ui/OverlayWidget.h b/include/ui/OverlayWidget.h
index b9655cf6..2984e469 100644
--- a/include/ui/OverlayWidget.h
+++ b/include/ui/OverlayWidget.h
@@ -5,14 +5,14 @@
class OverlayWidget : public QWidget
{
- Q_OBJECT
+ Q_OBJECT
public:
- explicit OverlayWidget(QWidget *parent = nullptr);
+ explicit OverlayWidget(QWidget *parent = nullptr);
protected:
- bool event(QEvent *event) override;
- bool eventFilter(QObject *obj, QEvent *event) override;
+ bool event(QEvent *event) override;
+ bool eventFilter(QObject *obj, QEvent *event) override;
- QRect overlayGeometry() const;
+ QRect overlayGeometry() const;
};
diff --git a/include/ui/RaisedButton.h b/include/ui/RaisedButton.h
index 558d15eb..edd5ee4a 100644
--- a/include/ui/RaisedButton.h
+++ b/include/ui/RaisedButton.h
@@ -8,21 +8,21 @@
class RaisedButton : public FlatButton
{
- Q_OBJECT
+ Q_OBJECT
public:
- explicit RaisedButton(QWidget *parent = 0);
- explicit RaisedButton(const QString &text, QWidget *parent = 0);
- ~RaisedButton();
+ explicit RaisedButton(QWidget *parent = 0);
+ explicit RaisedButton(const QString &text, QWidget *parent = 0);
+ ~RaisedButton();
protected:
- bool event(QEvent *event) override;
+ bool event(QEvent *event) override;
private:
- void init();
+ void init();
- QStateMachine *shadow_state_machine_;
- QState *normal_state_;
- QState *pressed_state_;
- QGraphicsDropShadowEffect *effect_;
+ QStateMachine *shadow_state_machine_;
+ QState *normal_state_;
+ QState *pressed_state_;
+ QGraphicsDropShadowEffect *effect_;
};
diff --git a/include/ui/Ripple.h b/include/ui/Ripple.h
index 01e30698..0baebfd6 100644
--- a/include/ui/Ripple.h
+++ b/include/ui/Ripple.h
@@ -10,137 +10,137 @@ class RippleOverlay;
class Ripple : public QParallelAnimationGroup
{
- Q_OBJECT
+ Q_OBJECT
- Q_PROPERTY(qreal radius WRITE setRadius READ radius)
- Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity)
+ Q_PROPERTY(qreal radius WRITE setRadius READ radius)
+ Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity)
public:
- explicit Ripple(const QPoint ¢er, QObject *parent = 0);
- Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent = 0);
- ~Ripple();
+ explicit Ripple(const QPoint ¢er, QObject *parent = 0);
+ Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent = 0);
+ ~Ripple();
- inline void setOverlay(RippleOverlay *overlay);
+ inline void setOverlay(RippleOverlay *overlay);
- void setRadius(qreal radius);
- void setOpacity(qreal opacity);
- void setColor(const QColor &color);
- void setBrush(const QBrush &brush);
+ void setRadius(qreal radius);
+ void setOpacity(qreal opacity);
+ void setColor(const QColor &color);
+ void setBrush(const QBrush &brush);
- inline qreal radius() const;
- inline qreal opacity() const;
- inline QColor color() const;
- inline QBrush brush() const;
- inline QPoint center() const;
+ inline qreal radius() const;
+ inline qreal opacity() const;
+ inline QColor color() const;
+ inline QBrush brush() const;
+ inline QPoint center() const;
- inline QPropertyAnimation *radiusAnimation() const;
- inline QPropertyAnimation *opacityAnimation() const;
+ inline QPropertyAnimation *radiusAnimation() const;
+ inline QPropertyAnimation *opacityAnimation() const;
- inline void setOpacityStartValue(qreal value);
- inline void setOpacityEndValue(qreal value);
- inline void setRadiusStartValue(qreal value);
- inline void setRadiusEndValue(qreal value);
- inline void setDuration(int msecs);
+ inline void setOpacityStartValue(qreal value);
+ inline void setOpacityEndValue(qreal value);
+ inline void setRadiusStartValue(qreal value);
+ inline void setRadiusEndValue(qreal value);
+ inline void setDuration(int msecs);
protected slots:
- void destroy();
+ void destroy();
private:
- Q_DISABLE_COPY(Ripple)
+ Q_DISABLE_COPY(Ripple)
- QPropertyAnimation *animate(const QByteArray &property,
- const QEasingCurve &easing = QEasingCurve::OutQuad,
- int duration = 800);
+ QPropertyAnimation *animate(const QByteArray &property,
+ const QEasingCurve &easing = QEasingCurve::OutQuad,
+ int duration = 800);
- void init();
+ void init();
- RippleOverlay *overlay_;
+ RippleOverlay *overlay_;
- QPropertyAnimation *const radius_anim_;
- QPropertyAnimation *const opacity_anim_;
+ QPropertyAnimation *const radius_anim_;
+ QPropertyAnimation *const opacity_anim_;
- qreal radius_;
- qreal opacity_;
+ qreal radius_;
+ qreal opacity_;
- QPoint center_;
- QBrush brush_;
+ QPoint center_;
+ QBrush brush_;
};
inline void
Ripple::setOverlay(RippleOverlay *overlay)
{
- overlay_ = overlay;
+ overlay_ = overlay;
}
inline qreal
Ripple::radius() const
{
- return radius_;
+ return radius_;
}
inline qreal
Ripple::opacity() const
{
- return opacity_;
+ return opacity_;
}
inline QColor
Ripple::color() const
{
- return brush_.color();
+ return brush_.color();
}
inline QBrush
Ripple::brush() const
{
- return brush_;
+ return brush_;
}
inline QPoint
Ripple::center() const
{
- return center_;
+ return center_;
}
inline QPropertyAnimation *
Ripple::radiusAnimation() const
{
- return radius_anim_;
+ return radius_anim_;
}
inline QPropertyAnimation *
Ripple::opacityAnimation() const
{
- return opacity_anim_;
+ return opacity_anim_;
}
inline void
Ripple::setOpacityStartValue(qreal value)
{
- opacity_anim_->setStartValue(value);
+ opacity_anim_->setStartValue(value);
}
inline void
Ripple::setOpacityEndValue(qreal value)
{
- opacity_anim_->setEndValue(value);
+ opacity_anim_->setEndValue(value);
}
inline void
Ripple::setRadiusStartValue(qreal value)
{
- radius_anim_->setStartValue(value);
+ radius_anim_->setStartValue(value);
}
inline void
Ripple::setRadiusEndValue(qreal value)
{
- radius_anim_->setEndValue(value);
+ radius_anim_->setEndValue(value);
}
inline void
Ripple::setDuration(int msecs)
{
- radius_anim_->setDuration(msecs);
- opacity_anim_->setDuration(msecs);
+ radius_anim_->setDuration(msecs);
+ opacity_anim_->setDuration(msecs);
}
diff --git a/include/ui/RippleOverlay.h b/include/ui/RippleOverlay.h
index cc6fd05e..28a6b9e4 100644
--- a/include/ui/RippleOverlay.h
+++ b/include/ui/RippleOverlay.h
@@ -8,51 +8,51 @@ class Ripple;
class RippleOverlay : public OverlayWidget
{
- Q_OBJECT
+ Q_OBJECT
public:
- explicit RippleOverlay(QWidget *parent = 0);
- ~RippleOverlay();
+ explicit RippleOverlay(QWidget *parent = 0);
+ ~RippleOverlay();
- void addRipple(Ripple *ripple);
- void addRipple(const QPoint &position, qreal radius = 300);
+ void addRipple(Ripple *ripple);
+ void addRipple(const QPoint &position, qreal radius = 300);
- void removeRipple(Ripple *ripple);
+ void removeRipple(Ripple *ripple);
- inline void setClipping(bool enable);
- inline bool hasClipping() const;
+ inline void setClipping(bool enable);
+ inline bool hasClipping() const;
- inline void setClipPath(const QPainterPath &path);
+ inline void setClipPath(const QPainterPath &path);
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
private:
- Q_DISABLE_COPY(RippleOverlay)
+ Q_DISABLE_COPY(RippleOverlay)
- void paintRipple(QPainter *painter, Ripple *ripple);
+ void paintRipple(QPainter *painter, Ripple *ripple);
- QList<Ripple *> ripples_;
- QPainterPath clip_path_;
- bool use_clip_;
+ QList<Ripple *> ripples_;
+ QPainterPath clip_path_;
+ bool use_clip_;
};
inline void
RippleOverlay::setClipping(bool enable)
{
- use_clip_ = enable;
- update();
+ use_clip_ = enable;
+ update();
}
inline bool
RippleOverlay::hasClipping() const
{
- return use_clip_;
+ return use_clip_;
}
inline void
RippleOverlay::setClipPath(const QPainterPath &path)
{
- clip_path_ = path;
- update();
+ clip_path_ = path;
+ update();
}
diff --git a/include/ui/ScrollBar.h b/include/ui/ScrollBar.h
index 483a73c4..1c056409 100644
--- a/include/ui/ScrollBar.h
+++ b/include/ui/ScrollBar.h
@@ -25,29 +25,29 @@
class ScrollBar : public QScrollBar
{
- Q_OBJECT
+ Q_OBJECT
public:
- ScrollBar(QScrollArea *area, QWidget *parent = nullptr);
+ ScrollBar(QScrollArea *area, QWidget *parent = nullptr);
- void fadeIn();
- void fadeOut();
+ void fadeIn();
+ void fadeOut();
protected:
- void paintEvent(QPaintEvent *e) override;
- void sliderChange(SliderChange change) override;
+ void paintEvent(QPaintEvent *e) override;
+ void sliderChange(SliderChange change) override;
private:
- int roundRadius_ = 4;
- int handleWidth_ = 7;
- int minHandleHeight_ = 20;
- bool isActive;
+ int roundRadius_ = 4;
+ int handleWidth_ = 7;
+ int minHandleHeight_ = 20;
+ bool isActive;
- const int AnimationDuration = 300;
- const int Padding = 4;
+ const int AnimationDuration = 300;
+ const int Padding = 4;
- QGraphicsOpacityEffect *eff;
- QTimer hideTimer_;
+ QGraphicsOpacityEffect *eff;
+ QTimer hideTimer_;
- QScrollArea *area_;
- QRect handle_;
+ QScrollArea *area_;
+ QRect handle_;
};
diff --git a/include/ui/TextField.h b/include/ui/TextField.h
index ec761483..c215a1f8 100644
--- a/include/ui/TextField.h
+++ b/include/ui/TextField.h
@@ -13,163 +13,163 @@ class TextFieldStateMachine;
class TextField : public QLineEdit
{
- Q_OBJECT
+ Q_OBJECT
- Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
- Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor)
- Q_PROPERTY(QColor underlineColor WRITE setUnderlineColor READ underlineColor)
+ Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
+ Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor)
+ Q_PROPERTY(QColor underlineColor WRITE setUnderlineColor READ underlineColor)
public:
- explicit TextField(QWidget *parent = 0);
- ~TextField();
-
- void setInkColor(const QColor &color);
- void setBackgroundColor(const QColor &color);
- void setLabel(const QString &label);
- void setLabelColor(const QColor &color);
- void setLabelFontSize(qreal size);
- void setShowLabel(bool value);
- void setTextColor(const QColor &color);
- void setUnderlineColor(const QColor &color);
-
- QColor inkColor() const;
- QColor labelColor() const;
- QColor textColor() const;
- QColor underlineColor() const;
- QColor backgroundColor() const;
- QString label() const;
- bool hasLabel() const;
- qreal labelFontSize() const;
+ explicit TextField(QWidget *parent = 0);
+ ~TextField();
+
+ void setInkColor(const QColor &color);
+ void setBackgroundColor(const QColor &color);
+ void setLabel(const QString &label);
+ void setLabelColor(const QColor &color);
+ void setLabelFontSize(qreal size);
+ void setShowLabel(bool value);
+ void setTextColor(const QColor &color);
+ void setUnderlineColor(const QColor &color);
+
+ QColor inkColor() const;
+ QColor labelColor() const;
+ QColor textColor() const;
+ QColor underlineColor() const;
+ QColor backgroundColor() const;
+ QString label() const;
+ bool hasLabel() const;
+ qreal labelFontSize() const;
protected:
- bool event(QEvent *event) override;
- void paintEvent(QPaintEvent *event) override;
+ bool event(QEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
private:
- void init();
-
- QColor ink_color_;
- QColor background_color_;
- QColor label_color_;
- QColor text_color_;
- QColor underline_color_;
- QString label_text_;
- TextFieldLabel *label_;
- TextFieldStateMachine *state_machine_;
- bool show_label_;
- qreal label_font_size_;
+ void init();
+
+ QColor ink_color_;
+ QColor background_color_;
+ QColor label_color_;
+ QColor text_color_;
+ QColor underline_color_;
+ QString label_text_;
+ TextFieldLabel *label_;
+ TextFieldStateMachine *state_machine_;
+ bool show_label_;
+ qreal label_font_size_;
};
class TextFieldLabel : public QWidget
{
- Q_OBJECT
+ Q_OBJECT
- Q_PROPERTY(qreal scale WRITE setScale READ scale)
- Q_PROPERTY(QPointF offset WRITE setOffset READ offset)
- Q_PROPERTY(QColor color WRITE setColor READ color)
+ Q_PROPERTY(qreal scale WRITE setScale READ scale)
+ Q_PROPERTY(QPointF offset WRITE setOffset READ offset)
+ Q_PROPERTY(QColor color WRITE setColor READ color)
public:
- TextFieldLabel(TextField *parent);
- ~TextFieldLabel();
+ TextFieldLabel(TextField *parent);
+ ~TextFieldLabel();
- inline void setColor(const QColor &color);
- inline void setOffset(const QPointF &pos);
- inline void setScale(qreal scale);
+ inline void setColor(const QColor &color);
+ inline void setOffset(const QPointF &pos);
+ inline void setScale(qreal scale);
- inline QColor color() const;
- inline QPointF offset() const;
- inline qreal scale() const;
+ inline QColor color() const;
+ inline QPointF offset() const;
+ inline qreal scale() const;
protected:
- void paintEvent(QPaintEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
private:
- TextField *const text_field_;
+ TextField *const text_field_;
- QColor color_;
- qreal scale_;
- qreal x_;
- qreal y_;
+ QColor color_;
+ qreal scale_;
+ qreal x_;
+ qreal y_;
};
inline void
TextFieldLabel::setColor(const QColor &color)
{
- color_ = color;
- update();
+ color_ = color;
+ update();
}
inline void
TextFieldLabel::setOffset(const QPointF &pos)
{
- x_ = pos.x();
- y_ = pos.y();
- update();
+ x_ = pos.x();
+ y_ = pos.y();
+ update();
}
inline void
TextFieldLabel::setScale(qreal scale)
{
- scale_ = scale;
- update();
+ scale_ = scale;
+ update();
}
inline QPointF
TextFieldLabel::offset() const
{
- return QPointF(x_, y_);
+ return QPointF(x_, y_);
}
inline qreal
TextFieldLabel::scale() const
{
- return scale_;
+ return scale_;
}
inline QColor
TextFieldLabel::color() const
{
- return color_;
+ return color_;
}
class TextFieldStateMachine : public QStateMachine
{
- Q_OBJECT
+ Q_OBJECT
- Q_PROPERTY(qreal progress WRITE setProgress READ progress)
+ Q_PROPERTY(qreal progress WRITE setProgress READ progress)
public:
- TextFieldStateMachine(TextField *parent);
- ~TextFieldStateMachine();
+ TextFieldStateMachine(TextField *parent);
+ ~TextFieldStateMachine();
- inline void setProgress(qreal progress);
- void setLabel(TextFieldLabel *label);
+ inline void setProgress(qreal progress);
+ void setLabel(TextFieldLabel *label);
- inline qreal progress() const;
+ inline qreal progress() const;
public slots:
- void setupProperties();
+ void setupProperties();
private:
- QPropertyAnimation *color_anim_;
- QPropertyAnimation *offset_anim_;
+ QPropertyAnimation *color_anim_;
+ QPropertyAnimation *offset_anim_;
- QState *focused_state_;
- QState *normal_state_;
+ QState *focused_state_;
+ QState *normal_state_;
- TextField *text_field_;
- TextFieldLabel *label_;
+ TextField *text_field_;
+ TextFieldLabel *label_;
- qreal progress_;
+ qreal progress_;
};
inline void
TextFieldStateMachine::setProgress(qreal progress)
{
- progress_ = progress;
- text_field_->update();
+ progress_ = progress;
+ text_field_->update();
}
inline qreal
TextFieldStateMachine::progress() const
{
- return progress_;
+ return progress_;
}
diff --git a/include/ui/Theme.h b/include/ui/Theme.h
index 9806686c..c2e809e5 100644
--- a/include/ui/Theme.h
+++ b/include/ui/Theme.h
@@ -10,7 +10,7 @@ enum class AvatarType { Icon, Image, Letter };
namespace sidebar
{
-static const int SmallSize = 60;
+static const int SmallSize = 60;
static const int NormalSize = 300;
}
// Default font size.
@@ -32,35 +32,35 @@ enum class ButtonIconPlacement { LeftIcon, RightIcon };
enum class ProgressType { DeterminateProgress, IndeterminateProgress };
enum class Color {
- Black,
- BrightWhite,
- FadedWhite,
- MediumWhite,
- DarkGreen,
- LightGreen,
- BrightGreen,
- Gray,
- Red,
- Blue,
- Transparent
+ Black,
+ BrightWhite,
+ FadedWhite,
+ MediumWhite,
+ DarkGreen,
+ LightGreen,
+ BrightGreen,
+ Gray,
+ Red,
+ Blue,
+ Transparent
};
} // namespace ui
class Theme : public QObject
{
- Q_OBJECT
+ Q_OBJECT
public:
- explicit Theme(QObject *parent = 0);
- ~Theme();
+ explicit Theme(QObject *parent = 0);
+ ~Theme();
- QColor getColor(const QString &key) const;
+ QColor getColor(const QString &key) const;
- void setColor(const QString &key, const QColor &color);
- void setColor(const QString &key, ui::Color color);
+ void setColor(const QString &key, const QColor &color);
+ void setColor(const QString &key, ui::Color color);
private:
- QColor rgba(int r, int g, int b, qreal a) const;
+ QColor rgba(int r, int g, int b, qreal a) const;
- QHash<QString, QColor> colors_;
+ QHash<QString, QColor> colors_;
};
diff --git a/include/ui/ThemeManager.h b/include/ui/ThemeManager.h
index a6947bc9..d35ff754 100644
--- a/include/ui/ThemeManager.h
+++ b/include/ui/ThemeManager.h
@@ -6,26 +6,26 @@
class ThemeManager : public QCommonStyle
{
- Q_OBJECT
+ Q_OBJECT
public:
- inline static ThemeManager &instance();
+ inline static ThemeManager &instance();
- void setTheme(Theme *theme);
- QColor themeColor(const QString &key) const;
+ void setTheme(Theme *theme);
+ QColor themeColor(const QString &key) const;
private:
- ThemeManager();
+ ThemeManager();
- ThemeManager(ThemeManager const &);
- void operator=(ThemeManager const &);
+ ThemeManager(ThemeManager const &);
+ void operator=(ThemeManager const &);
- Theme *theme_;
+ Theme *theme_;
};
inline ThemeManager &
ThemeManager::instance()
{
- static ThemeManager instance;
- return instance;
+ static ThemeManager instance;
+ return instance;
}
|