Skip to content

Commit

Permalink
Add support for placing the tab bar on the title bar (#2428) (3)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Sep 29, 2024
1 parent f612815 commit 83d635a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Src/Common/MDITabBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,8 @@ CSize CMDITabBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)

LRESULT CMDITabBar::OnNcHitTest(CPoint point)
{
if (!m_bOnTitleBar)
return __super::OnNcHitTest(point);
return m_titleBar.OnNcHitTest(point);
}

Expand Down Expand Up @@ -701,7 +703,6 @@ void CMDITabBar::OnNcRButtonUp(UINT nHitTest, CPoint point)
void CMDITabBar::OnSize(UINT nType, int cx, int cy)
{
__super::OnSize(nType, cx, cy);
Invalidate();
m_titleBar.OnSize(m_bMaximized, cx, cy);
if (m_tabCtrl.m_hWnd)
{
Expand All @@ -728,8 +729,6 @@ void CMDITabBar::OnPaint()
if (!m_bOnTitleBar)
return __super::OnPaint();
CPaintDC dc(this);
CRect rcClient;
GetClientRect(&rcClient);
m_titleBar.DrawIcon(AfxGetMainWnd(), dc);
m_titleBar.DrawButtons(dc);
}
2 changes: 1 addition & 1 deletion Src/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2268,7 +2268,7 @@ void CMainFrame::OnViewTabBar()
}

/**
* @brief Updates "Show Tabbar" menuitem.
* @brief Updates "On Title Bar" menuitem.
*/
void CMainFrame::OnUpdateViewTabBarOnTitleBar(CCmdUI* pCmdUI)
{
Expand Down

0 comments on commit 83d635a

Please sign in to comment.