diff options
author | George Hazan <george.hazan@gmail.com> | 2023-09-07 20:39:16 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-09-07 20:39:16 +0300 |
commit | 15fd857beeb3838dea083ea6122d360dbaff1424 (patch) | |
tree | 4e49979e987de1f194acdd49d047377813eacb30 /plugins | |
parent | 85e8318eb061310e100e7599998b45accc1a31fb (diff) |
NewStory: no need to display event actions if there's no event
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 4 | ||||
-rw-r--r-- | plugins/NewStory/src/history_menus.cpp | 12 |
2 files changed, 10 insertions, 6 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 78ce23b523..0e5d20577d 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -54,10 +54,8 @@ void NewstoryListData::OnContextMenu(int index, POINT pt) HMENU hMenu = NSMenu_Build(this, item); - if (pMsgDlg != nullptr && pMsgDlg->isChat()) { - EnableMenuItem(hMenu, 2, MF_BYPOSITION | MF_GRAYED); + if (pMsgDlg != nullptr && pMsgDlg->isChat()) Chat_CreateMenu(hMenu, pMsgDlg->getChat(), nullptr); - } TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, m_hwnd, nullptr); Menu_DestroyNestedMenu(hMenu); diff --git a/plugins/NewStory/src/history_menus.cpp b/plugins/NewStory/src/history_menus.cpp index fe5d4714dc..c03c8587f3 100644 --- a/plugins/NewStory/src/history_menus.cpp +++ b/plugins/NewStory/src/history_menus.cpp @@ -11,6 +11,7 @@ enum static int hMenuObject; static HANDLE hEventPreBuildMenu; static HGENMENU hmiHistory, hmiCopy, hmiSaveAs, hmiDownload, hmiQuote; +static HGENMENU hmiEdit, hmiBookmark, hmiDelete; HMENU NSMenu_Build(NewstoryListData *data, ItemData *item) { @@ -25,6 +26,11 @@ HMENU NSMenu_Build(NewstoryListData *data, ItemData *item) } Menu_ShowItem(hmiQuote, data->pMsgDlg != nullptr); + + bool bShowEventActions = item->hEvent != 0; + Menu_ShowItem(hmiEdit, bShowEventActions); + Menu_ShowItem(hmiDelete, bShowEventActions); + Menu_ShowItem(hmiBookmark, bShowEventActions); NotifyEventHooks(hEventPreBuildMenu, item->hContact, (LPARAM)&item->dbe); @@ -198,15 +204,15 @@ void InitMenus() mi.position = 200000; mi.name.a = LPGEN("Edit"); - Menu_AddNewStoryMenuItem(&mi, MENU_EDIT); + hmiEdit = Menu_AddNewStoryMenuItem(&mi, MENU_EDIT); mi.position = 200001; mi.name.a = LPGEN("Delete"); - Menu_AddNewStoryMenuItem(&mi, MENU_DELETE); + hmiDelete = Menu_AddNewStoryMenuItem(&mi, MENU_DELETE); mi.position = 200002; mi.name.a = LPGEN("Toggle bookmark"); - Menu_AddNewStoryMenuItem(&mi, MENU_BOOKMARK); + hmiBookmark = Menu_AddNewStoryMenuItem(&mi, MENU_BOOKMARK); mi.position = 300000; mi.name.a = LPGEN("Select all"); |