Skip to content

Commit

Permalink
🩹 ペイン最大化時にタブが正しく描画されない問題を修正しました
Browse files Browse the repository at this point in the history
  • Loading branch information
hebiiro committed Feb 5, 2024
1 parent cddc0b6 commit bf698ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Nest/DockSite.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace fgo::nest
if (root)
{
RECT rc; ::GetClientRect(hwnd, &rc);
root->recalcLayout(&rc, 0);
root->recalcLayout(&rc);
::InvalidateRect(hwnd, 0, FALSE);
}
}
Expand Down
21 changes: 7 additions & 14 deletions Nest/Pane/Pane.h
Original file line number Diff line number Diff line change
Expand Up @@ -620,14 +620,14 @@ namespace fgo::nest
//
void recalcLayout()
{
recalcLayout(&position, 0);
recalcLayout(&position);
}

//
// このペインおよび子孫ペインの位置情報を再計算します。
// rcはこのペインの新しい位置です。
//
virtual void recalcLayout(LPCRECT rc, const std::shared_ptr<Pane>& limited)
virtual void recalcLayout(LPCRECT rc)
{
// MY_TRACE_FUNC("");

Expand All @@ -640,7 +640,7 @@ namespace fgo::nest
int c = getTabCount();

// タブが2個以上あるなら
if (c >= 2 && (!limited || this == limited.get()))
if (c >= 2)
{
switch (tabMode)
{
Expand Down Expand Up @@ -690,13 +690,6 @@ namespace fgo::nest
break;
}
}

if (limited)
{
// 最大化モードで再描画を抑制中のときは
// タブコントロールが再描画されないので、手動で再描画します。
::InvalidateRect(tab, 0, FALSE);
}
}
// タブが1個以下なら
else
Expand Down Expand Up @@ -732,14 +725,14 @@ namespace fgo::nest
{
RECT rc = { position.left, position.top, absBorder, position.bottom };

children[0]->recalcLayout(&rc, limited);
children[0]->recalcLayout(&rc);
}

if (children[1])
{
RECT rc = { absBorder + borderWidth, position.top, position.right, position.bottom };

children[1]->recalcLayout(&rc, limited);
children[1]->recalcLayout(&rc);
}

break;
Expand All @@ -752,14 +745,14 @@ namespace fgo::nest
{
RECT rc = { position.left, position.top, position.right, absBorder };

children[0]->recalcLayout(&rc, limited);
children[0]->recalcLayout(&rc);
}

if (children[1])
{
RECT rc = { position.left, absBorder + borderWidth, position.right, position.bottom };

children[1]->recalcLayout(&rc, limited);
children[1]->recalcLayout(&rc);
}

break;
Expand Down
12 changes: 5 additions & 7 deletions Nest/Pane/RootPane.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,19 @@ namespace fgo::nest
// このペインおよび子孫ペインの位置情報を再計算します。
// rcはこのペインの新しい位置です。
//
void recalcLayout(LPCRECT rc, const std::shared_ptr<Pane>& limited) override
void recalcLayout(LPCRECT rc) override
{
MY_TRACE_FUNC("");

if (maximizedPane)
{
::SendMessage(owner, WM_SETREDRAW, FALSE, 0);
__super::recalcLayout(rc, maximizedPane);
::SendMessage(owner, WM_SETREDRAW, TRUE, 0);

maximizedPane->recalcLayout(rc, maximizedPane);
// maximizedPaneがルートペインとなるようにレイアウトを再計算します。
maximizedPane->recalcLayout(rc);
}
else
{
__super::recalcLayout(rc, maximizedPane);
// thisがルートペインとなるようにレイアウトを再計算します。
__super::recalcLayout(rc);
}
}

Expand Down

0 comments on commit bf698ad

Please sign in to comment.