2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-10-25 15:16:15 +00:00

Save data from EditPeerInfoBox.

This commit is contained in:
John Preston
2017-11-10 21:15:37 +04:00
parent 8ff0120642
commit dd3ae22e08
5 changed files with 282 additions and 3 deletions

View File

@@ -689,6 +689,16 @@ void ScrollArea::scrollTo(ScrollToRequest request) {
scrollToY(request.ymin, request.ymax);
}
void ScrollArea::scrollToWidget(not_null<QWidget*> widget) {
if (auto local = this->widget()) {
auto globalPosition = widget->mapToGlobal(QPoint(0, 0));
auto localPosition = local->mapFromGlobal(globalPosition);
auto localTop = localPosition.y();
auto localBottom = localTop + widget->height();
scrollToY(localTop, localBottom);
}
}
void ScrollArea::scrollToY(int toTop, int toBottom) {
myEnsureResized(widget());
myEnsureResized(this);