summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src/msgdialog.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-09-12 14:55:40 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-09-12 14:55:40 +0300
commit0b73d7777c8980a4accfe5819f91882b34725c50 (patch)
tree260ecab9d7901d658bebdfd2ea19122054dd26ed /plugins/Scriver/src/msgdialog.cpp
parent204888102bbc85dee1780c5ca02ffb3f1cb2ce65 (diff)
fixes #4656 (Scriver: аватар перекорёжило)
Diffstat (limited to 'plugins/Scriver/src/msgdialog.cpp')
-rw-r--r--plugins/Scriver/src/msgdialog.cpp51
1 files changed, 22 insertions, 29 deletions
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);