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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user