summaryrefslogtreecommitdiff
path: root/plugins/Popup/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Popup/src')
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp28
-rw-r--r--plugins/Popup/src/skin.cpp10
-rw-r--r--plugins/Popup/src/stdafx.h2
3 files changed, 17 insertions, 23 deletions
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index a3d5c3c425..fada19920f 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -545,9 +545,9 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
{
bool isIm = (m_hContact && (CallProtoService(GetContactProto(m_hContact), PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) ? true : false;
- bool enableDefaultGen = (m_hContact || !(PopupOptions.actions&ACT_DEF_NOGLOBAL)) ? true : false;
- bool enableDefaultUsr = (isIm || m_hContact && !(PopupOptions.actions&ACT_DEF_IMONLY)) ? true : false;
- bool iconSize = PopupOptions.actions&ACT_LARGE ? TRUE : FALSE;
+ bool enableDefaultGen = (m_hContact || !(PopupOptions.actions & ACT_DEF_NOGLOBAL)) ? true : false;
+ bool enableDefaultUsr = (isIm || m_hContact && !(PopupOptions.actions & ACT_DEF_IMONLY)) ? true : false;
+ bool iconSize = PopupOptions.actions & ACT_LARGE ? TRUE : FALSE;
if (PopupOptions.actions & ACT_ENABLE) {
if (enableDefaultUsr && isIm && IsActionEnabled("General/Quick reply")) ++m_actionCount;
@@ -857,7 +857,7 @@ LRESULT CALLBACK ReplyEditWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
case WM_DESTROY:
PopupThreadUnlock();
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(dat->hwndPopup);
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)dat->oldWndProc);
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
@@ -908,7 +908,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
switch (lParam) {
case ACT_DEF_MESSAGE:
CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)m_hContact, 0);
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(m_hwnd);
break;
@@ -936,7 +936,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
case ACT_DEF_DETAILS:
CallServiceSync(MS_USERINFO_SHOWDIALOG, (WPARAM)m_hContact, 0);
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(m_hwnd);
break;
@@ -946,15 +946,9 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
break;
case ACT_DEF_ADD:
- {
- ADDCONTACTSTRUCT acs = { 0 };
- acs.hContact = m_hContact;
- acs.handleType = HANDLE_CONTACT;
- acs.szProto = nullptr;
- CallServiceSync(MS_ADDCONTACT_SHOW, NULL, (LPARAM)&acs);
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
- PUDeletePopup(m_hwnd);
- }
+ Contact_Add(m_hContact);
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
+ PUDeletePopup(m_hwnd);
break;
case ACT_DEF_PIN:
@@ -965,7 +959,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
m_bIsPinned = !m_bIsPinned;
{
- bool iconSize = PopupOptions.actions&ACT_LARGE ? TRUE : FALSE;
+ bool iconSize = PopupOptions.actions & ACT_LARGE ? TRUE : FALSE;
PUModifyActionIcon(m_hwnd, wParam, lParam, m_bIsPinned ? LoadIconEx(IDI_ACT_PINNED, iconSize) : LoadIconEx(IDI_ACT_PIN, iconSize));
}
break;
@@ -1011,7 +1005,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
case UM_MENUDONE:
{
unlock();
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(m_hwnd);
break;
}
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp
index 157c9aa981..bd912cf115 100644
--- a/plugins/Popup/src/skin.cpp
+++ b/plugins/Popup/src/skin.cpp
@@ -128,8 +128,8 @@ void PopupSkin::drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool h
wchar_t *str = TranslateW(wname);
GetTextExtentPoint32(bmp->getDC(), str, (int)mir_wstrlen(str), &szText);
bmp->Draw_Text(str,
- (PopupOptions.actions&ACT_LARGE) ? (x + szSpace.cx + 32) : (x + szSpace.cx + 16),
- max(y + 2, y + 2 + (((PopupOptions.actions&ACT_LARGE) ? 32 : 16) - szText.cy) / 2));
+ (PopupOptions.actions & ACT_LARGE) ? (x + szSpace.cx + 32) : (x + szSpace.cx + 16),
+ max(y + 2, y + 2 + (((PopupOptions.actions & ACT_LARGE) ? 32 : 16) - szText.cy) / 2));
mir_free(wname);
SelectObject(bmp->getDC(), hFntSave);
@@ -139,8 +139,8 @@ void PopupSkin::drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool h
RECT rc;
rc.left = x;
rc.top = y;
- rc.right = x + ((PopupOptions.actions&ACT_LARGE) ? 32 : 16) + 4;
- rc.bottom = y + ((PopupOptions.actions&ACT_LARGE) ? 32 : 16) + 4;
+ rc.right = x + ((PopupOptions.actions & ACT_LARGE) ? 32 : 16) + 4;
+ rc.bottom = y + ((PopupOptions.actions & ACT_LARGE) ? 32 : 16) + 4;
bmp->saveAlpha(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
HBRUSH hbr = CreateSolidBrush(fonts.clActionHover);
FrameRect(bmp->getDC(), &rc, hbr);
@@ -520,7 +520,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW
drawActionBar(bmp, wnd,
db_get_b(NULL, MODULNAME, "CenterActions", 0) ?
(pt.x + (textAreaWidth - wnd->getRenderInfo()->actw) / 2) :
- (PopupOptions.actions&ACT_RIGHTICONS) ?
+ (PopupOptions.actions & ACT_RIGHTICONS) ?
(pt.x + textAreaWidth - wnd->getRenderInfo()->actw) :
// else
pt.x,
diff --git a/plugins/Popup/src/stdafx.h b/plugins/Popup/src/stdafx.h
index e892d518f6..75e7733f12 100644
--- a/plugins/Popup/src/stdafx.h
+++ b/plugins/Popup/src/stdafx.h
@@ -72,7 +72,7 @@ https://miranda-ng.org/distr/
#include <m_button.h>
#include <m_message.h>
#include <m_userinfo.h>
-#include <m_addcontact.h>
+#include <m_contacts.h>
#include <m_clc.h>
#include <m_icolib.h>
#include <m_genmenu.h>