remove focus rectangle on Mac

This commit is contained in:
Le Tan 2017-12-09 16:15:01 +08:00
parent 1410c16280
commit 5ca9ea6b92
8 changed files with 8 additions and 1 deletions

View File

@ -93,6 +93,7 @@ void VConfirmDeletionDialog::setupUI(const QString &p_title,
labelLayout->setContentsMargins(0, 0, 0, 0);
m_listWidget = new QListWidget();
m_listWidget->setAttribute(Qt::WA_MacShowFocusRect, false);
connect(m_listWidget, &QListWidget::currentRowChanged,
this, &VConfirmDeletionDialog::currentFileChanged);
connect(m_listWidget, &QListWidget::itemActivated,

View File

@ -19,6 +19,7 @@ public:
explicit VTreeWidget(QWidget *p_parent = 0)
: QTreeWidget(p_parent)
{
setAttribute(Qt::WA_MacShowFocusRect, false);
}
protected:

View File

@ -3,7 +3,7 @@
#include <QDebug>
#include <QRegExp>
#include <QByteArray>
#include <QPixMap>
#include <QPixmap>
#include <QFileInfo>
#include "vutils.h"

View File

@ -101,6 +101,7 @@ void VAttachmentList::setupUI()
m_attachmentList->setContextMenuPolicy(Qt::CustomContextMenu);
m_attachmentList->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_attachmentList->setEditTriggers(QAbstractItemView::SelectedClicked);
m_attachmentList->setAttribute(Qt::WA_MacShowFocusRect, false);
connect(m_attachmentList, &QListWidget::customContextMenuRequested,
this, &VAttachmentList::handleContextMenuRequested);
connect(m_attachmentList, &QListWidget::itemActivated,

View File

@ -30,6 +30,7 @@ VDirectoryTree::VDirectoryTree(QWidget *parent)
setColumnCount(1);
setHeaderHidden(true);
setContextMenuPolicy(Qt::CustomContextMenu);
setAttribute(Qt::WA_MacShowFocusRect, false);
initShortcuts();
initActions();

View File

@ -41,6 +41,7 @@ void VFileList::setupUI()
fileList->setContextMenuPolicy(Qt::CustomContextMenu);
fileList->setSelectionMode(QAbstractItemView::ExtendedSelection);
fileList->setObjectName("FileList");
fileList->setAttribute(Qt::WA_MacShowFocusRect, false);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(fileList);

View File

@ -18,6 +18,7 @@ VOutline::VOutline(QWidget *parent)
setColumnCount(1);
setHeaderHidden(true);
setSelectionMode(QAbstractItemView::SingleSelection);
setAttribute(Qt::WA_MacShowFocusRect, false);
// TODO: jump to the header when user click the same item twice.
connect(this, &VOutline::currentItemChanged,

View File

@ -69,6 +69,7 @@ void VSnippetList::setupUI()
btnLayout->setContentsMargins(0, 0, 3, 0);
m_snippetList = new QListWidget();
m_snippetList->setAttribute(Qt::WA_MacShowFocusRect, false);
m_snippetList->setContextMenuPolicy(Qt::CustomContextMenu);
m_snippetList->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_snippetList->setEditTriggers(QAbstractItemView::SelectedClicked);