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

Handle channel event log mouse events.

This commit is contained in:
John Preston
2017-06-22 00:38:31 +03:00
parent 1791b251ad
commit e39b95175b
50 changed files with 1298 additions and 668 deletions

View File

@@ -52,7 +52,7 @@ const style::TextStyle &BotKeyboard::Style::textStyle() const {
return st::botKbStyle;
}
void BotKeyboard::Style::repaint(const HistoryItem *item) const {
void BotKeyboard::Style::repaint(gsl::not_null<const HistoryItem*> item) const {
_parent->update();
}
@@ -237,10 +237,10 @@ void BotKeyboard::updateSelected() {
if (!_impl) return;
QPoint p(mapFromGlobal(_lastMousePos));
int x = rtl() ? st::botKbScroll.width : _st->margin;
auto p = mapFromGlobal(_lastMousePos);
auto x = rtl() ? st::botKbScroll.width : _st->margin;
auto link = _impl->getState(p.x() - x, p.y() - _st->margin);
auto link = _impl->getState(p - QPoint(x, _st->margin));
if (ClickHandler::setActive(link, this)) {
Ui::Tooltip::Hide();
setCursor(link ? style::cur_pointer : style::cur_default);

View File

@@ -92,7 +92,7 @@ private:
void startPaint(Painter &p) const override;
const style::TextStyle &textStyle() const override;
void repaint(const HistoryItem *item) const override;
void repaint(gsl::not_null<const HistoryItem*> item) const override;
protected:
void paintButtonBg(Painter &p, const QRect &rect, float64 howMuchOver) const override;

View File

@@ -900,7 +900,7 @@ void GifsListWidget::updateSelected() {
}
if (col < inlineItems.size()) {
sel = row * MatrixRowShift + col;
inlineItems.at(col)->getState(lnk, cursor, sx, sy);
inlineItems.at(col)->getState(lnk, cursor, QPoint(sx, sy));
lnkhost = inlineItems.at(col);
} else {
row = col = -1;