mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
macOS: Get rid of text field's focus border
This commit is contained in:
parent
21c2f96061
commit
9189782d3b
1 changed files with 7 additions and 4 deletions
|
@ -10,19 +10,22 @@
|
||||||
TextField::TextField(QWidget *parent)
|
TextField::TextField(QWidget *parent)
|
||||||
: QLineEdit(parent)
|
: QLineEdit(parent)
|
||||||
{
|
{
|
||||||
|
// Get rid of the focus border on macOS.
|
||||||
|
setAttribute(Qt::WA_MacShowFocusRect, 0);
|
||||||
|
|
||||||
state_machine_ = new TextFieldStateMachine(this);
|
state_machine_ = new TextFieldStateMachine(this);
|
||||||
label_ = 0;
|
label_ = 0;
|
||||||
label_font_size_ = 9.5;
|
label_font_size_ = 13;
|
||||||
show_label_ = false;
|
show_label_ = false;
|
||||||
background_color_ = QColor("white");
|
background_color_ = QColor("white");
|
||||||
|
|
||||||
setFrame(false);
|
setFrame(false);
|
||||||
setAttribute(Qt::WA_Hover);
|
setAttribute(Qt::WA_Hover);
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
setTextMargins(0, 2, 0, 4);
|
setTextMargins(0, 4, 0, 6);
|
||||||
|
|
||||||
QFontDatabase db;
|
QFont font("Open Sans");
|
||||||
QFont font(db.font("Open Sans", "Regular", 11));
|
font.setPixelSize(12);
|
||||||
setFont(font);
|
setFont(font);
|
||||||
|
|
||||||
state_machine_->start();
|
state_machine_->start();
|
||||||
|
|
Loading…
Reference in a new issue