Skip to content

Commit

Permalink
sync: from linuxdeepin/dtkwidget
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/dtkwidget.

Source-pull-request: linuxdeepin/dtkwidget#556
  • Loading branch information
deepin-ci-robot authored and FeiWang1119 committed Mar 7, 2024
1 parent b51ab45 commit 4f9e22b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 22 deletions.
20 changes: 1 addition & 19 deletions src/widgets/dlineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ void DLineEdit::setEchoMode(QLineEdit::EchoMode mode)
{
D_D(DLineEdit);
d->lineEdit->setEchoMode(mode);
d->updateFont();
}

/*!
Expand Down Expand Up @@ -668,8 +667,6 @@ bool DLineEdit::eventFilter(QObject *watched, QEvent *event)
event->accept();
pLineEdit->setFocus();
return true;
} else if (event->type() == QEvent::FontChange) {
d->updateFont();
}

// if (d->frame)
Expand Down Expand Up @@ -705,20 +702,7 @@ DLineEditPrivate::DLineEditPrivate(DLineEdit *q)

void DLineEditPrivate::updateTooltipPos()
{
}

void DLineEditPrivate::updateFont()
{
Q_Q(DLineEdit);

if (lineEdit->echoMode() == QLineEdit::Password) {
QFont passwordFont = lineEdit->font();
passwordFont.setPixelSize(6);
passwordFont.setLetterSpacing(passwordFont.letterSpacingType(), 200);
lineEdit->setFont(passwordFont);
} else {
lineEdit->setFont(q->font());
}
//control->updateTooltipPos();
}

void DLineEditPrivate::init()
Expand Down Expand Up @@ -748,8 +732,6 @@ void DLineEditPrivate::init()
q->connect(lineEdit, &QLineEdit::returnPressed, q, &DLineEdit::returnPressed);
q->connect(lineEdit, &QLineEdit::editingFinished, q, &DLineEdit::editingFinished);
q->connect(lineEdit, &QLineEdit::selectionChanged, q, &DLineEdit::selectionChanged);

updateFont();
}

DWIDGET_END_NAMESPACE
2 changes: 1 addition & 1 deletion src/widgets/dpasswordedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void DPasswordEditPrivate::init()
{
D_Q(DPasswordEdit);

q->DLineEdit::setEchoMode(QLineEdit::Password);
q->lineEdit()->setEchoMode(QLineEdit::Password);
q->lineEdit()->setAttribute(Qt::WA_InputMethodEnabled, false);

QList<QWidget *> list;
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/dstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ int DStyle::styleHint(QStyle::StyleHint sh, const QStyleOption *opt, const QWidg
case SH_ScrollView_FrameOnlyAroundContents:
return false;
case SH_LineEdit_PasswordCharacter:
return 0x25CF;
return 0x26AB;
default:
break;
}
Expand Down
1 change: 0 additions & 1 deletion src/widgets/private/dlineedit_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class DLineEditPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate
public:
DLineEditPrivate(DLineEdit *q);
void updateTooltipPos();
void updateFont();

void init();

Expand Down

0 comments on commit 4f9e22b

Please sign in to comment.