summaryrefslogtreecommitdiff
path: root/plugins/Scriver
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-09-26 13:34:09 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-09-26 13:34:09 +0300
commitb8ebaa0bdb6be17e014d7a382b86af8c028cf00d (patch)
tree5ff2f2e64e9bf2f0d214fbc9af1d8a661d934c17 /plugins/Scriver
parentaa23f64e684fd892a2ae51eacb71c66434efc4d0 (diff)
Group chat options are applied alongside the private window options update
Diffstat (limited to 'plugins/Scriver')
-rw-r--r--plugins/Scriver/src/msgdialog.cpp5
-rw-r--r--plugins/Scriver/src/msgs.h1
-rw-r--r--plugins/Scriver/src/msgutils.cpp84
3 files changed, 40 insertions, 50 deletions
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 4e1b373608..71ba4bb8a8 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -188,9 +188,9 @@ bool CMsgDialog::OnInitDialog()
}
CreateInfobar();
-
+ OnOptionsApplied();
+
if (isChat()) {
- UpdateOptions();
UpdateStatusBar();
UpdateTitle();
UpdateNickList();
@@ -217,7 +217,6 @@ bool CMsgDialog::OnInitDialog()
}
}
- OnOptionsApplied();
PopupWindow(m_bIncoming);
if (notifyUnread) {
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h
index f24d81b4d6..7c9fd6c3c5 100644
--- a/plugins/Scriver/src/msgs.h
+++ b/plugins/Scriver/src/msgs.h
@@ -138,7 +138,6 @@ public:
void SetStatusText(const wchar_t *, HICON) override;
void ShowFilterMenu() override;
void UpdateFilterButton() override;
- void UpdateOptions() override;
void UpdateStatusBar() override;
void UpdateTitle() override;
diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp
index bdf74f2101..b51a30d967 100644
--- a/plugins/Scriver/src/msgutils.cpp
+++ b/plugins/Scriver/src/msgutils.cpp
@@ -296,14 +296,48 @@ void CMsgDialog::NotifyTyping(int mode)
void CMsgDialog::OnOptionsApplied()
{
- if (isChat())
+ GetAvatar();
+ UpdateTitle();
+ UpdateStatusBar();
+
+ if (isChat()) {
+ FixTabIcons();
+
+ // messagebox
+ COLORREF crFore;
+ LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, nullptr, &crFore);
+
+ CHARFORMAT2 cf;
+ cf.cbSize = sizeof(CHARFORMAT2);
+ cf.dwMask = CFM_COLOR | CFM_BOLD | CFM_UNDERLINE | CFM_BACKCOLOR;
+ cf.dwEffects = 0;
+ cf.crTextColor = crFore;
+ cf.crBackColor = g_plugin.getDword(SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
+ m_message.SendMsg(EM_SETBKGNDCOLOR, 0, g_plugin.getDword(SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR));
+ m_message.SendMsg(WM_SETFONT, (WPARAM)g_Settings.MessageBoxFont, MAKELPARAM(TRUE, 0));
+ m_message.SendMsg(EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf);
+
+ // nicklist
+ int ih = Chat_GetTextPixelSize(L"AQG_glo'", g_Settings.UserListFont, false);
+ int ih2 = Chat_GetTextPixelSize(L"AQG_glo'", g_Settings.UserListHeadingsFont, false);
+ int height = db_get_b(0, CHAT_MODULE, "NicklistRowDist", 12);
+ int font = ih > ih2 ? ih : ih2;
+
+ // make sure we have space for icon!
+ if (Chat::bShowContactStatus)
+ font = font > 16 ? font : 16;
+
+ m_nickList.SendMsg(LB_SETITEMHEIGHT, 0, height > font ? height : font);
+ InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE);
+
+ m_message.SendMsg(EM_REQUESTRESIZE, 0, 0);
+
+ UpdateChatOptions();
return;
+ }
- GetAvatar();
SetDialogToType();
- m_pLog->UpdateOptions();
-
COLORREF colour = g_plugin.getDword(SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
m_message.SendMsg(EM_SETBKGNDCOLOR, 0, colour);
InvalidateRect(m_message.GetHwnd(), nullptr, FALSE);
@@ -326,9 +360,7 @@ void CMsgDialog::OnOptionsApplied()
m_message.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_message.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD);
SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
- UpdateTitle();
UpdateTabControl();
- UpdateStatusBar();
m_message.SendMsg(EM_REQUESTRESIZE, 0, 0);
SetupInfobar();
}
@@ -616,46 +648,6 @@ void CMsgDialog::UpdateFilterButton()
m_btnNickList.SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(m_bNicklistEnabled ? IDI_NICKLIST2 : IDI_NICKLIST));
}
-void CMsgDialog::UpdateOptions()
-{
- GetAvatar();
-
- UpdateStatusBar();
- UpdateTitle();
- FixTabIcons();
-
- // messagebox
- COLORREF crFore;
- LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, nullptr, &crFore);
-
- CHARFORMAT2 cf;
- cf.cbSize = sizeof(CHARFORMAT2);
- cf.dwMask = CFM_COLOR | CFM_BOLD | CFM_UNDERLINE | CFM_BACKCOLOR;
- cf.dwEffects = 0;
- cf.crTextColor = crFore;
- cf.crBackColor = g_plugin.getDword(SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
- m_message.SendMsg(EM_SETBKGNDCOLOR, 0, g_plugin.getDword(SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR));
- m_message.SendMsg(WM_SETFONT, (WPARAM)g_Settings.MessageBoxFont, MAKELPARAM(TRUE, 0));
- m_message.SendMsg(EM_SETCHARFORMAT, SCF_ALL, (LPARAM)& cf);
-
- // nicklist
- int ih = Chat_GetTextPixelSize(L"AQG_glo'", g_Settings.UserListFont, false);
- int ih2 = Chat_GetTextPixelSize(L"AQG_glo'", g_Settings.UserListHeadingsFont, false);
- int height = db_get_b(0, CHAT_MODULE, "NicklistRowDist", 12);
- int font = ih > ih2 ? ih : ih2;
-
- // make sure we have space for icon!
- if (Chat::bShowContactStatus)
- font = font > 16 ? font : 16;
-
- m_nickList.SendMsg(LB_SETITEMHEIGHT, 0, height > font ? height : font);
- InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE);
-
- m_message.SendMsg(EM_REQUESTRESIZE, 0, 0);
-
- CSuper::UpdateOptions();
-}
-
void CMsgDialog::UpdateStatusBar()
{
if (m_pParent->m_hwndActive != m_hwnd)