mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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();
|
const auto radius = size * Ui::ForumUserpicRadiusMultiplier();
|
||||||
p.drawRoundedRect(x, y, size, size, radius, radius);
|
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/vertical_layout.h"
|
||||||
#include "ui/wrap/slide_wrap.h"
|
#include "ui/wrap/slide_wrap.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
|
#include "ui/rect.h"
|
||||||
#include "ui/vertical_list.h"
|
#include "ui/vertical_list.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "styles/style_info.h"
|
#include "styles/style_info.h"
|
||||||
|
@ -965,9 +966,9 @@ void LinksController::rowPaintIcon(
|
||||||
p.setBrush(*bg);
|
p.setBrush(*bg);
|
||||||
{
|
{
|
||||||
auto hq = PainterHighQualityEnabler(p);
|
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);
|
p.drawImage(x + skip, y + skip, icon);
|
||||||
}
|
}
|
||||||
|
|
|
@ -734,7 +734,7 @@ void LinksController::rowPaintIcon(
|
||||||
} else {
|
} else {
|
||||||
(color == Color::Revoked
|
(color == Color::Revoked
|
||||||
? st::inviteLinkRevokedIcon
|
? st::inviteLinkRevokedIcon
|
||||||
: st::inviteLinkIcon).paintInCenter(p, { 0, 0, inner, inner });
|
: st::inviteLinkIcon).paintInCenter(p, Rect(Size(inner)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.drawImage(x + skip, y + skip, icon);
|
p.drawImage(x + skip, y + skip, icon);
|
||||||
|
|
|
@ -3831,10 +3831,10 @@ void Message::drawRightAction(
|
||||||
} else if (_rightAction->second) {
|
} else if (_rightAction->second) {
|
||||||
st->historyFastCloseIcon().paintInCenter(
|
st->historyFastCloseIcon().paintInCenter(
|
||||||
p,
|
p,
|
||||||
{ left, top, size->width(), size->width() });
|
QRect(left, top, size->width(), size->width()));
|
||||||
st->historyFastMoreIcon().paintInCenter(
|
st->historyFastMoreIcon().paintInCenter(
|
||||||
p,
|
p,
|
||||||
{ left, size->width() + top, size->width(), size->width() });
|
QRect(left, size->width() + top, size->width(), size->width()));
|
||||||
} else {
|
} else {
|
||||||
const auto &icon = data()->isSponsored()
|
const auto &icon = data()->isSponsored()
|
||||||
? st->historyFastCloseIcon()
|
? st->historyFastCloseIcon()
|
||||||
|
@ -3843,7 +3843,7 @@ void Message::drawRightAction(
|
||||||
&& this->context() != Context::SavedSublist)
|
&& this->context() != Context::SavedSublist)
|
||||||
? st->historyFastShareIcon()
|
? st->historyFastShareIcon()
|
||||||
: st->historyGoToOriginalIcon();
|
: 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::boostsListUnclaimedIcon
|
||||||
: st::boostsListUnknownIcon).paintInCenter(
|
: st::boostsListUnknownIcon).paintInCenter(
|
||||||
p,
|
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/slide_wrap.h"
|
||||||
#include "ui/wrap/vertical_layout.h"
|
#include "ui/wrap/vertical_layout.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
|
#include "ui/rect.h"
|
||||||
#include "ui/vertical_list.h"
|
#include "ui/vertical_list.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
@ -688,7 +689,7 @@ void LinksController::rowPaintIcon(
|
||||||
auto rect = QRect(0, 0, inner, inner);
|
auto rect = QRect(0, 0, inner, inner);
|
||||||
p.drawEllipse(rect);
|
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);
|
p.drawImage(x + skip, y + skip, _icon);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 1508241e092dc240ee984f2b15da972c2c5fcae1
|
Subproject commit 9d2c1836ebdf48f37d1f461b19e2d4cbb60b1c2f
|
Loading…
Add table
Reference in a new issue