Skip to content

Commit

Permalink
fixes #4366 (tabSRMM: кнопки не видны, если включить показ панели кно…
Browse files Browse the repository at this point in the history
…пок)
  • Loading branch information
georgehazan committed Apr 19, 2024
1 parent 9327863 commit 99f6af5
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions plugins/TabSRMM/src/buttonsbar.cpp
Expand Up @@ -247,25 +247,24 @@ BOOL CMsgDialog::BB_SetButtonsPos()

bool bAutoHidden = mapHidden[cbd];

int iCmd = SW_SHOW;
if (showToolbar) {
if (!cbd->m_bSeparator && !IsWindowEnabled(hwndButton) && !bAutoHidden)
tempL -= cbd->m_iButtonWidth + gap;

if (cbd->m_bCanBeHidden && !cbd->m_bHidden) {
if (!bAutoHidden) {
if (tempL + tempR > (rect.right - foravatar) && (cbd->m_bSeparator || IsWindowVisible(hwndButton))) {
ShowWindow(hwndButton, SW_HIDE);
iCmd = SW_HIDE;
bAutoHidden = true;
tempL -= cbd->m_iButtonWidth + gap;
}
}
else {
ShowWindow(hwndButton, SW_SHOW);
bAutoHidden = false;
}
else bAutoHidden = false;
}
}
else ShowWindow(hwndButton, SW_HIDE);
else iCmd = SW_HIDE;
ShowWindow(hwndButton, iCmd);

hdwp = DeferWindowPos(hdwp, hwndButton, nullptr, lwidth, splitterY - iOff - 2, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
if (IsWindowVisible(hwndButton) || (cbd->m_bSeparator && !(bAutoHidden || cbd->m_bHidden)))
Expand All @@ -291,25 +290,24 @@ BOOL CMsgDialog::BB_SetButtonsPos()

bool bAutoHidden = mapHidden[cbd];

int iCmd = SW_SHOW;
if (showToolbar) {
if (!cbd->m_bSeparator && !IsWindowVisible(hwndButton) && !IsWindowEnabled(hwndButton) && !bAutoHidden)
tempR -= cbd->m_iButtonWidth + gap;

if (cbd->m_bCanBeHidden && !cbd->m_bHidden) {
if (!bAutoHidden) {
if (tempL + tempR > (rect.right - foravatar) && (cbd->m_bSeparator || IsWindowVisible(hwndButton))) {
ShowWindow(hwndButton, SW_HIDE);
iCmd = SW_HIDE;
bAutoHidden = true;
tempR -= cbd->m_iButtonWidth + gap;
}
}
else {
ShowWindow(hwndButton, SW_SHOW);
bAutoHidden = false;
}
else bAutoHidden = false;
}
}
else ShowWindow(hwndButton, SW_HIDE);
else iCmd = SW_HIDE;
ShowWindow(hwndButton, iCmd);

if (IsWindowVisible(hwndButton) || (cbd->m_bSeparator && !(bAutoHidden || cbd->m_bHidden)))
rwidth += cbd->m_iButtonWidth + gap;
Expand Down

0 comments on commit 99f6af5

Please sign in to comment.