mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-22 10:17:10 +00:00
Scroll a bit further when switching tabs.
This commit is contained in:
parent
f9bf40a771
commit
7f2a0b6630
@ -237,6 +237,12 @@ void SubsectionTabs::setupSlider(
|
||||
slider->requestShown(
|
||||
) | rpl::start_with_next([=](Ui::ScrollToRequest request) {
|
||||
const auto full = vertical ? scroll->height() : scroll->width();
|
||||
const auto tab = request.ymax - request.ymin;
|
||||
if (tab < full) {
|
||||
const auto add = std::min(full - tab, tab) / 2;
|
||||
request.ymax += add;
|
||||
request.ymin -= add;
|
||||
}
|
||||
const auto scrollValue = vertical
|
||||
? scroll->scrollTop()
|
||||
: scroll->scrollLeft();
|
||||
|
Loading…
x
Reference in New Issue
Block a user