mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 13:47:05 +02:00
fix: possibly compile on Linux
This commit is contained in:
parent
b46214a51e
commit
464a36b515
1 changed files with 6 additions and 3 deletions
|
@ -31,7 +31,8 @@ const QVector<QString> icons{
|
|||
AyuSettings::YAPLUS_ICON
|
||||
};
|
||||
|
||||
const auto rows = icons.size() / 4 + std::min(1, icons.size() % 4);
|
||||
// `static_cast<int>()` fix Linux build
|
||||
const auto rows = static_cast<int>(icons.size()) / 4 + std::min(1, static_cast<int>(icons.size()) % 4);
|
||||
|
||||
void drawIcon(QPainter &p, const QImage &icon, int xOffset, int yOffset, bool selected)
|
||||
{
|
||||
|
@ -63,7 +64,8 @@ void IconPicker::paintEvent(QPaintEvent *e)
|
|||
PainterHighQualityEnabler hq(p);
|
||||
|
||||
for (int row = 0; row < rows; row++) {
|
||||
const auto columns = std::min(4, icons.size() - row * 4);
|
||||
// `static_cast<int>()` fix Linux build
|
||||
const auto columns = std::min(4, static_cast<int>(icons.size()) - row * 4);
|
||||
for (int i = 0; i < columns; i++) {
|
||||
auto const idx = i + row * 4;
|
||||
|
||||
|
@ -86,7 +88,8 @@ void IconPicker::mousePressEvent(QMouseEvent *e)
|
|||
|
||||
auto x = e->pos().x();
|
||||
for (int row = 0; row < rows; row++) {
|
||||
const auto columns = std::min(4, icons.size() - row * 4);
|
||||
// `static_cast<int>()` fix Linux build
|
||||
const auto columns = std::min(4, static_cast<int>(icons.size()) - row * 4);
|
||||
for (int i = 0; i < columns; i++) {
|
||||
auto const idx = i + row * 4;
|
||||
auto const xOffset = (st::cpIconSize + st::cpSpacingX) * i + st::cpPadding;
|
||||
|
|
Loading…
Add table
Reference in a new issue