2018-01-11 19:33:26 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#include "history/view/history_view_element.h"
|
|
|
|
|
2018-01-17 18:20:55 +00:00
|
|
|
#include "media/media_clip_reader.h"
|
2018-01-11 19:33:26 +00:00
|
|
|
#include "history/history_item_components.h"
|
2018-01-14 16:02:25 +00:00
|
|
|
#include "history/history_item.h"
|
2018-01-11 19:33:26 +00:00
|
|
|
#include "history/history_media.h"
|
2018-01-14 16:02:25 +00:00
|
|
|
#include "history/history_media_grouped.h"
|
2018-01-13 12:45:11 +00:00
|
|
|
#include "history/history.h"
|
2018-01-11 19:33:26 +00:00
|
|
|
#include "data/data_session.h"
|
2018-01-17 16:21:01 +00:00
|
|
|
#include "data/data_groups.h"
|
2018-01-14 16:02:25 +00:00
|
|
|
#include "data/data_media_types.h"
|
2018-01-11 19:33:26 +00:00
|
|
|
#include "auth_session.h"
|
2018-01-14 16:02:25 +00:00
|
|
|
#include "layout.h"
|
2018-01-11 19:33:26 +00:00
|
|
|
|
|
|
|
namespace HistoryView {
|
2018-01-13 12:45:11 +00:00
|
|
|
namespace {
|
2018-01-11 19:33:26 +00:00
|
|
|
|
2018-01-13 12:45:11 +00:00
|
|
|
// A new message from the same sender is attached to previous within 15 minutes.
|
|
|
|
constexpr int kAttachMessageToPreviousSecondsDelta = 900;
|
|
|
|
|
|
|
|
} // namespace
|
2018-01-14 16:02:25 +00:00
|
|
|
|
|
|
|
TextSelection UnshiftItemSelection(
|
|
|
|
TextSelection selection,
|
|
|
|
uint16 byLength) {
|
|
|
|
return (selection == FullSelection)
|
|
|
|
? selection
|
|
|
|
: ::unshiftSelection(selection, byLength);
|
|
|
|
}
|
|
|
|
|
|
|
|
TextSelection ShiftItemSelection(
|
|
|
|
TextSelection selection,
|
|
|
|
uint16 byLength) {
|
|
|
|
return (selection == FullSelection)
|
|
|
|
? selection
|
|
|
|
: ::shiftSelection(selection, byLength);
|
|
|
|
}
|
|
|
|
|
|
|
|
TextSelection UnshiftItemSelection(
|
|
|
|
TextSelection selection,
|
|
|
|
const Text &byText) {
|
|
|
|
return UnshiftItemSelection(selection, byText.length());
|
|
|
|
}
|
|
|
|
|
|
|
|
TextSelection ShiftItemSelection(
|
|
|
|
TextSelection selection,
|
|
|
|
const Text &byText) {
|
|
|
|
return ShiftItemSelection(selection, byText.length());
|
|
|
|
}
|
|
|
|
|
2018-01-19 17:10:58 +00:00
|
|
|
Element::Element(
|
|
|
|
not_null<ElementDelegate*> delegate,
|
|
|
|
not_null<HistoryItem*> data)
|
|
|
|
: _delegate(delegate)
|
|
|
|
, _data(data)
|
|
|
|
, _context(delegate->elementContext()) {
|
2018-01-14 16:02:25 +00:00
|
|
|
Auth().data().registerItemView(this);
|
2018-01-17 16:21:01 +00:00
|
|
|
refreshMedia();
|
2018-01-11 19:33:26 +00:00
|
|
|
}
|
|
|
|
|
2018-01-19 17:10:58 +00:00
|
|
|
not_null<ElementDelegate*> Element::delegate() const {
|
|
|
|
return _delegate;
|
|
|
|
}
|
|
|
|
|
2018-01-11 19:33:26 +00:00
|
|
|
not_null<HistoryItem*> Element::data() const {
|
|
|
|
return _data;
|
|
|
|
}
|
|
|
|
|
2018-01-14 16:02:25 +00:00
|
|
|
HistoryMedia *Element::media() const {
|
|
|
|
return _media.get();
|
|
|
|
}
|
|
|
|
|
2018-01-13 12:45:11 +00:00
|
|
|
Context Element::context() const {
|
|
|
|
return _context;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Element::y() const {
|
|
|
|
return _y;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Element::setY(int y) {
|
|
|
|
_y = y;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Element::marginTop() const {
|
|
|
|
const auto item = data();
|
|
|
|
auto result = 0;
|
2018-01-14 16:02:25 +00:00
|
|
|
if (!isHiddenByGroup()) {
|
2018-01-13 12:45:11 +00:00
|
|
|
if (isAttachedToPrevious()) {
|
|
|
|
result += st::msgMarginTopAttached;
|
|
|
|
} else {
|
|
|
|
result += st::msgMargin.top();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result += item->displayedDateHeight();
|
|
|
|
if (const auto unreadbar = item->Get<HistoryMessageUnreadBar>()) {
|
|
|
|
result += unreadbar->height();
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Element::marginBottom() const {
|
|
|
|
const auto item = data();
|
2018-01-14 16:02:25 +00:00
|
|
|
return isHiddenByGroup() ? 0 : st::msgMargin.bottom();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::isUnderCursor() const {
|
|
|
|
return (App::hoveredItem() == this);
|
2018-01-13 12:45:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Element::setPendingResize() {
|
|
|
|
_flags |= Flag::NeedsResize;
|
|
|
|
if (_context == Context::History) {
|
|
|
|
data()->_history->setHasPendingResizedItems();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::pendingResize() const {
|
|
|
|
return _flags & Flag::NeedsResize;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::isAttachedToPrevious() const {
|
|
|
|
return _flags & Flag::AttachedToPrevious;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::isAttachedToNext() const {
|
|
|
|
return _flags & Flag::AttachedToNext;
|
|
|
|
}
|
|
|
|
|
2018-01-14 16:02:25 +00:00
|
|
|
int Element::skipBlockWidth() const {
|
|
|
|
return st::msgDateSpace + infoWidth() - st::msgDateDelta.x();
|
|
|
|
}
|
|
|
|
|
|
|
|
int Element::skipBlockHeight() const {
|
|
|
|
return st::msgDateFont->height - st::msgDateDelta.y();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Element::skipBlock() const {
|
|
|
|
return textcmdSkipBlock(skipBlockWidth(), skipBlockHeight());
|
|
|
|
}
|
|
|
|
|
|
|
|
int Element::infoWidth() const {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::isHiddenByGroup() const {
|
|
|
|
return _flags & Flag::HiddenByGroup;
|
|
|
|
}
|
2018-01-17 16:21:01 +00:00
|
|
|
|
|
|
|
void Element::refreshMedia() {
|
|
|
|
_flags &= ~Flag::HiddenByGroup;
|
2018-01-14 16:02:25 +00:00
|
|
|
|
2018-01-17 16:21:01 +00:00
|
|
|
const auto item = data();
|
|
|
|
const auto media = item->media();
|
|
|
|
if (media && media->canBeGrouped()) {
|
|
|
|
if (const auto group = Auth().data().groups().find(item)) {
|
|
|
|
if (group->items.back() != item) {
|
|
|
|
_media = nullptr;
|
|
|
|
_flags |= Flag::HiddenByGroup;
|
|
|
|
} else {
|
|
|
|
_media = std::make_unique<HistoryGroupedMedia>(
|
|
|
|
this,
|
|
|
|
group->items);
|
|
|
|
Auth().data().requestViewResize(this);
|
|
|
|
}
|
|
|
|
return;
|
2018-01-14 16:02:25 +00:00
|
|
|
}
|
|
|
|
}
|
2018-01-17 16:21:01 +00:00
|
|
|
if (_data->media()) {
|
|
|
|
_media = _data->media()->createView(this);
|
|
|
|
} else {
|
|
|
|
_media = nullptr;
|
2018-01-14 16:02:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-13 12:45:11 +00:00
|
|
|
void Element::previousInBlocksChanged() {
|
|
|
|
recountDisplayDateInBlocks();
|
|
|
|
recountAttachToPreviousInBlocks();
|
|
|
|
}
|
|
|
|
|
2018-01-19 17:10:58 +00:00
|
|
|
void Element::nextInBlocksRemoved() {
|
2018-01-13 12:45:11 +00:00
|
|
|
setAttachToNext(false);
|
|
|
|
}
|
|
|
|
|
2018-01-17 18:20:55 +00:00
|
|
|
void Element::clipCallback(Media::Clip::Notification notification) {
|
|
|
|
using namespace Media::Clip;
|
|
|
|
|
|
|
|
const auto media = this->media();
|
|
|
|
if (!media) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const auto reader = media->getClipReader();
|
|
|
|
if (!reader) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (notification) {
|
|
|
|
case NotificationReinit: {
|
|
|
|
auto stopped = false;
|
|
|
|
if (reader->autoPausedGif()) {
|
|
|
|
auto amVisible = false;
|
|
|
|
Auth().data().queryItemVisibility().notify({ data(), &amVisible }, true);
|
|
|
|
if (!amVisible) { // stop animation if it is not visible
|
|
|
|
media->stopInline();
|
|
|
|
if (const auto document = media->getDocument()) {
|
|
|
|
document->forget();
|
|
|
|
}
|
|
|
|
stopped = true;
|
|
|
|
}
|
|
|
|
} else if (reader->mode() == Reader::Mode::Video
|
|
|
|
&& reader->state() == State::Finished) {
|
|
|
|
// Stop finished video message.
|
|
|
|
media->stopInline();
|
|
|
|
}
|
|
|
|
if (!stopped) {
|
|
|
|
Auth().data().requestViewResize(this);
|
|
|
|
Auth().data().notifyViewLayoutChange(this);
|
|
|
|
}
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case NotificationRepaint: {
|
|
|
|
if (!reader->currentDisplayed()) {
|
|
|
|
Auth().data().requestViewRepaint(this);
|
|
|
|
}
|
|
|
|
} break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-14 16:02:25 +00:00
|
|
|
void Element::refreshDataId() {
|
|
|
|
if (const auto media = this->media()) {
|
2018-01-17 16:21:01 +00:00
|
|
|
media->refreshParentId(data());
|
2018-01-14 16:02:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-13 12:45:11 +00:00
|
|
|
bool Element::computeIsAttachToPrevious(not_null<Element*> previous) {
|
|
|
|
const auto item = data();
|
|
|
|
if (!item->Has<HistoryMessageDate>() && !item->Has<HistoryMessageUnreadBar>()) {
|
|
|
|
const auto prev = previous->data();
|
2018-01-19 17:10:58 +00:00
|
|
|
const auto possible = !item->serviceMsg() && !prev->serviceMsg()
|
2018-01-13 12:45:11 +00:00
|
|
|
&& !item->isEmpty() && !prev->isEmpty()
|
2018-01-19 17:10:58 +00:00
|
|
|
&& (qAbs(prev->date.secsTo(item->date)) < kAttachMessageToPreviousSecondsDelta)
|
|
|
|
&& (_context == Context::Feed
|
|
|
|
|| (!item->isPost() && !prev->isPost()));
|
2018-01-13 12:45:11 +00:00
|
|
|
if (possible) {
|
|
|
|
if (item->history()->peer->isSelf()) {
|
|
|
|
return prev->senderOriginal() == item->senderOriginal()
|
|
|
|
&& (prev->Has<HistoryMessageForwarded>() == item->Has<HistoryMessageForwarded>());
|
|
|
|
} else {
|
|
|
|
return prev->from() == item->from();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Element::recountAttachToPreviousInBlocks() {
|
|
|
|
auto attachToPrevious = false;
|
|
|
|
if (const auto previous = previousInBlocks()) {
|
|
|
|
attachToPrevious = computeIsAttachToPrevious(previous);
|
|
|
|
previous->setAttachToNext(attachToPrevious);
|
|
|
|
}
|
|
|
|
setAttachToPrevious(attachToPrevious);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Element::recountDisplayDateInBlocks() {
|
|
|
|
setDisplayDate([&] {
|
|
|
|
const auto item = data();
|
|
|
|
if (item->isEmpty()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (auto previous = previousInBlocks()) {
|
|
|
|
const auto prev = previous->data();
|
|
|
|
return prev->isEmpty() || (prev->date.date() != item->date.date());
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}());
|
|
|
|
}
|
|
|
|
|
|
|
|
QSize Element::countOptimalSize() {
|
|
|
|
return performCountOptimalSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
QSize Element::countCurrentSize(int newWidth) {
|
|
|
|
if (_flags & Flag::NeedsResize) {
|
|
|
|
_flags &= ~Flag::NeedsResize;
|
|
|
|
initDimensions();
|
|
|
|
}
|
|
|
|
return performCountCurrentSize(newWidth);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Element::setDisplayDate(bool displayDate) {
|
|
|
|
const auto item = data();
|
|
|
|
if (displayDate && !item->Has<HistoryMessageDate>()) {
|
|
|
|
item->AddComponents(HistoryMessageDate::Bit());
|
|
|
|
item->Get<HistoryMessageDate>()->init(item->date);
|
|
|
|
setPendingResize();
|
|
|
|
} else if (!displayDate && item->Has<HistoryMessageDate>()) {
|
|
|
|
item->RemoveComponents(HistoryMessageDate::Bit());
|
|
|
|
setPendingResize();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Element::setAttachToNext(bool attachToNext) {
|
|
|
|
if (attachToNext && !(_flags & Flag::AttachedToNext)) {
|
|
|
|
_flags |= Flag::AttachedToNext;
|
2018-01-19 17:10:58 +00:00
|
|
|
setPendingResize();
|
2018-01-13 12:45:11 +00:00
|
|
|
} else if (!attachToNext && (_flags & Flag::AttachedToNext)) {
|
|
|
|
_flags &= ~Flag::AttachedToNext;
|
2018-01-19 17:10:58 +00:00
|
|
|
setPendingResize();
|
2018-01-13 12:45:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Element::setAttachToPrevious(bool attachToPrevious) {
|
|
|
|
if (attachToPrevious && !(_flags & Flag::AttachedToPrevious)) {
|
|
|
|
_flags |= Flag::AttachedToPrevious;
|
2018-01-19 17:10:58 +00:00
|
|
|
setPendingResize();
|
2018-01-13 12:45:11 +00:00
|
|
|
} else if (!attachToPrevious && (_flags & Flag::AttachedToPrevious)) {
|
|
|
|
_flags &= ~Flag::AttachedToPrevious;
|
2018-01-19 17:10:58 +00:00
|
|
|
setPendingResize();
|
2018-01-13 12:45:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::displayFromPhoto() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::hasFromPhoto() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::hasFromName() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::displayFromName() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-01-14 16:02:25 +00:00
|
|
|
bool Element::displayForwardedFrom() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::hasOutLayout() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::drawBubble() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::hasBubble() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::hasFastReply() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::displayFastReply() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::displayRightAction() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Element::drawRightAction(
|
|
|
|
Painter &p,
|
|
|
|
int left,
|
|
|
|
int top,
|
|
|
|
int outerWidth) const {
|
|
|
|
}
|
|
|
|
|
|
|
|
ClickHandlerPtr Element::rightActionLink() const {
|
|
|
|
return ClickHandlerPtr();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::displayEditedBadge() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
QDateTime Element::displayedEditDate() const {
|
|
|
|
return QDateTime();
|
|
|
|
}
|
|
|
|
|
2018-01-18 13:59:22 +00:00
|
|
|
bool Element::hasVisibleText() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-01-13 12:45:11 +00:00
|
|
|
HistoryBlock *Element::block() {
|
|
|
|
return _block;
|
|
|
|
}
|
|
|
|
|
|
|
|
const HistoryBlock *Element::block() const {
|
|
|
|
return _block;
|
|
|
|
}
|
|
|
|
|
2018-01-11 19:33:26 +00:00
|
|
|
void Element::attachToBlock(not_null<HistoryBlock*> block, int index) {
|
|
|
|
Expects(!_data->isLogEntry());
|
|
|
|
Expects(_block == nullptr);
|
|
|
|
Expects(_indexInBlock < 0);
|
|
|
|
Expects(index >= 0);
|
|
|
|
|
|
|
|
_block = block;
|
|
|
|
_indexInBlock = index;
|
|
|
|
_data->setMainView(this);
|
2018-01-19 12:13:06 +00:00
|
|
|
previousInBlocksChanged();
|
2018-01-11 19:33:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Element::removeFromBlock() {
|
|
|
|
Expects(_block != nullptr);
|
|
|
|
|
|
|
|
_block->remove(this);
|
|
|
|
}
|
|
|
|
|
2018-01-18 13:59:22 +00:00
|
|
|
void Element::refreshInBlock() {
|
|
|
|
Expects(_block != nullptr);
|
|
|
|
|
|
|
|
_block->refreshView(this);
|
|
|
|
}
|
|
|
|
|
2018-01-13 12:45:11 +00:00
|
|
|
void Element::setIndexInBlock(int index) {
|
|
|
|
Expects(_block != nullptr);
|
|
|
|
Expects(index >= 0);
|
|
|
|
|
|
|
|
_indexInBlock = index;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Element::indexInBlock() const {
|
|
|
|
Expects((_indexInBlock >= 0) == (_block != nullptr));
|
|
|
|
Expects((_block == nullptr) || (_block->messages[_indexInBlock].get() == this));
|
|
|
|
|
|
|
|
return _indexInBlock;
|
|
|
|
}
|
|
|
|
|
2018-01-11 19:33:26 +00:00
|
|
|
Element *Element::previousInBlocks() const {
|
|
|
|
if (_block && _indexInBlock >= 0) {
|
|
|
|
if (_indexInBlock > 0) {
|
|
|
|
return _block->messages[_indexInBlock - 1].get();
|
|
|
|
}
|
|
|
|
if (auto previous = _block->previousBlock()) {
|
|
|
|
Assert(!previous->messages.empty());
|
|
|
|
return previous->messages.back().get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
Element *Element::nextInBlocks() const {
|
|
|
|
if (_block && _indexInBlock >= 0) {
|
|
|
|
if (_indexInBlock + 1 < _block->messages.size()) {
|
|
|
|
return _block->messages[_indexInBlock + 1].get();
|
|
|
|
}
|
|
|
|
if (auto next = _block->nextBlock()) {
|
|
|
|
Assert(!next->messages.empty());
|
|
|
|
return next->messages.front().get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2018-01-14 16:02:25 +00:00
|
|
|
void Element::drawInfo(
|
|
|
|
Painter &p,
|
|
|
|
int right,
|
|
|
|
int bottom,
|
|
|
|
int width,
|
|
|
|
bool selected,
|
|
|
|
InfoDisplayType type) const {
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Element::pointInTime(
|
|
|
|
int right,
|
|
|
|
int bottom,
|
|
|
|
QPoint point,
|
|
|
|
InfoDisplayType type) const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
TextSelection Element::adjustSelection(
|
|
|
|
TextSelection selection,
|
|
|
|
TextSelectType type) const {
|
|
|
|
return selection;
|
|
|
|
}
|
|
|
|
|
2018-01-11 19:33:26 +00:00
|
|
|
void Element::clickHandlerActiveChanged(
|
|
|
|
const ClickHandlerPtr &handler,
|
|
|
|
bool active) {
|
|
|
|
if (const auto markup = _data->Get<HistoryMessageReplyMarkup>()) {
|
|
|
|
if (const auto keyboard = markup->inlineKeyboard.get()) {
|
|
|
|
keyboard->clickHandlerActiveChanged(handler, active);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
App::hoveredLinkItem(active ? this : nullptr);
|
2018-01-17 16:21:01 +00:00
|
|
|
Auth().data().requestViewRepaint(this);
|
2018-01-14 16:02:25 +00:00
|
|
|
if (const auto media = this->media()) {
|
2018-01-11 19:33:26 +00:00
|
|
|
media->clickHandlerActiveChanged(handler, active);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Element::clickHandlerPressedChanged(
|
|
|
|
const ClickHandlerPtr &handler,
|
|
|
|
bool pressed) {
|
|
|
|
if (const auto markup = _data->Get<HistoryMessageReplyMarkup>()) {
|
|
|
|
if (const auto keyboard = markup->inlineKeyboard.get()) {
|
|
|
|
keyboard->clickHandlerPressedChanged(handler, pressed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
App::pressedLinkItem(pressed ? this : nullptr);
|
2018-01-17 16:21:01 +00:00
|
|
|
Auth().data().requestViewRepaint(this);
|
2018-01-14 16:02:25 +00:00
|
|
|
if (const auto media = this->media()) {
|
2018-01-11 19:33:26 +00:00
|
|
|
media->clickHandlerPressedChanged(handler, pressed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Element::~Element() {
|
2018-01-14 16:02:25 +00:00
|
|
|
Auth().data().unregisterItemView(this);
|
2018-01-11 19:33:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace HistoryView
|