mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Added ability to paint icons in center of QRectF.
This commit is contained in:
parent
f956c0f227
commit
c9f7da6e82
7 changed files with 12 additions and 10 deletions
|
@ -195,7 +195,7 @@ PaintRoundImageCallback PremiumsRow::generatePaintUserpicCallback(
|
|||
const auto radius = size * Ui::ForumUserpicRadiusMultiplier();
|
||||
p.drawRoundedRect(x, y, size, size, radius, radius);
|
||||
}
|
||||
st::settingsPrivacyPremium.paintInCenter(p, { x, y, size, size });
|
||||
st::settingsPrivacyPremium.paintInCenter(p, QRect(x, y, size, size));
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/painter.h"
|
||||
#include "ui/rect.h"
|
||||
#include "ui/vertical_list.h"
|
||||
#include "window/window_session_controller.h"
|
||||
#include "styles/style_info.h"
|
||||
|
@ -965,9 +966,9 @@ void LinksController::rowPaintIcon(
|
|||
p.setBrush(*bg);
|
||||
{
|
||||
auto hq = PainterHighQualityEnabler(p);
|
||||
p.drawEllipse(QRect(0, 0, inner, inner));
|
||||
p.drawEllipse(Rect(Size(inner)));
|
||||
}
|
||||
st::inviteLinkIcon.paintInCenter(p, { 0, 0, inner, inner });
|
||||
st::inviteLinkIcon.paintInCenter(p, Rect(Size(inner)));
|
||||
}
|
||||
p.drawImage(x + skip, y + skip, icon);
|
||||
}
|
||||
|
|
|
@ -734,7 +734,7 @@ void LinksController::rowPaintIcon(
|
|||
} else {
|
||||
(color == Color::Revoked
|
||||
? st::inviteLinkRevokedIcon
|
||||
: st::inviteLinkIcon).paintInCenter(p, { 0, 0, inner, inner });
|
||||
: st::inviteLinkIcon).paintInCenter(p, Rect(Size(inner)));
|
||||
}
|
||||
}
|
||||
p.drawImage(x + skip, y + skip, icon);
|
||||
|
|
|
@ -3831,10 +3831,10 @@ void Message::drawRightAction(
|
|||
} else if (_rightAction->second) {
|
||||
st->historyFastCloseIcon().paintInCenter(
|
||||
p,
|
||||
{ left, top, size->width(), size->width() });
|
||||
QRect(left, top, size->width(), size->width()));
|
||||
st->historyFastMoreIcon().paintInCenter(
|
||||
p,
|
||||
{ left, size->width() + top, size->width(), size->width() });
|
||||
QRect(left, size->width() + top, size->width(), size->width()));
|
||||
} else {
|
||||
const auto &icon = data()->isSponsored()
|
||||
? st->historyFastCloseIcon()
|
||||
|
@ -3843,7 +3843,7 @@ void Message::drawRightAction(
|
|||
&& this->context() != Context::SavedSublist)
|
||||
? st->historyFastShareIcon()
|
||||
: st->historyGoToOriginalIcon();
|
||||
icon.paintInCenter(p, { left, top, size->width(), size->height() });
|
||||
icon.paintInCenter(p, Rect(left, top, *size));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -536,7 +536,7 @@ PaintRoundImageCallback BoostRow::generatePaintUserpicCallback(bool force) {
|
|||
? st::boostsListUnclaimedIcon
|
||||
: st::boostsListUnknownIcon).paintInCenter(
|
||||
p,
|
||||
{ x, y, size, size });
|
||||
Rect(x, y, Size(size)));
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
#include "ui/painter.h"
|
||||
#include "ui/rect.h"
|
||||
#include "ui/vertical_list.h"
|
||||
#include "window/window_session_controller.h"
|
||||
#include "styles/style_chat.h"
|
||||
|
@ -688,7 +689,7 @@ void LinksController::rowPaintIcon(
|
|||
auto rect = QRect(0, 0, inner, inner);
|
||||
p.drawEllipse(rect);
|
||||
}
|
||||
st::inviteLinkIcon.paintInCenter(p, { 0, 0, inner, inner });
|
||||
st::inviteLinkIcon.paintInCenter(p, Rect(Size(inner)));
|
||||
}
|
||||
p.drawImage(x + skip, y + skip, _icon);
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 1508241e092dc240ee984f2b15da972c2c5fcae1
|
||||
Subproject commit 9d2c1836ebdf48f37d1f461b19e2d4cbb60b1c2f
|
Loading…
Add table
Reference in a new issue