mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Removed Notify::inlineKeyboardMoved as completely unused code.
This commit is contained in:
parent
b629e0c43a
commit
0227b5f2fa
11 changed files with 1 additions and 66 deletions
|
@ -289,18 +289,6 @@ bool skipPaintEvent(QWidget *widget, QPaintEvent *event) {
|
||||||
|
|
||||||
namespace Notify {
|
namespace Notify {
|
||||||
|
|
||||||
void inlineKeyboardMoved(
|
|
||||||
not_null<const HistoryItem*> item,
|
|
||||||
int oldKeyboardTop,
|
|
||||||
int newKeyboardTop) {
|
|
||||||
if (const auto m = CheckMainWidget(&item->history()->session())) {
|
|
||||||
m->notify_inlineKeyboardMoved(
|
|
||||||
item,
|
|
||||||
oldKeyboardTop,
|
|
||||||
newKeyboardTop);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool switchInlineBotButtonReceived(
|
bool switchInlineBotButtonReceived(
|
||||||
not_null<Main::Session*> session,
|
not_null<Main::Session*> session,
|
||||||
const QString &query,
|
const QString &query,
|
||||||
|
|
|
@ -76,10 +76,6 @@ enum ClipStopperType {
|
||||||
|
|
||||||
namespace Notify {
|
namespace Notify {
|
||||||
|
|
||||||
void inlineKeyboardMoved(
|
|
||||||
not_null<const HistoryItem*> item,
|
|
||||||
int oldKeyboardTop,
|
|
||||||
int newKeyboardTop);
|
|
||||||
bool switchInlineBotButtonReceived(
|
bool switchInlineBotButtonReceived(
|
||||||
not_null<Main::Session*> session,
|
not_null<Main::Session*> session,
|
||||||
const QString &query,
|
const QString &query,
|
||||||
|
|
|
@ -2986,21 +2986,6 @@ void HistoryInner::notifyMigrateUpdated() {
|
||||||
_migrated = _history->migrateFrom();
|
_migrated = _history->migrateFrom();
|
||||||
}
|
}
|
||||||
|
|
||||||
int HistoryInner::moveScrollFollowingInlineKeyboard(
|
|
||||||
const HistoryItem *item,
|
|
||||||
int oldKeyboardTop,
|
|
||||||
int newKeyboardTop) {
|
|
||||||
if (const auto view = item ? item->mainView() : nullptr) {
|
|
||||||
if (view->isUnderCursor()) {
|
|
||||||
const auto top = itemTop(item);
|
|
||||||
if (top >= oldKeyboardTop) {
|
|
||||||
return newKeyboardTop - oldKeyboardTop;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HistoryInner::applyDragSelection() {
|
void HistoryInner::applyDragSelection() {
|
||||||
applyDragSelection(&_selected);
|
applyDragSelection(&_selected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,10 +114,6 @@ public:
|
||||||
void notifyIsBotChanged();
|
void notifyIsBotChanged();
|
||||||
void notifyMigrateUpdated();
|
void notifyMigrateUpdated();
|
||||||
|
|
||||||
// When inline keyboard has moved because of the edition of its item we want
|
|
||||||
// to move scroll position so that mouse points to the same button row.
|
|
||||||
int moveScrollFollowingInlineKeyboard(const HistoryItem *item, int oldKeyboardTop, int newKeyboardTop);
|
|
||||||
|
|
||||||
// Ui::AbstractTooltipShower interface.
|
// Ui::AbstractTooltipShower interface.
|
||||||
QString tooltipText() const override;
|
QString tooltipText() const override;
|
||||||
QPoint tooltipPos() const override;
|
QPoint tooltipPos() const override;
|
||||||
|
|
|
@ -206,6 +206,7 @@ void HistoryItem::finishEdition(int oldKeyboardTop) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Should be completely redesigned as the oldTop no longer exists.
|
||||||
//if (oldKeyboardTop >= 0) { // #TODO edit bot message
|
//if (oldKeyboardTop >= 0) { // #TODO edit bot message
|
||||||
// if (auto keyboard = Get<HistoryMessageReplyMarkup>()) {
|
// if (auto keyboard = Get<HistoryMessageReplyMarkup>()) {
|
||||||
// keyboard->oldTop = oldKeyboardTop;
|
// keyboard->oldTop = oldKeyboardTop;
|
||||||
|
|
|
@ -213,9 +213,6 @@ struct HistoryMessageReplyMarkup : public RuntimeComponent<HistoryMessageReplyMa
|
||||||
|
|
||||||
std::unique_ptr<ReplyKeyboard> inlineKeyboard;
|
std::unique_ptr<ReplyKeyboard> inlineKeyboard;
|
||||||
|
|
||||||
// If >= 0 it holds the y coord of the inlineKeyboard before the last edition.
|
|
||||||
int oldTop = -1;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createFromButtonRows(const QVector<MTPKeyboardButtonRow> &v);
|
void createFromButtonRows(const QVector<MTPKeyboardButtonRow> &v);
|
||||||
|
|
||||||
|
|
|
@ -1524,14 +1524,6 @@ void HistoryWidget::onRecordUpdate(quint16 level, qint32 samples) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::notify_inlineKeyboardMoved(not_null<const HistoryItem*> item, int oldKeyboardTop, int newKeyboardTop) {
|
|
||||||
if (_history == item->history() || _migrated == item->history()) {
|
|
||||||
if (const auto move = _list->moveScrollFollowingInlineKeyboard(item, oldKeyboardTop, newKeyboardTop)) {
|
|
||||||
_addToScroll = move;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HistoryWidget::notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo) {
|
bool HistoryWidget::notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo) {
|
||||||
if (samePeerBot) {
|
if (samePeerBot) {
|
||||||
if (_history) {
|
if (_history) {
|
||||||
|
|
|
@ -275,7 +275,6 @@ public:
|
||||||
|
|
||||||
PeerData *ui_getPeerForMouseAction();
|
PeerData *ui_getPeerForMouseAction();
|
||||||
|
|
||||||
void notify_inlineKeyboardMoved(not_null<const HistoryItem*> item, int oldKeyboardTop, int newKeyboardTop);
|
|
||||||
bool notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo);
|
bool notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo);
|
||||||
|
|
||||||
~HistoryWidget();
|
~HistoryWidget();
|
||||||
|
|
|
@ -1957,20 +1957,6 @@ QSize Message::performCountCurrentSize(int newWidth) {
|
||||||
const auto item = message();
|
const auto item = message();
|
||||||
const auto newHeight = resizeContentGetHeight(newWidth);
|
const auto newHeight = resizeContentGetHeight(newWidth);
|
||||||
|
|
||||||
const auto keyboard = item->inlineReplyKeyboard();
|
|
||||||
if (const auto markup = item->Get<HistoryMessageReplyMarkup>()) {
|
|
||||||
const auto oldTop = markup->oldTop;
|
|
||||||
if (oldTop >= 0) {
|
|
||||||
markup->oldTop = -1;
|
|
||||||
if (keyboard) {
|
|
||||||
const auto height = st::msgBotKbButton.margin + keyboard->naturalHeight();
|
|
||||||
const auto keyboardTop = newHeight - height + st::msgBotKbButton.margin - marginBottom();
|
|
||||||
if (keyboardTop != oldTop) {
|
|
||||||
Notify::inlineKeyboardMoved(item, oldTop, keyboardTop);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return { newWidth, newHeight };
|
return { newWidth, newHeight };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -604,10 +604,6 @@ void MainWidget::onFilesOrForwardDrop(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWidget::notify_inlineKeyboardMoved(not_null<const HistoryItem*> item, int oldKeyboardTop, int newKeyboardTop) {
|
|
||||||
_history->notify_inlineKeyboardMoved(item, oldKeyboardTop, newKeyboardTop);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MainWidget::notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo) {
|
bool MainWidget::notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo) {
|
||||||
return _history->notify_switchInlineBotButtonReceived(query, samePeerBot, samePeerReplyTo);
|
return _history->notify_switchInlineBotButtonReceived(query, samePeerBot, samePeerReplyTo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,7 +230,6 @@ public:
|
||||||
MsgId msgId);
|
MsgId msgId);
|
||||||
PeerData *ui_getPeerForMouseAction();
|
PeerData *ui_getPeerForMouseAction();
|
||||||
|
|
||||||
void notify_inlineKeyboardMoved(not_null<const HistoryItem*> item, int oldKeyboardTop, int newKeyboardTop);
|
|
||||||
bool notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo);
|
bool notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo);
|
||||||
|
|
||||||
using FloatDelegate::floatPlayerAreaUpdated;
|
using FloatDelegate::floatPlayerAreaUpdated;
|
||||||
|
|
Loading…
Add table
Reference in a new issue