Moved out PasswordInput to separate module.
This commit is contained in:
parent
4389f17120
commit
225380044e
5 changed files with 49 additions and 15 deletions
|
|
@ -202,6 +202,8 @@ PRIVATE
|
|||
ui/widgets/input_fields.h
|
||||
ui/widgets/labels.cpp
|
||||
ui/widgets/labels.h
|
||||
ui/widgets/fields/password_input.cpp
|
||||
ui/widgets/fields/password_input.h
|
||||
ui/widgets/fields/time_part_input.cpp
|
||||
ui/widgets/fields/time_part_input.h
|
||||
ui/widgets/menu/menu.cpp
|
||||
|
|
|
|||
20
ui/widgets/fields/password_input.cpp
Normal file
20
ui/widgets/fields/password_input.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// This file is part of Desktop App Toolkit,
|
||||
// a set of libraries for developing nice desktop applications.
|
||||
//
|
||||
// For license and copyright information please follow this link:
|
||||
// https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
//
|
||||
#include "ui/widgets/fields/password_input.h"
|
||||
|
||||
namespace Ui {
|
||||
|
||||
PasswordInput::PasswordInput(
|
||||
QWidget *parent,
|
||||
const style::InputField &st,
|
||||
rpl::producer<QString> placeholder,
|
||||
const QString &val)
|
||||
: MaskedInputField(parent, st, std::move(placeholder), val) {
|
||||
QLineEdit::setEchoMode(QLineEdit::Password);
|
||||
}
|
||||
|
||||
} // namespace Ui
|
||||
27
ui/widgets/fields/password_input.h
Normal file
27
ui/widgets/fields/password_input.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// This file is part of Desktop App Toolkit,
|
||||
// a set of libraries for developing nice desktop applications.
|
||||
//
|
||||
// For license and copyright information please follow this link:
|
||||
// https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include "ui/widgets/input_fields.h"
|
||||
|
||||
namespace style {
|
||||
struct InputField;
|
||||
} // namespace style
|
||||
|
||||
namespace Ui {
|
||||
|
||||
class PasswordInput final : public MaskedInputField {
|
||||
public:
|
||||
PasswordInput(
|
||||
QWidget *parent,
|
||||
const style::InputField &st,
|
||||
rpl::producer<QString> placeholder = nullptr,
|
||||
const QString &val = QString());
|
||||
|
||||
};
|
||||
|
||||
} // namespace Ui
|
||||
|
|
@ -4349,15 +4349,6 @@ void MaskedInputField::onCursorPositionChanged(int oldPosition, int position) {
|
|||
_oldcursor = position;
|
||||
}
|
||||
|
||||
PasswordInput::PasswordInput(
|
||||
QWidget *parent,
|
||||
const style::InputField &st,
|
||||
rpl::producer<QString> placeholder,
|
||||
const QString &val)
|
||||
: MaskedInputField(parent, st, std::move(placeholder), val) {
|
||||
setEchoMode(QLineEdit::Password);
|
||||
}
|
||||
|
||||
NumberInput::NumberInput(
|
||||
QWidget *parent,
|
||||
const style::InputField &st,
|
||||
|
|
|
|||
|
|
@ -718,12 +718,6 @@ private:
|
|||
|
||||
};
|
||||
|
||||
class PasswordInput : public MaskedInputField {
|
||||
public:
|
||||
PasswordInput(QWidget *parent, const style::InputField &st, rpl::producer<QString> placeholder = nullptr, const QString &val = QString());
|
||||
|
||||
};
|
||||
|
||||
class NumberInput : public MaskedInputField {
|
||||
public:
|
||||
NumberInput(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue