summaryrefslogtreecommitdiff
path: root/plugins/SpellChecker
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-03-07 22:38:02 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-03-07 22:40:54 +0300
commit6712ce9307350ef5c04f184b0cb80cfe75af77c5 (patch)
tree3baa482fecc7e53c7843e8ae89a6bc6678b0570d /plugins/SpellChecker
parentfab3905d91890102046dcc4554721991ae8ff413 (diff)
Srmm_ModifyIcon now changes only tooltip and/or icon, Srmm_SetIconFlags controls flags
Diffstat (limited to 'plugins/SpellChecker')
-rw-r--r--plugins/SpellChecker/src/spellchecker.cpp25
-rw-r--r--plugins/SpellChecker/src/utils.cpp11
2 files changed, 2 insertions, 34 deletions
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp
index 0d99fb96b6..3a1c9eaea1 100644
--- a/plugins/SpellChecker/src/spellchecker.cpp
+++ b/plugins/SpellChecker/src/spellchecker.cpp
@@ -62,30 +62,6 @@ CMPlugin::CMPlugin() :
// Functions ////////////////////////////////////////////////////////////////////////////
-static int IconsChanged(WPARAM, LPARAM)
-{
- StatusIconData sid = {};
- sid.szModule = MODULENAME;
- sid.hIconDisabled = IcoLib_GetIcon("spellchecker_disabled");
- sid.flags = MBF_HIDDEN | MBF_UNICODE;
-
- for (int i = 0; i < languages.getCount(); i++) {
- sid.dwId = i;
-
- wchar_t tmp[128];
- mir_snwprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name);
- sid.szTooltip.w = tmp;
-
- HICON hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled");
- sid.hIcon = CopyIcon(hIcon);
- IcoLib_ReleaseIcon(hIcon);
-
- Srmm_ModifyIcon(NULL, &sid);
- }
-
- return 0;
-}
-
static int PreShutdown(WPARAM, LPARAM)
{
mir_free(dictionariesFolder);
@@ -179,7 +155,6 @@ static int ModulesLoaded(WPARAM, LPARAM)
dict->load();
}
- HookEvent(ME_SKIN2_ICONSCHANGED, IconsChanged);
HookEvent(ME_MSG_WINDOWEVENT, MsgWindowEvent);
HookEvent(ME_MSG_WINDOWPOPUP, MsgWindowPopup);
HookEvent(ME_MSG_ICONPRESSED, IconPressed);
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp
index fc8a83365e..017dcb09c2 100644
--- a/plugins/SpellChecker/src/utils.cpp
+++ b/plugins/SpellChecker/src/utils.cpp
@@ -814,18 +814,11 @@ void GetContactLanguage(Dialog *dlg)
void ModifyIcon(Dialog *dlg)
{
- StatusIconData sid = {};
- sid.szModule = MODULENAME;
-
for (int i = 0; i < languages.getCount(); i++) {
- sid.dwId = i;
-
if (languages[i] == dlg->lang)
- sid.flags = (dlg->enabled ? 0 : MBF_DISABLED);
+ Srmm_SetIconFlags(dlg->hContact, MODULENAME, i, dlg->enabled ? 0 : MBF_DISABLED);
else
- sid.flags = MBF_HIDDEN;
-
- Srmm_ModifyIcon(dlg->hContact, &sid);
+ Srmm_SetIconFlags(dlg->hContact, MODULENAME, i, MBF_HIDDEN);
}
}