mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-05-10 05:07:44 +02:00
Switched to a new flat color icon set on Windows/Mac and platform provided icon themes (e.g. Breeze) on Linux with a fallback to the Papirus theme. All the GUI icons are now SVG.
26 lines
621 B
C++
26 lines
621 B
C++
#include <QAction>
|
|
#include "icons.h"
|
|
#include "passwordedit.h"
|
|
|
|
PasswordEdit::PasswordEdit(QWidget *parent) : QLineEdit(parent)
|
|
{
|
|
_show = false;
|
|
_action = addAction(QIcon::fromTheme(SHOW_PWD_ICON),
|
|
QLineEdit::TrailingPosition);
|
|
connect(_action, &QAction::triggered, this, &PasswordEdit::showPassword);
|
|
setEchoMode(QLineEdit::Password);
|
|
}
|
|
|
|
void PasswordEdit::showPassword()
|
|
{
|
|
if (_show) {
|
|
_action->setIcon(QIcon::fromTheme(SHOW_PWD_ICON));
|
|
setEchoMode(QLineEdit::Password);
|
|
_show = false;
|
|
} else {
|
|
_action->setIcon(QIcon::fromTheme(HIDE_PWD_ICON));
|
|
setEchoMode(QLineEdit::Normal);
|
|
_show = true;
|
|
}
|
|
}
|