Skip to content

Commit

Permalink
Revise: switch to using icons from theme for show/hide password
Browse files Browse the repository at this point in the history
And provide some `.png` icons if they are not in the current desktop theme
(on Linux/FreeBSD) or the OS does not provide such a system for them...

These icons were created by myself and I will licensing them under GPL 2.0
(or later terms).

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
  • Loading branch information
SlySven committed Sep 15, 2019
1 parent 3c87b0f commit de45837
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/dlgConnectionProfiles.cpp
Expand Up @@ -2411,11 +2411,11 @@ void dlgConnectionProfiles::slot_togglePasswordVisibility(const bool showPasswor
// In practice I could not get the icon to change based upon supplying
// different QPixmaps for the QIcon for different states - so lets do it
// directly:
mpAction_revealPassword->setIcon(QPixmap(QStringLiteral(":/icons/layer-visible-on.png")));
mpAction_revealPassword->setIcon(QIcon::fromTheme(QStringLiteral("password-show-on"), QIcon(QStringLiteral(":/icons/password-show-on.png"))));
mpAction_revealPassword->setToolTip(tr("<p>Click to hide the password; it will also hide if another profile is selected.</p>"));
} else {
character_password_entry->setEchoMode(QLineEdit::Password);
mpAction_revealPassword->setIcon(QPixmap(QStringLiteral(":/icons/layer-visible-off-redlined.png")));
mpAction_revealPassword->setIcon(QIcon::fromTheme(QStringLiteral("password-show-off"), QIcon(QStringLiteral(":/icons/password-show-off.png"))));
mpAction_revealPassword->setToolTip(tr("<p>Click to reveal the password for this profile.</p>"));
}
}
Binary file removed src/icons/layer-visible-off-redlined.png
Binary file not shown.
Binary file removed src/icons/layer-visible-on.png
Binary file not shown.
Binary file added src/icons/password-show-off.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/password-show-on.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/mudlet.qrc
Expand Up @@ -107,8 +107,6 @@
<file>icons/imperian_120_30.png</file>
<file>icons/import.png</file>
<file>icons/internet-telephony.png</file>
<file>icons/layer-visible-off-redlined.png</file>
<file>icons/layer-visible-on.png</file>
<file>icons/luminari_icon.png</file>
<file>icons/lusternia_120_30.png</file>
<file>icons/media-optical.png</file>
Expand Down Expand Up @@ -136,6 +134,8 @@
<file>icons/offsettimer-on.png</file>
<file>icons/package-manager.png</file>
<file>icons/package-exporter.png</file>
<file>icons/password-show-off.png</file>
<file>icons/password-show-on.png</file>
<file>icons/Patreon_Mark_Primary.png</file>
<file>icons/place_of_interest.png</file>
<file>icons/preferences-desktop-keyboard.png</file>
Expand Down

0 comments on commit de45837

Please sign in to comment.