Moved out down arrow icon of "Show More" button to single place.

This commit is contained in:
23rd
2024-11-16 07:28:54 +03:00
parent 5eb59a1a43
commit f7ca8212aa
4 changed files with 32 additions and 44 deletions
@@ -7,6 +7,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "ui/effects/toggle_arrow.h"
#include "ui/rp_widget.h"
#include "ui/painter.h"
#include "ui/rect.h"
#include "styles/style_statistics.h"
#include "styles/style_window.h"
#include <QtCore/QtMath>
namespace Ui {
@@ -50,4 +56,24 @@ namespace Ui {
return path;
}
void AddToggleUpDownArrowToMoreButton(not_null<Ui::RpWidget*> parent) {
const auto arrow = Ui::CreateChild<Ui::RpWidget>(parent.get());
arrow->paintRequest() | rpl::start_with_next([=](const QRect &r) {
auto p = QPainter(arrow);
const auto path = ToggleUpDownArrowPath(
st::statisticsShowMoreButtonArrowSize,
st::statisticsShowMoreButtonArrowSize,
st::statisticsShowMoreButtonArrowSize,
st::mainMenuToggleFourStrokes,
0.);
auto hq = PainterHighQualityEnabler(p);
p.fillPath(path, st::lightButtonFg);
}, arrow->lifetime());
arrow->resize(Size(st::statisticsShowMoreButtonArrowSize * 2));
arrow->move(st::statisticsShowMoreButtonArrowPosition);
arrow->show();
}
} // namespace Ui