summaryrefslogtreecommitdiff
path: root/src/core/stdpopup
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-09-24 22:00:00 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-09-24 22:00:00 +0300
commit81306c2ef85c8a3d6c72a98a35067135cbbbb701 (patch)
tree170e1530508490b2d4f2d84fb55a602ac2594de6 /src/core/stdpopup
parent7d02f225d6d913330310694d1e408d963137f9ca (diff)
fixes #3686 )StdPopup: в статусбаре tabSRMM отсутствует иконка "вкл-выкл всплывающие окна")
Diffstat (limited to 'src/core/stdpopup')
-rw-r--r--src/core/stdpopup/src/popwin.h1
-rw-r--r--src/core/stdpopup/src/services.cpp3
-rw-r--r--src/core/stdpopup/src/stdafx.h13
-rw-r--r--src/core/stdpopup/src/yapp.cpp20
4 files changed, 30 insertions, 7 deletions
diff --git a/src/core/stdpopup/src/popwin.h b/src/core/stdpopup/src/popwin.h
index 8ab19fca5f..a1684dcf18 100644
--- a/src/core/stdpopup/src/popwin.h
+++ b/src/core/stdpopup/src/popwin.h
@@ -23,5 +23,6 @@ void RepositionWindows();
LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+void UpdateMenu();
#endif
diff --git a/src/core/stdpopup/src/services.cpp b/src/core/stdpopup/src/services.cpp
index aa5defdb00..c55ceaccbe 100644
--- a/src/core/stdpopup/src/services.cpp
+++ b/src/core/stdpopup/src/services.cpp
@@ -188,7 +188,7 @@ static INT_PTR GetOpaque(WPARAM wParam, LPARAM)
void UpdateMenu()
{
- bool isEnabled = Popup_Enabled() == 1;
+ bool isEnabled = Popup_Enabled();
if (isEnabled) {
Menu_ModifyItem(hMenuItem, LPGENW("Disable popups"), g_plugin.getIconHandle(IDI_POPUP));
Menu_ModifyItem(hMenuRoot, nullptr, g_plugin.getIconHandle(IDI_POPUP));
@@ -197,6 +197,7 @@ void UpdateMenu()
Menu_ModifyItem(hMenuItem, LPGENW("Enable popups"), g_plugin.getIconHandle(IDI_NOPOPUP));
Menu_ModifyItem(hMenuRoot, nullptr, g_plugin.getIconHandle(IDI_NOPOPUP));
}
+ Srmm_SetIconFlags(0, MODULENAME, 0, isEnabled ? 0 : MBF_DISABLED);
if (hTTButton)
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTButton, isEnabled ? TTBST_PUSHED : 0);
diff --git a/src/core/stdpopup/src/stdafx.h b/src/core/stdpopup/src/stdafx.h
index cbfc804a58..ca2efd051b 100644
--- a/src/core/stdpopup/src/stdafx.h
+++ b/src/core/stdpopup/src/stdafx.h
@@ -14,18 +14,19 @@
#include <malloc.h>
#include <newpluginapi.h>
-#include <m_utils.h>
-#include <m_langpack.h>
-#include <m_options.h>
-#include <m_skin.h>
+#include <m_avatars.h>
#include <m_clistint.h>
#include <m_fontservice.h>
-#include <m_avatars.h>
-#include <m_popup_int.h>
#include <m_icolib.h>
+#include <m_langpack.h>
+#include <m_message.h>
+#include <m_options.h>
+#include <m_skin.h>
#include <m_toptoolbar.h>
+#include <m_utils.h>
#include <m_ieview.h> //need this for special renderers
+#include <m_popup_int.h>
#include "version.h"
#include "message_pump.h"
diff --git a/src/core/stdpopup/src/yapp.cpp b/src/core/stdpopup/src/yapp.cpp
index c71ec5de6e..26d1c9e033 100644
--- a/src/core/stdpopup/src/yapp.cpp
+++ b/src/core/stdpopup/src/yapp.cpp
@@ -162,6 +162,17 @@ static void InitFonts()
ReloadFont(0, 0);
}
+static int SrmmMenu_ProcessIconClick(WPARAM, LPARAM lParam)
+{
+ StatusIconClickData *sicd = (StatusIconClickData *)lParam;
+
+ if (!mir_strcmp(sicd->szModule, MODULENAME)) {
+ Popup_Enable(!Popup_Enabled());
+ UpdateMenu();
+ }
+ return 0;
+}
+
static void InitMenuItems(void)
{
bool isEnabled = Popup_Enabled() == 1;
@@ -184,6 +195,15 @@ static void InitMenuItems(void)
mi.pszService = "Popup/EnableDisableMenuCommand";
mi.name.w = (isEnabled ? LPGENW("Disable popups") : LPGENW("Enable popups"));
hMenuItem = Menu_AddMainMenuItem(&mi);
+
+ //////////////////////////////////////////////////////////////////////////////////////
+ StatusIconData sid = {};
+ sid.szModule = MODULENAME;
+ sid.szTooltip.a = LPGEN("Popup Mode");
+ sid.hIcon = sid.hIconDisabled = Skin_LoadIcon(SKINICON_OTHER_POPUP);
+ Srmm_AddIcon(&sid, &g_plugin);
+
+ HookEvent(ME_MSG_ICONPRESSED, SrmmMenu_ProcessIconClick);
}
static int ModulesLoaded(WPARAM, LPARAM)