Browse Source

Fix popup menu checkmark and size

master
Dorian 7 years ago
parent
commit
957f2f07cd
  1. 3
      k-meleon/KmMenu.cpp
  2. 7
      k-meleon/Plugins.cpp
  3. 9
      k-meleon/rebar_menu/rebar_menu.cpp

3
k-meleon/KmMenu.cpp

@ -304,7 +304,7 @@ BOOL KmMenu::Build(CMenu &menu, int before)
ASSERT(pos<menu.GetMenuItemCount());
MENUITEMINFO mi = {0};
mi.cbSize = sizeof(mi);
mi.fMask = MIIM_DATA | MIIM_FTYPE;
mi.fMask = MIIM_FTYPE;
mi.fType = MF_OWNERDRAW;
mi.dwItemData = (ULONG_PTR)&item;//(ULONG_PTR)_wcsdup((LPCTSTR)pTranslated);
menu.SetMenuItemInfo(pos, &mi, TRUE);
@ -719,6 +719,7 @@ void KmMenuService::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
}
CAutoPtr<TCHAR> text(new TCHAR[++mi.cch+1]);
text[0] = 0;
mi.dwTypeData = text;
mLastActivated->GetMenuItemInfo(lpMeasureItemStruct->itemID, &mi);

7
k-meleon/Plugins.cpp

@ -1433,15 +1433,16 @@ HMENU GetMenu(const char *menuName)
UINT ShowMenu(HWND hWnd, const char *name, bool sendCommand)
{
HMENU menu = GetMenu(name);
USES_CONVERSION;
CMenu* menu = theApp.menus.GetMenu(A2T(name));
if (!menu) return 0;
CBrowserFrame* frame = GetFrame(hWnd);
POINT pt;
GetCursorPos(&pt);
UINT flags = TPM_TOPALIGN | TPM_LEFTALIGN | TPM_NONOTIFY | TPM_LEFTBUTTON;
UINT flags = TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON;
if (!sendCommand) flags |= TPM_RETURNCMD;
UINT id = TrackPopupMenuEx(menu, flags, pt.x, pt.y, frame->GetSafeHwnd(), NULL);
UINT id = menu->TrackPopupMenuEx(flags, pt.x, pt.y, frame, NULL);
return id;
}

9
k-meleon/rebar_menu/rebar_menu.cpp

@ -58,7 +58,7 @@ int DoAccel(char *param, BOOL bSubmenu=FALSE);
#define MAX_KEYBOARD_MENUS 32
int id_accel=0;
HMENU accels[MAX_KEYBOARD_MENUS];
std::string accels[MAX_KEYBOARD_MENUS];
int accels_used=0;
long DoMessage(const char *to, const char *from, const char *subject, long data1, long data2);
int nMenuType = 2;
@ -201,7 +201,7 @@ int DoAccel(char *param, BOOL bSubmenu) {
if (hMenu) {
accels_used++;
id = MAX_KEYBOARD_MENUS-accels_used;
accels[id] = hMenu;
accels[id] = param;
}
}
@ -500,10 +500,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){
if (MAX_KEYBOARD_MENUS - i <= accels_used) {
POINT pt;
GetCursorPos(&pt);
DWORD SelectionMade = TrackPopupMenu( accels[i],
TPM_TOPALIGN | TPM_LEFTALIGN | TPM_NONOTIFY |
TPM_LEFTBUTTON | TPM_RETURNCMD,
pt.x, pt.y, 0, hWnd, NULL);
DWORD SelectionMade = kPlugin.kFuncs->ShowMenu(hWnd, accels[i].c_str(), true);
if (SelectionMade > 0)
PostMessage(hWnd, WM_COMMAND, SelectionMade, 0);
}

Loading…
Cancel
Save