mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Update russian translation. Need to subtract and to bring the terminology to a common denominator
This commit is contained in:
39
custom_widgets/yacreader_field_edit.cpp
Normal file
39
custom_widgets/yacreader_field_edit.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
#include "yacreader_field_edit.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QFocusEvent>
|
||||
|
||||
YACReaderFieldEdit::YACReaderFieldEdit(QWidget * parent)
|
||||
:QLineEdit(parent)
|
||||
{
|
||||
setPlaceholderText(tr("Click to overwrite"));
|
||||
setModified(false);
|
||||
restore = new QAction(tr("Restore to default"),this);
|
||||
this->addAction(restore);
|
||||
//this->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
}
|
||||
|
||||
void YACReaderFieldEdit::focusInEvent(QFocusEvent* e)
|
||||
{
|
||||
if (e->reason() == Qt::MouseFocusReason)
|
||||
{
|
||||
setModified(true);
|
||||
setPlaceholderText("");
|
||||
}
|
||||
|
||||
QLineEdit::focusInEvent(e);
|
||||
}
|
||||
|
||||
void YACReaderFieldEdit::clear()
|
||||
{
|
||||
setPlaceholderText(tr("Click to overwrite"));
|
||||
QLineEdit::clear();
|
||||
QLineEdit::setModified(false);
|
||||
}
|
||||
|
||||
void YACReaderFieldEdit::setDisabled(bool disabled)
|
||||
{
|
||||
if(disabled)
|
||||
setPlaceholderText("");
|
||||
QLineEdit::setDisabled(disabled);
|
||||
}
|
Reference in New Issue
Block a user