2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 23:55:12 +00:00

Snap floating player to column and corner.

This commit is contained in:
John Preston
2017-05-23 21:00:57 +03:00
parent 8f290451b6
commit ee6d80673a
9 changed files with 185 additions and 42 deletions

View File

@@ -2631,7 +2631,7 @@ void HistoryWidget::onScroll() {
}
bool HistoryWidget::isItemCompletelyHidden(HistoryItem *item) const {
auto top = _list->itemTop(item);
auto top = _list ? _list->itemTop(item) : -2;
if (top < 0) {
return true;
}
@@ -3428,7 +3428,7 @@ bool HistoryWidget::wheelEventFromFloatPlayer(QEvent *e, Window::Column myColumn
QRect HistoryWidget::rectForFloatPlayer(Window::Column myColumn, Window::Column playerColumn) {
if (playerColumn == Window::Column::Third && _tabbedSection) {
auto tabbedColumn = (myColumn == Window::Column::First) ? Window::Column::Second : Window::Column::Third;
return mapToGlobal(_tabbedSection->rectForFloatPlayer(tabbedColumn, playerColumn));
return _tabbedSection->rectForFloatPlayer(tabbedColumn, playerColumn);
}
return mapToGlobal(_scroll->geometry());
}