From 0b73d7777c8980a4accfe5819f91882b34725c50 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 12 Sep 2024 14:55:40 +0300 Subject: =?UTF-8?q?fixes=20#4656=20(Scriver:=20=D0=B0=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B0=D1=80=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BA=D0=BE=D1=80=D1=91?= =?UTF-8?q?=D0=B6=D0=B8=D0=BB=D0=BE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/Scriver/src/msgdialog.cpp | 51 +++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 29 deletions(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 4398c3ebb3..8d7b10a6ba 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -508,6 +508,28 @@ void CMsgDialog::MessageDialogResize(int w, int h) int messageEditWidth = w - 2; int hSplitterPos = (m_bReadOnly) ? 0 : pdat->iSplitterY; + int infobarInnerHeight = INFO_BAR_INNER_HEIGHT; + int infobarHeight = INFO_BAR_HEIGHT; + + if (!pdat->flags2.bShowInfoBar || m_si) { + infobarHeight = 0; + infobarInnerHeight = 0; + } + + int hSplitterMinTop = toolbarHeight + m_minLogBoxHeight, hSplitterMinBottom = m_minEditBoxHeight; + if (hSplitterMinBottom < g_dat.minInputAreaHeight) + hSplitterMinBottom = g_dat.minInputAreaHeight; + + if (hSplitterPos > (h - toolbarHeight - infobarHeight + SPLITTER_HEIGHT + 1) / 2) + hSplitterPos = (h - toolbarHeight - infobarHeight + SPLITTER_HEIGHT + 1) / 2; + + if (h - hSplitterPos - infobarHeight < hSplitterMinTop) + hSplitterPos = h - hSplitterMinTop - infobarHeight; + + hSplitterMinBottom -= toolbarHeight - 2; + if (hSplitterPos < hSplitterMinBottom) + hSplitterPos = hSplitterMinBottom; + if (!pdat->flags2.bShowInfoBar) { if (m_hbmpAvatarPic && g_dat.flags.bShowAvatar) { avatarWidth = BOTTOM_RIGHT_AVATAR_HEIGHT; @@ -530,30 +552,6 @@ void CMsgDialog::MessageDialogResize(int w, int h) } } - int infobarInnerHeight = INFO_BAR_INNER_HEIGHT; - int infobarHeight = INFO_BAR_HEIGHT; - - if (!pdat->flags2.bShowInfoBar || m_si) { - infobarHeight = 0; - infobarInnerHeight = 0; - } - - int hSplitterMinTop = toolbarHeight + m_minLogBoxHeight, hSplitterMinBottom = m_minEditBoxHeight; - if (hSplitterMinBottom < g_dat.minInputAreaHeight) - hSplitterMinBottom = g_dat.minInputAreaHeight; - - if (hSplitterPos > (h - toolbarHeight - infobarHeight + SPLITTER_HEIGHT + 1) / 2) - hSplitterPos = (h - toolbarHeight - infobarHeight + SPLITTER_HEIGHT + 1) / 2; - - if (h - hSplitterPos - infobarHeight < hSplitterMinTop) - hSplitterPos = h - hSplitterMinTop - infobarHeight; - - if (hSplitterPos < avatarHeight) - hSplitterPos = avatarHeight; - - if (hSplitterPos < hSplitterMinBottom) - hSplitterPos = hSplitterMinBottom; - if (m_bReadOnly) hSplitterPos = 0; else @@ -563,11 +561,6 @@ void CMsgDialog::MessageDialogResize(int w, int h) if (isChat()) { bool bNick = m_si->iType != GCW_SERVER && m_bNicklistEnabled; - if (h - pdat->iSplitterY < hSplitterMinTop) - pdat->iSplitterY = h - hSplitterMinTop; - if (pdat->iSplitterY < hSplitterMinBottom) - pdat->iSplitterY = hSplitterMinBottom; - m_splitterX.Show(bNick); if (m_si->iType != GCW_SERVER) m_nickList.Show(m_bNicklistEnabled); -- cgit v1.2.3