Made all focus related code optional - only if FocusStyling flag is enabled
This commit is contained in:
@@ -285,7 +285,10 @@ CDockWidgetTab::CDockWidgetTab(CDockWidget* DockWidget, QWidget *parent) :
|
||||
setAttribute(Qt::WA_NoMousePropagation, true);
|
||||
d->DockWidget = DockWidget;
|
||||
d->createLayout();
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
if (CDockManager::configFlags().testFlag(CDockManager::FocusStyling))
|
||||
{
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
}
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
@@ -464,21 +467,25 @@ void CDockWidgetTab::setActiveTab(bool active)
|
||||
bool TabHasCloseButton = (ActiveTabHasCloseButton && active) | AllTabsHaveCloseButton;
|
||||
d->CloseButton->setVisible(DockWidgetClosable && TabHasCloseButton);
|
||||
|
||||
bool UpdateFocusStyle = false;
|
||||
if (active && !hasFocus())
|
||||
if (CDockManager::configFlags().testFlag(CDockManager::FocusStyling))
|
||||
{
|
||||
setFocus(Qt::OtherFocusReason);
|
||||
UpdateFocusStyle = true;
|
||||
bool UpdateFocusStyle = false;
|
||||
if (active && !hasFocus())
|
||||
{
|
||||
setFocus(Qt::OtherFocusReason);
|
||||
UpdateFocusStyle = true;
|
||||
}
|
||||
|
||||
if (d->IsActiveTab == active)
|
||||
{
|
||||
if (UpdateFocusStyle)
|
||||
{
|
||||
updateStyle();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (d->IsActiveTab == active)
|
||||
{
|
||||
if (UpdateFocusStyle)
|
||||
{
|
||||
updateStyle();
|
||||
}
|
||||
return;
|
||||
}
|
||||
d->IsActiveTab = active;
|
||||
updateStyle();
|
||||
update();
|
||||
|
||||
Reference in New Issue
Block a user