FocusScope: Also focus when the user clicks on tab widget background
Relevant when you don't have a title bar
This commit is contained in:
@@ -88,6 +88,16 @@ void TabWidgetWidget::mouseDoubleClickEvent(QMouseEvent *ev)
|
||||
}
|
||||
}
|
||||
|
||||
void TabWidgetWidget::mousePressEvent(QMouseEvent *ev)
|
||||
{
|
||||
QTabWidget::mousePressEvent(ev);
|
||||
|
||||
if ((Config::self().flags() & Config::Flag_TitleBarIsFocusable) && !frame()->isFocused()) {
|
||||
// User clicked on the tab widget itself
|
||||
frame()->FocusScope::focus(Qt::MouseFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
void TabWidgetWidget::tabInserted(int)
|
||||
{
|
||||
onTabInserted();
|
||||
|
||||
@@ -42,6 +42,7 @@ public:
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent *) override;
|
||||
void mousePressEvent(QMouseEvent *) override;
|
||||
void tabInserted(int index) override;
|
||||
void tabRemoved(int index) override;
|
||||
bool isPositionDraggable(QPoint p) const override;
|
||||
|
||||
Reference in New Issue
Block a user