diff --git a/COPYING b/COPYING index 7e24fcf66..451a32322 100644 --- a/COPYING +++ b/COPYING @@ -239,6 +239,9 @@ Files: share/icons/application/scalable/actions/application-exit.svg share/icons/application/scalable/status/dialog-information.svg share/icons/application/scalable/status/dialog-warning.svg share/icons/application/scalable/status/security-high.svg + share/icons/application/scalable/actions/lock-open-alert.svg + share/icons/application/scalable/actions/lock-open.svg + share/icons/application/scalable/actions/lock.svg Copyright: 2019 Austin Andrews License: SIL OPEN FONT LICENSE Version 1.1 Comment: Taken from Material Design icon set (https://github.com/templarian/MaterialDesign/) diff --git a/share/icons/application/scalable/actions/lock-open-alert.svg b/share/icons/application/scalable/actions/lock-open-alert.svg new file mode 100644 index 000000000..348537f09 --- /dev/null +++ b/share/icons/application/scalable/actions/lock-open-alert.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/lock-open.svg b/share/icons/application/scalable/actions/lock-open.svg new file mode 100644 index 000000000..ffe75da95 --- /dev/null +++ b/share/icons/application/scalable/actions/lock-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/lock.svg b/share/icons/application/scalable/actions/lock.svg new file mode 100644 index 000000000..5c0eb3f66 --- /dev/null +++ b/share/icons/application/scalable/actions/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/icons.qrc b/share/icons/icons.qrc index a846bf7bc..a447de0e3 100644 --- a/share/icons/icons.qrc +++ b/share/icons/icons.qrc @@ -55,6 +55,9 @@ application/scalable/actions/hibp.svg application/scalable/actions/lock-question.svg application/scalable/actions/keyboard-shortcuts.svg + application/scalable/actions/lock.svg + application/scalable/actions/lock-open.svg + application/scalable/actions/lock-open-alert.svg application/scalable/actions/message-close.svg application/scalable/actions/move-down.svg application/scalable/actions/move-up.svg diff --git a/share/translations/keepassxc_en.ts b/share/translations/keepassxc_en.ts index 9c9cc2917..626a03533 100644 --- a/share/translations/keepassxc_en.ts +++ b/share/translations/keepassxc_en.ts @@ -8674,29 +8674,14 @@ This option is deprecated, use --set-key-file instead. Hover over reason to show additional details. Double-click entries to edit. - - Bad - Password quality - - Bad — password must be changed - - Poor - Password quality - - Poor — password should be changed - - Weak - Password quality - - Weak — consider changing the password diff --git a/src/gui/entry/EntryModel.cpp b/src/gui/entry/EntryModel.cpp index 95c9cefb2..dc7da3282 100644 --- a/src/gui/entry/EntryModel.cpp +++ b/src/gui/entry/EntryModel.cpp @@ -286,24 +286,30 @@ QVariant EntryModel::data(const QModelIndex& index, int role) const break; case PasswordStrength: if (!entry->password().isEmpty() && !entry->excludeFromReports()) { + QString iconName = "lock-question"; StateColorPalette statePalette; QColor color = statePalette.color(StateColorPalette::Error); switch (entry->passwordHealth()->quality()) { case PasswordHealth::Quality::Bad: case PasswordHealth::Quality::Poor: + iconName = "lock-open-alert"; color = statePalette.color(StateColorPalette::HealthCritical); break; case PasswordHealth::Quality::Weak: + iconName = "lock-open"; color = statePalette.color(StateColorPalette::HealthBad); break; case PasswordHealth::Quality::Good: case PasswordHealth::Quality::Excellent: + iconName = "lock"; color = statePalette.color(StateColorPalette::HealthExcellent); break; } - return color; + if (color.isValid()) { + return icons()->icon(iconName, true, color); + } } break; } diff --git a/src/gui/reports/ReportsWidgetHealthcheck.cpp b/src/gui/reports/ReportsWidgetHealthcheck.cpp index 9bf122f9d..afce4ad27 100644 --- a/src/gui/reports/ReportsWidgetHealthcheck.cpp +++ b/src/gui/reports/ReportsWidgetHealthcheck.cpp @@ -167,31 +167,32 @@ void ReportsWidgetHealthcheck::addHealthRow(QSharedPointer healt Entry* entry, bool excluded) { - QString descr, tip; + QString tip; + QString iconName = "lock-question"; QColor qualityColor; StateColorPalette statePalette; const auto quality = health->quality(); switch (quality) { case PasswordHealth::Quality::Bad: - descr = tr("Bad", "Password quality"); tip = tr("Bad — password must be changed"); + iconName = "lock-open-alert"; qualityColor = statePalette.color(StateColorPalette::HealthCritical); break; - case PasswordHealth::Quality::Poor: - descr = tr("Poor", "Password quality"); tip = tr("Poor — password should be changed"); + iconName = "lock-open-alert"; qualityColor = statePalette.color(StateColorPalette::HealthBad); break; case PasswordHealth::Quality::Weak: - descr = tr("Weak", "Password quality"); tip = tr("Weak — consider changing the password"); + iconName = "lock-open"; qualityColor = statePalette.color(StateColorPalette::HealthWeak); break; case PasswordHealth::Quality::Good: case PasswordHealth::Quality::Excellent: + iconName = "lock"; qualityColor = statePalette.color(StateColorPalette::HealthOk); break; } @@ -205,7 +206,7 @@ void ReportsWidgetHealthcheck::addHealthRow(QSharedPointer healt } auto row = QList(); - row << new QStandardItem(descr); + row << new QStandardItem(Icons::instance()->icon(iconName, true, qualityColor), ""); row << new QStandardItem(Icons::entryIconPixmap(entry), title); row << new QStandardItem(Icons::groupIconPixmap(group), group->hierarchy().join("/")); row << new QStandardItem(QString::number(health->score())); @@ -216,7 +217,6 @@ void ReportsWidgetHealthcheck::addHealthRow(QSharedPointer healt // invisible, it's just for screen readers etc. QBrush brush(qualityColor); row[0]->setForeground(brush); - row[0]->setBackground(brush); // Set tooltips row[0]->setToolTip(tip);