2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Save item views in App::*Item() variables.

Also remove App::contextItem.
Also use owning pointers for history context menus.
This commit is contained in:
John Preston
2018-01-11 16:07:29 +03:00
parent 8060cb7426
commit 062b0b2165
33 changed files with 1201 additions and 1056 deletions

View File

@@ -15,6 +15,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
class Messenger;
class MainWindow;
class MainWidget;
class LocationCoords;
struct LocationData;
namespace HistoryView {
class Message;
} // namespace HistoryView
using HistoryItemsMap = OrderedSet<HistoryItem*>;
using PhotoItems = QHash<PhotoData*, HistoryItemsMap>;
@@ -27,9 +33,6 @@ using GifItems = QHash<Media::Clip::Reader*, HistoryItem*>;
using PhotosData = QHash<PhotoId, PhotoData*>;
using DocumentsData = QHash<DocumentId, DocumentData*>;
class LocationCoords;
struct LocationData;
namespace App {
MainWindow *wnd();
MainWidget *main();
@@ -190,13 +193,13 @@ namespace App {
return histItemById(msgId.channel, msgId.msg);
}
void historyRegItem(HistoryItem *item);
void historyItemDetached(HistoryItem *item);
void historyUnregItem(HistoryItem *item);
void historyUpdateDependent(HistoryItem *item);
void historyClearMsgs();
void historyClearItems();
void historyRegDependency(HistoryItem *dependent, HistoryItem *dependency);
void historyUnregDependency(HistoryItem *dependent, HistoryItem *dependency);
void messageViewDestroyed(not_null<HistoryView::Message*> view);
void historyRegRandom(uint64 randomId, const FullMsgId &itemId);
void historyUnregRandom(uint64 randomId);
@@ -205,18 +208,16 @@ namespace App {
void historyUnregSentData(uint64 randomId);
void histSentDataByItem(uint64 randomId, PeerId &peerId, QString &text);
void hoveredItem(HistoryItem *item);
HistoryItem *hoveredItem();
void pressedItem(HistoryItem *item);
HistoryItem *pressedItem();
void hoveredLinkItem(HistoryItem *item);
HistoryItem *hoveredLinkItem();
void pressedLinkItem(HistoryItem *item);
HistoryItem *pressedLinkItem();
void contextItem(HistoryItem *item);
HistoryItem *contextItem();
void mousedItem(HistoryItem *item);
HistoryItem *mousedItem();
void hoveredItem(HistoryView::Message *item);
HistoryView::Message *hoveredItem();
void pressedItem(HistoryView::Message *item);
HistoryView::Message *pressedItem();
void hoveredLinkItem(HistoryView::Message *item);
HistoryView::Message *hoveredLinkItem();
void pressedLinkItem(HistoryView::Message *item);
HistoryView::Message *pressedLinkItem();
void mousedItem(HistoryView::Message *item);
HistoryView::Message *mousedItem();
void clearMousedItems();
const style::font &monofont();