mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
Fix keyboard focus issues on Main window
This commit is contained in:
parent
6049b2ce03
commit
32c0b7801c
2 changed files with 9 additions and 2 deletions
|
@ -64,6 +64,9 @@ public:
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
|
||||||
setStyleSheet("QListWidget { background: transparent; border: 0 }");
|
setStyleSheet("QListWidget { background: transparent; border: 0 }");
|
||||||
|
#if defined(Q_WS_MAC)
|
||||||
|
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redefine addItem() to make sure the list stays sorted
|
// Redefine addItem() to make sure the list stays sorted
|
||||||
|
@ -161,6 +164,9 @@ public:
|
||||||
// Height is fixed (sizeHint().height() is used)
|
// Height is fixed (sizeHint().height() is used)
|
||||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||||
setStyleSheet("QListWidget { background: transparent; border: 0 }");
|
setStyleSheet("QListWidget { background: transparent; border: 0 }");
|
||||||
|
#if defined(Q_WS_MAC)
|
||||||
|
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -202,14 +208,12 @@ public:
|
||||||
vLayout->addWidget(torrentsLabel);
|
vLayout->addWidget(torrentsLabel);
|
||||||
statusFilters = new StatusFiltersWidget(this);
|
statusFilters = new StatusFiltersWidget(this);
|
||||||
vLayout->addWidget(statusFilters);
|
vLayout->addWidget(statusFilters);
|
||||||
statusFilters->setFocusPolicy(Qt::NoFocus);
|
|
||||||
QLabel *labelsLabel = new QLabel(tr("Labels"));
|
QLabel *labelsLabel = new QLabel(tr("Labels"));
|
||||||
labelsLabel->setIndent(2);
|
labelsLabel->setIndent(2);
|
||||||
labelsLabel->setFont(font);
|
labelsLabel->setFont(font);
|
||||||
vLayout->addWidget(labelsLabel);
|
vLayout->addWidget(labelsLabel);
|
||||||
labelFilters = new LabelFiltersList(this);
|
labelFilters = new LabelFiltersList(this);
|
||||||
vLayout->addWidget(labelFilters);
|
vLayout->addWidget(labelFilters);
|
||||||
labelFilters->setFocusPolicy(Qt::NoFocus);
|
|
||||||
setLayout(vLayout);
|
setLayout(vLayout);
|
||||||
labelFilters->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
labelFilters->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
statusFilters->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
statusFilters->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
|
|
@ -106,6 +106,9 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window,
|
||||||
setItemsExpandable(false);
|
setItemsExpandable(false);
|
||||||
setAutoScroll(true);
|
setAutoScroll(true);
|
||||||
setDragDropMode(QAbstractItemView::DragOnly);
|
setDragDropMode(QAbstractItemView::DragOnly);
|
||||||
|
#if defined(Q_WS_MAC)
|
||||||
|
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Default hidden columns
|
// Default hidden columns
|
||||||
if(!column_loaded) {
|
if(!column_loaded) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue