summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-09-26 13:11:32 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-09-26 13:11:32 +0300
commitaa23f64e684fd892a2ae51eacb71c66434efc4d0 (patch)
tree0847802404fae32ccf69116c7644be9bb8705121
parentb6669f0ee3361891e9807e5c734bf9121e9cfb06 (diff)
minor code unification
-rw-r--r--plugins/Scriver/src/msgutils.cpp27
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp2
-rw-r--r--src/core/stdmsg/src/chat_window.cpp4
-rw-r--r--src/mir_app/src/srmm_base.cpp7
4 files changed, 18 insertions, 22 deletions
diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp
index 4f4fb2349b..bdf74f2101 100644
--- a/plugins/Scriver/src/msgutils.cpp
+++ b/plugins/Scriver/src/msgutils.cpp
@@ -620,13 +620,10 @@ void CMsgDialog::UpdateOptions()
{
GetAvatar();
- UpdateFilterButton();
UpdateStatusBar();
UpdateTitle();
FixTabIcons();
- m_pLog->UpdateOptions();
-
// messagebox
COLORREF crFore;
LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, nullptr, &crFore);
@@ -640,20 +637,20 @@ void CMsgDialog::UpdateOptions()
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;
+
+ // 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;
+ // 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_nickList.SendMsg(LB_SETITEMHEIGHT, 0, height > font ? height : font);
- InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE);
- }
m_message.SendMsg(EM_REQUESTRESIZE, 0, 0);
CSuper::UpdateOptions();
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index ce2a2d32e6..f8d98cd9a1 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -2589,8 +2589,6 @@ void CMsgDialog::UpdateOptions()
m_nickList.SetItemHeight(0, g_Settings.iNickListFontHeight);
InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE);
- UpdateFilterButton();
-
CSuper::UpdateOptions();
}
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp
index 5513da517d..08762670c6 100644
--- a/src/core/stdmsg/src/chat_window.cpp
+++ b/src/core/stdmsg/src/chat_window.cpp
@@ -52,16 +52,12 @@ void CMsgDialog::UpdateFilterButton()
void CMsgDialog::UpdateOptions()
{
- UpdateFilterButton();
-
HICON hIcon = ImageList_GetIcon(Clist_GetImageList(), GetImageId(), ILD_TRANSPARENT);
SendMessage(m_pOwner->m_hwndStatus, SB_SETICON, 0, (LPARAM)hIcon);
DestroyIcon(hIcon);
Window_SetIcon_IcoLib(m_pOwner->GetHwnd(), g_plugin.getIconHandle(IDI_CHANMGR));
- m_pLog->UpdateOptions();
-
// nicklist
int ih = Chat_GetTextPixelSize(L"AQGglo", g_Settings.UserListFont, FALSE);
int ih2 = Chat_GetTextPixelSize(L"AQGglo", g_Settings.UserListHeadingsFont, FALSE);
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp
index abd760fa97..499bf58b67 100644
--- a/src/mir_app/src/srmm_base.cpp
+++ b/src/mir_app/src/srmm_base.cpp
@@ -639,6 +639,9 @@ bool CSrmmBaseDialog::IsSuitableEvent(const LOGINFO &lin) const
void CSrmmBaseDialog::UpdateOptions()
{
+ m_pLog->UpdateOptions();
+ UpdateFilterButton();
+
MODULEINFO *mi = m_si->pMI;
EnableWindow(m_btnBold.GetHwnd(), mi->bBold);
EnableWindow(m_btnItalic.GetHwnd(), mi->bItalics);
@@ -736,7 +739,9 @@ void CSrmmBaseDialog::UpdateFilterButton()
if (m_si)
Chat_SetFilters(m_si);
- m_btnFilter.SendMsg(BUTTONADDTOOLTIP, (WPARAM)(m_bFilterEnabled ? TranslateT("Disable the event filter (Ctrl+F)") : TranslateT("Enable the event filter (Ctrl+F)")), BATF_UNICODE);
+ m_btnFilter.SendMsg(BUTTONADDTOOLTIP, (WPARAM)(m_bFilterEnabled
+ ? TranslateT("Disable the event filter (Ctrl+F)")
+ : TranslateT("Enable the event filter (Ctrl+F)")), BATF_UNICODE);
}
/////////////////////////////////////////////////////////////////////////////////////////