summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Scriver/src/msgdialog.cpp5
-rw-r--r--plugins/Scriver/src/msgs.h1
-rw-r--r--plugins/Scriver/src/msgutils.cpp84
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp16
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp4
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp15
-rw-r--r--plugins/TabSRMM/src/msgs.h1
7 files changed, 53 insertions, 73 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)
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 7fbd56f602..618661c0ef 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -494,8 +494,6 @@ void CMsgDialog::DM_InitRichEdit()
szStreamOut = m_message.GetRichTextRtf();
SetWindowText(m_message.GetHwnd(), L"");
- m_pLog->UpdateOptions();
-
m_message.SendMsg(EM_SETBKGNDCOLOR, 0, m_pContainer->m_theme.inputbg);
CHARFORMAT2 cf2 = {};
@@ -850,6 +848,18 @@ void CMsgDialog::OnOptionsApplied()
m_dwFlags = m_pContainer->m_theme.dwFlags;
}
+ DM_InitRichEdit();
+ GetSendFormat();
+
+ if (isChat()) {
+ m_btnOk.SendMsg(BUTTONSETASNORMAL, TRUE, 0);
+
+ m_nickList.SetItemHeight(0, g_Settings.iNickListFontHeight);
+ InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE);
+
+ UpdateChatOptions();
+ }
+
LoadLocalFlags();
m_hTimeZone = TimeZone_CreateByContact(m_hContact, nullptr, TZF_KNOWNONLY);
@@ -860,11 +870,9 @@ void CMsgDialog::OnOptionsApplied()
// small inner margins (padding) for the text areas
m_message.SendMsg(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(3, 3));
- GetSendFormat();
SetDialogToType();
SendMessage(m_hwnd, DM_CONFIGURETOOLBAR, 0, 0);
- DM_InitRichEdit();
if (m_hwnd == m_pContainer->m_hwndActive)
SendMessage(m_pContainer->m_hwnd, WM_SIZE, 0, 0);
InvalidateRect(m_message.GetHwnd(), nullptr, FALSE);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 09aee40cb7..13fa713f86 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -563,10 +563,10 @@ bool CMsgDialog::OnInitDialog()
LoadContactAvatar();
LoadOwnAvatar();
+ OnOptionsApplied();
if (isChat()) {
m_pLog->Clear();
- UpdateOptions();
UpdateStatusBar();
UpdateTitle();
m_hTabIcon = m_hTabStatusIcon;
@@ -580,8 +580,6 @@ bool CMsgDialog::OnInitDialog()
else {
GetFirstEvent();
- OnOptionsApplied();
-
DB::ECPTR pCursor(DB::EventsRev(m_hContact));
while (MEVENT hdbEvent = pCursor.FetchNext()) {
DBEVENTINFO dbei = {};
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index f8d98cd9a1..445cf5e874 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -2578,21 +2578,6 @@ void CMsgDialog::UpdateFilterButton()
}
/////////////////////////////////////////////////////////////////////////////////////////
-
-void CMsgDialog::UpdateOptions()
-{
- GetSendFormat();
-
- DM_InitRichEdit();
- m_btnOk.SendMsg(BUTTONSETASNORMAL, TRUE, 0);
-
- m_nickList.SetItemHeight(0, g_Settings.iNickListFontHeight);
- InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE);
-
- CSuper::UpdateOptions();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// update the status bar field which displays the number of characters in the input area
// and various indicators (caps lock, num lock, insert mode).
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index 5817cfcb88..29b34e0d32 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -602,7 +602,6 @@ public:
void SetStatusText(const wchar_t *, HICON) override;
void ShowFilterMenu() override;
void UpdateFilterButton() override;
- void UpdateOptions() override;
void UpdateStatusBar() override;
void UpdateTitle() override;