Skip to content

Commit

Permalink
[lipstick] Add transient property to notification component. Contribu…
Browse files Browse the repository at this point in the history
…tes to JB#51293
  • Loading branch information
pvuorela committed Sep 24, 2020
1 parent fc665e3 commit dd8bb08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/notifications/lipsticknotification.cpp
Expand Up @@ -194,6 +194,7 @@ void LipstickNotification::setHints(const QVariantHash &hints)
QString oldCategory = category();
qreal oldProgress = progress();
bool oldHasProgress = hasProgress();
bool oldIsTransient = isTransient();

m_hints = hints;
updateHintValues();
Expand Down Expand Up @@ -244,6 +245,10 @@ void LipstickNotification::setHints(const QVariantHash &hints)
emit progressChanged();
}

if (oldIsTransient != isTransient()) {
emit isTransientChanged();
}

emit hintsChanged();
}

Expand Down
3 changes: 3 additions & 0 deletions src/notifications/lipsticknotification.h
Expand Up @@ -52,6 +52,7 @@ class LIPSTICK_EXPORT LipstickNotification : public QObject
Q_PROPERTY(QString owner READ owner CONSTANT)
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
Q_PROPERTY(bool hasProgress READ hasProgress NOTIFY hasProgressChanged)
Q_PROPERTY(bool isTransient READ isTransient NOTIFY isTransientChanged)

public:
enum Urgency { Low = 0, Normal = 1, Critical = 2 };
Expand Down Expand Up @@ -326,6 +327,8 @@ class LIPSTICK_EXPORT LipstickNotification : public QObject
void hasProgressChanged();
void progressChanged();

void isTransientChanged();

private:
void updateHintValues();

Expand Down

0 comments on commit dd8bb08

Please sign in to comment.