mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Improved style of icons in recent posts from list from statistics info.
This commit is contained in:
parent
9f0b4bc799
commit
1e57563349
2 changed files with 11 additions and 4 deletions
|
@ -256,12 +256,15 @@ void MessagePreview::paintEvent(QPaintEvent *e) {
|
||||||
const auto padding = st::boxRowPadding.left() / 2;
|
const auto padding = st::boxRowPadding.left() / 2;
|
||||||
const auto rightSubTextWidth = 0
|
const auto rightSubTextWidth = 0
|
||||||
+ (_sharesWidth
|
+ (_sharesWidth
|
||||||
? _sharesWidth + st::statisticsRecentPostShareIcon.width()
|
? _sharesWidth
|
||||||
|
+ st::statisticsRecentPostShareIcon.width()
|
||||||
|
+ st::statisticsRecentPostIconSkip
|
||||||
: 0)
|
: 0)
|
||||||
+ (_reactionsWidth
|
+ (_reactionsWidth
|
||||||
? _reactionsWidth
|
? _reactionsWidth
|
||||||
+ st::statisticsRecentPostReactionIcon.width()
|
+ st::statisticsRecentPostReactionIcon.width()
|
||||||
+ st::statisticsChartRulerCaptionSkip
|
+ st::statisticsChartRulerCaptionSkip
|
||||||
|
+ st::statisticsRecentPostIconSkip
|
||||||
: 0);
|
: 0);
|
||||||
const auto rightWidth = std::max(_viewsWidth, rightSubTextWidth)
|
const auto rightWidth = std::max(_viewsWidth, rightSubTextWidth)
|
||||||
+ padding;
|
+ padding;
|
||||||
|
@ -319,11 +322,13 @@ void MessagePreview::paintEvent(QPaintEvent *e) {
|
||||||
.availableWidth = _sharesWidth,
|
.availableWidth = _sharesWidth,
|
||||||
});
|
});
|
||||||
const auto bottomTextBottom = bottomTextTop
|
const auto bottomTextBottom = bottomTextTop
|
||||||
+ st::statisticsHeaderTitleTextStyle.font->height;
|
+ st::statisticsHeaderTitleTextStyle.font->height
|
||||||
|
- st::statisticsRecentPostIconSkip;
|
||||||
if (_sharesWidth) {
|
if (_sharesWidth) {
|
||||||
const auto &icon = st::statisticsRecentPostShareIcon;
|
const auto &icon = st::statisticsRecentPostShareIcon;
|
||||||
const auto iconTop = bottomTextBottom - icon.height();
|
const auto iconTop = bottomTextBottom - icon.height();
|
||||||
icon.paint(p, { (right -= icon.width()), iconTop }, width());
|
right -= st::statisticsRecentPostIconSkip + icon.width();
|
||||||
|
icon.paint(p, { right, iconTop }, width());
|
||||||
}
|
}
|
||||||
right -= _reactionsWidth + st::statisticsChartRulerCaptionSkip;
|
right -= _reactionsWidth + st::statisticsChartRulerCaptionSkip;
|
||||||
_reactions.draw(p, {
|
_reactions.draw(p, {
|
||||||
|
@ -334,7 +339,8 @@ void MessagePreview::paintEvent(QPaintEvent *e) {
|
||||||
if (_reactionsWidth) {
|
if (_reactionsWidth) {
|
||||||
const auto &icon = st::statisticsRecentPostReactionIcon;
|
const auto &icon = st::statisticsRecentPostReactionIcon;
|
||||||
const auto iconTop = bottomTextBottom - icon.height();
|
const auto iconTop = bottomTextBottom - icon.height();
|
||||||
icon.paint(p, { (right -= icon.width()), iconTop }, width());
|
right -= st::statisticsRecentPostIconSkip + icon.width();
|
||||||
|
icon.paint(p, { right, iconTop }, width());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,7 @@ statisticsRecentPostButton: SettingsButton(defaultSettingsButton) {
|
||||||
height: 56px;
|
height: 56px;
|
||||||
padding: margins(7px, 0px, 24px, 0px);
|
padding: margins(7px, 0px, 24px, 0px);
|
||||||
}
|
}
|
||||||
|
statisticsRecentPostIconSkip: 1px;
|
||||||
statisticsRecentPostShareIcon: icon {{ "statistics/mini_stats_share", windowSubTextFg }};
|
statisticsRecentPostShareIcon: icon {{ "statistics/mini_stats_share", windowSubTextFg }};
|
||||||
statisticsRecentPostReactionIcon: icon {{ "statistics/mini_stats_like", windowSubTextFg }};
|
statisticsRecentPostReactionIcon: icon {{ "statistics/mini_stats_like", windowSubTextFg }};
|
||||||
statisticsRecentPostUserpic: UserpicButton(defaultUserpicButton) {
|
statisticsRecentPostUserpic: UserpicButton(defaultUserpicButton) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue