mirror of
https://github.com/YACReader/yacreader
synced 2025-09-09 23:05:25 -04:00
bug fixes en properties dialog
This commit is contained in:
@ -396,9 +396,9 @@ void YACReaderFieldEdit::focusInEvent(QFocusEvent* e)
|
||||
|
||||
void YACReaderFieldEdit::clear()
|
||||
{
|
||||
setModified(false);
|
||||
setPlaceholderText(tr("Click to overwrite"));
|
||||
QLineEdit::clear();
|
||||
QLineEdit::setModified(false);
|
||||
}
|
||||
|
||||
void YACReaderFieldEdit::setDisabled(bool disabled)
|
||||
@ -422,15 +422,30 @@ YACReaderFieldPlainTextEdit::YACReaderFieldPlainTextEdit(QWidget * parent)
|
||||
|
||||
void YACReaderFieldPlainTextEdit::focusInEvent(QFocusEvent* e)
|
||||
{
|
||||
if (e->reason() == Qt::MouseFocusReason)
|
||||
if (e->reason() == Qt::MouseFocusReason || e->reason() == Qt::TabFocusReason)
|
||||
{
|
||||
document()->setModified(true);
|
||||
setPlainText("");
|
||||
if(toPlainText()==tr("Click to overwrite"))
|
||||
setPlainText("");
|
||||
}
|
||||
|
||||
QPlainTextEdit::focusInEvent(e);
|
||||
}
|
||||
|
||||
void YACReaderFieldPlainTextEdit::focusOutEvent(QFocusEvent* e)
|
||||
{
|
||||
/*if (e->reason() == Qt::MouseFocusReason || e->reason() == Qt::TabFocusReason)
|
||||
{
|
||||
if(toPlainText().isEmpty())
|
||||
{
|
||||
setPlainText(tr("Click to overwrite"));
|
||||
document()->setModified(false);
|
||||
}
|
||||
}
|
||||
*/
|
||||
QPlainTextEdit::focusOutEvent(e);
|
||||
}
|
||||
|
||||
void YACReaderFieldPlainTextEdit::clear()
|
||||
{
|
||||
QPlainTextEdit::clear();
|
||||
|
@ -162,6 +162,7 @@ class YACReaderFieldPlainTextEdit : public QPlainTextEdit
|
||||
void setDisabled(bool disabled);
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent* e);
|
||||
void focusOutEvent(QFocusEvent* e);
|
||||
private:
|
||||
QAction * restore;
|
||||
|
||||
@ -185,3 +186,4 @@ private:
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user