fix: Cycle titlebar focus to tab bar after Super+Tab - #543
Conversation
log: Take over Tab/Shift+Tab in MainWindow::eventFilter via titlebarFocusRing(): AddButton -> Option -> QuitFullscreen -> Min -> Max -> Close -> tab bar -> wrap. The tab station focuses the DTabBar inner QTabBar so the current tab shows focus. setTabOrder was unreliable across the cross-subtree titlebar widget tree and is removed. Quake window does not override the ring, so its behavior is unchanged. pms: bug-283709
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 当前代码已非常完善,无需额外改进代码示例。
// 以下为原代码片段的合规性确认展示:
QList<QWidget *> NormalWindow::titlebarFocusRing()
{
QList<QWidget *> ring;
QWidget *tabStation = nullptr;
if (m_tabbar != nullptr) {
tabStation = m_tabbar->findChild<QTabBar *>();
if (tabStation == nullptr)
tabStation = m_tabbar;
tabStation->setFocusPolicy(Qt::TabFocus);
}
const QList<QWidget *> candidates = {
m_tabbar ? m_tabbar->findChild<DIconButton *>("AddButton") : nullptr,
titlebar()->findChild<DIconButton *>("DTitlebarDWindowOptionButton"),
titlebar()->findChild<QWidget *>("DTitlebarDWindowQuitFullscreenButton"),
titlebar()->findChild<DIconButton *>("DTitlebarDWindowMinButton"),
titlebar()->findChild<DIconButton *>("DTitlebarDWindowMaxButton"),
titlebar()->findChild<DIconButton *>("DTitlebarDWindowCloseButton"),
tabStation,
};
for (QWidget *w : candidates) {
if (w != nullptr && w->isVisible() && w->isEnabled())
ring.append(w);
}
return ring;
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JWWTSL, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: unknown) |
log: Take over Tab/Shift+Tab in MainWindow::eventFilter via titlebarFocusRing(): AddButton -> Option -> QuitFullscreen -> Min -> Max -> Close -> tab bar -> wrap. The tab station focuses the DTabBar inner QTabBar so the current tab shows focus. setTabOrder was unreliable across the cross-subtree titlebar widget tree and is removed. Quake window does not override the ring, so its behavior is unchanged.
pms: bug-283709