diff --git a/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp b/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp index 4d9f888d25..a2f30404a5 100644 --- a/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp +++ b/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp @@ -97,10 +97,18 @@ void SubsectionTabs::setupHorizontal(not_null parent) { st::chatTabsScroll, true); scroll->show(); + const auto shadow = Ui::CreateChild(_horizontal); const auto slider = scroll->setOwnedWidget( object_ptr(scroll)); setupSlider(scroll, slider, false); + shadow->showOn(rpl::single( + rpl::empty + ) | rpl::then( + scroll->scrolls() + ) | rpl::map([=] { return scroll->scrollLeft() > 0; })); + shadow->setAttribute(Qt::WA_TransparentForMouseEvents); + _horizontal->resize( _horizontal->width(), std::max(toggle->height(), slider->height())); @@ -121,6 +129,7 @@ void SubsectionTabs::setupHorizontal(not_null parent) { const auto togglew = toggle->width(); const auto height = size.height(); scroll->setGeometry(togglew, 0, size.width() - togglew, height); + shadow->setGeometry(togglew, 0, st::lineWidth, height); }, scroll->lifetime()); _horizontal->paintRequest() | rpl::start_with_next([=](QRect clip) { @@ -156,11 +165,18 @@ void SubsectionTabs::setupVertical(not_null parent) { _vertical, st::chatTabsScroll); scroll->show(); - + const auto shadow = Ui::CreateChild(_vertical); const auto slider = scroll->setOwnedWidget( object_ptr(scroll)); setupSlider(scroll, slider, true); + shadow->showOn(rpl::single( + rpl::empty + ) | rpl::then( + scroll->scrolls() + ) | rpl::map([=] { return scroll->scrollTop() > 0; })); + shadow->setAttribute(Qt::WA_TransparentForMouseEvents); + _vertical->resize( std::max(toggle->width(), slider->width()), _vertical->height()); @@ -170,6 +186,7 @@ void SubsectionTabs::setupVertical(not_null parent) { const auto toggleh = toggle->height(); const auto width = size.width(); scroll->setGeometry(0, toggleh, width, size.height() - toggleh); + shadow->setGeometry(0, toggleh, width, st::lineWidth); }, scroll->lifetime()); _vertical->paintRequest() | rpl::start_with_next([=](QRect clip) {