mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +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);
|
||||
document()->setDocumentMargin(0);
|
||||
|
||||
setFocusPolicy(Qt::NoFocus);
|
||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||
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
|
||||
TextLabel::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
|
|
|
@ -110,6 +110,7 @@ public:
|
|||
protected:
|
||||
void mousePressEvent(QMouseEvent *e) override;
|
||||
void mouseReleaseEvent(QMouseEvent *e) override;
|
||||
void focusOutEvent(QFocusEvent* e) override;
|
||||
|
||||
private slots:
|
||||
void adjustHeight(const QSizeF &size) { setFixedHeight(size.height()); }
|
||||
|
|
Loading…
Reference in a new issue