Micro-optimize RenderWidgetHasFocus().
This commit is contained in:
parent
74291017e5
commit
1d4b3a90eb
|
@ -261,16 +261,6 @@ void DMainWindow::OnCoreStateChanged(Core::EState state)
|
||||||
m_game_tracker->setEnabled(is_not_initialized);
|
m_game_tracker->setEnabled(is_not_initialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DMainWindow::RenderWidgetHasFocus()
|
|
||||||
{
|
|
||||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
|
|
||||||
return isActiveWindow();
|
|
||||||
else if (m_render_widget != nullptr)
|
|
||||||
return m_render_widget->isActiveWindow();
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update all the icons used in DMainWindow with fresh ones from
|
// Update all the icons used in DMainWindow with fresh ones from
|
||||||
// "Resources". Call this function after changing the icon theme.
|
// "Resources". Call this function after changing the icon theme.
|
||||||
void DMainWindow::UpdateIcons()
|
void DMainWindow::UpdateIcons()
|
||||||
|
|
|
@ -27,7 +27,7 @@ public:
|
||||||
~DMainWindow();
|
~DMainWindow();
|
||||||
|
|
||||||
// DRenderWidget
|
// DRenderWidget
|
||||||
bool RenderWidgetHasFocus();
|
bool RenderWidgetHasFocus() const { return m_render_widget->isActiveWindow(); }
|
||||||
DRenderWidget* GetRenderWidget() { return m_render_widget.get(); }
|
DRenderWidget* GetRenderWidget() { return m_render_widget.get(); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
Loading…
Reference in New Issue