mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Moved out down arrow icon of "Show More" button to single place.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user