From 9189782d3bdd19b831a1738679ce1fc41cc569a1 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sat, 12 Aug 2017 13:21:52 +0300 Subject: [PATCH] macOS: Get rid of text field's focus border --- src/ui/TextField.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ui/TextField.cc b/src/ui/TextField.cc index fea808bb..ca2c3c11 100644 --- a/src/ui/TextField.cc +++ b/src/ui/TextField.cc @@ -10,19 +10,22 @@ TextField::TextField(QWidget *parent) : QLineEdit(parent) { + // Get rid of the focus border on macOS. + setAttribute(Qt::WA_MacShowFocusRect, 0); + state_machine_ = new TextFieldStateMachine(this); label_ = 0; - label_font_size_ = 9.5; + label_font_size_ = 13; show_label_ = false; background_color_ = QColor("white"); setFrame(false); setAttribute(Qt::WA_Hover); setMouseTracking(true); - setTextMargins(0, 2, 0, 4); + setTextMargins(0, 4, 0, 6); - QFontDatabase db; - QFont font(db.font("Open Sans", "Regular", 11)); + QFont font("Open Sans"); + font.setPixelSize(12); setFont(font); state_machine_->start();