mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
parent
7a288cc2cb
commit
c9427c7f17
2 changed files with 11 additions and 1 deletions
|
@ -69,7 +69,6 @@ TextLabel::TextLabel(const QString &text, QWidget *parent)
|
||||||
&TextLabel::adjustHeight);
|
&TextLabel::adjustHeight);
|
||||||
document()->setDocumentMargin(0);
|
document()->setDocumentMargin(0);
|
||||||
|
|
||||||
setFocusPolicy(Qt::NoFocus);
|
|
||||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||||
setFixedHeight(0);
|
setFixedHeight(0);
|
||||||
|
|
||||||
|
@ -94,6 +93,16 @@ TextLabel::TextLabel(const QString &text, QWidget *parent)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TextLabel::focusOutEvent(QFocusEvent *e)
|
||||||
|
{
|
||||||
|
QTextBrowser::focusOutEvent(e);
|
||||||
|
|
||||||
|
QTextCursor cursor = textCursor();
|
||||||
|
cursor.clearSelection();
|
||||||
|
setTextCursor(cursor);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TextLabel::mousePressEvent(QMouseEvent *e)
|
TextLabel::mousePressEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -110,6 +110,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent(QMouseEvent *e) override;
|
void mousePressEvent(QMouseEvent *e) override;
|
||||||
void mouseReleaseEvent(QMouseEvent *e) override;
|
void mouseReleaseEvent(QMouseEvent *e) override;
|
||||||
|
void focusOutEvent(QFocusEvent* e) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void adjustHeight(const QSizeF &size) { setFixedHeight(size.height()); }
|
void adjustHeight(const QSizeF &size) { setFixedHeight(size.height()); }
|
||||||
|
|
Loading…
Reference in a new issue