Skip to content

Commit

Permalink
UPLOAD_ARTIFACT="true" for actions
Browse files Browse the repository at this point in the history
  • Loading branch information
xmdnx committed Nov 27, 2023
1 parent 44c047a commit e61ba4c
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- "DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION"

env:
UPLOAD_ARTIFACT: "false"
UPLOAD_ARTIFACT: "true"

steps:
- name: Get repository name.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
defines:
- ""
env:
UPLOAD_ARTIFACT: "false"
UPLOAD_ARTIFACT: "true"
ONLY_CACHE: "false"
PREPARE_PATH: "Telegram/build/prepare/prepare.py"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mac_packaged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
env:
GIT: "https://github.com"
OPENALDIR: "/usr/local/opt/openal-soft"
UPLOAD_ARTIFACT: "false"
UPLOAD_ARTIFACT: "true"
ONLY_CACHE: "false"
MANUAL_CACHING: "1"
AUTO_CACHING: "1"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-20.04

env:
UPLOAD_ARTIFACT: "false"
UPLOAD_ARTIFACT: "true"

steps:
- name: Clone.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
arch: [Win32, x64]

env:
UPLOAD_ARTIFACT: "false"
UPLOAD_ARTIFACT: "true"
ONLY_CACHE: "false"
PREPARE_PATH: "Telegram/build/prepare/prepare.py"

Expand Down
148 changes: 74 additions & 74 deletions Telegram/SourceFiles/rabbit/ui/settings/icon_picker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,101 +22,101 @@ For license and copyright information please follow this link:
#endif

const QVector<QString> icons{
RabbitSettings::DEFAULT_ICON,
RabbitSettings::ANGEL_ICON,
RabbitSettings::COLOR_ICON,
RabbitSettings::IMPOSTOR_ICON,
RabbitSettings::MATRIX_ICON,
RabbitSettings::MOON_ICON,
RabbitSettings::OLD_ICON,
RabbitSettings::DEFAULT_ICON,
RabbitSettings::ANGEL_ICON,
RabbitSettings::COLOR_ICON,
RabbitSettings::IMPOSTOR_ICON,
RabbitSettings::MATRIX_ICON,
RabbitSettings::MOON_ICON,
RabbitSettings::OLD_ICON,
};

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)
{
xOffset += st::cpPadding;

if (selected) {
p.save();
p.setPen(QPen(st::iconPreviewStroke, st::cpPenSize));
p.drawEllipse(xOffset + st::cpSelectedPadding,
yOffset + st::cpSelectedPadding,
st::cpIconSize + st::cpSelectedPadding * 2,
st::cpIconSize + st::cpSelectedPadding * 2);
p.restore();
}

auto rect = QRect(xOffset + st::cpImagePadding, yOffset + st::cpImagePadding, st::cpIconSize, st::cpIconSize);
p.drawImage(rect, icon);
xOffset += st::cpPadding;

if (selected) {
p.save();
p.setPen(QPen(st::iconPreviewStroke, st::cpPenSize));
p.drawEllipse(xOffset + st::cpSelectedPadding,
yOffset + st::cpSelectedPadding,
st::cpIconSize + st::cpSelectedPadding * 2,
st::cpIconSize + st::cpSelectedPadding * 2);
p.restore();
}

auto rect = QRect(xOffset + st::cpImagePadding, yOffset + st::cpImagePadding, st::cpIconSize, st::cpIconSize);
p.drawImage(rect, icon);
}

IconPicker::IconPicker(QWidget *parent)
: RpWidget(parent)
: RpWidget(parent)
{
setMinimumSize(st::boxWidth, (st::cpIconSize + st::cpPadding) * rows);
setMinimumSize(st::boxWidth, (st::cpIconSize + st::cpPadding) * rows);
}

void IconPicker::paintEvent(QPaintEvent *e)
{
Painter p(this);
PainterHighQualityEnabler hq(p);

auto offset = st::boxWidth / 2 - (st::cpIconSize + st::cpSpacingX) * 2;

for (int row = 0; row < rows; row++) {
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;

const auto &iconName = icons[idx];
auto icon = loadPreview(iconName)
.scaled(st::cpIconSize, st::cpIconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
drawIcon(p,
icon,
(st::cpIconSize + st::cpSpacingX) * i + offset,
row * (st::cpIconSize + st::cpSpacingY),
currentAppLogoName() == iconName);
}
}
Painter p(this);
PainterHighQualityEnabler hq(p);

auto offset = st::boxWidth / 2 - (st::cpIconSize + st::cpSpacingX) * 2;

for (int row = 0; row < rows; row++) {
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;

const auto &iconName = icons[idx];
auto icon = loadPreview(iconName)
.scaled(st::cpIconSize, st::cpIconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
drawIcon(p,
icon,
(st::cpIconSize + st::cpSpacingX) * i + offset,
row * (st::cpIconSize + st::cpSpacingY),
currentAppLogoName() == iconName);
}
}
}

void IconPicker::mousePressEvent(QMouseEvent *e)
{
auto appIcon = RabbitSettings::JsonSettings::GetString("app_icon");
auto changed = false;

auto x = e->pos().x();
for (int row = 0; row < rows; row++) {
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;
auto const yOffset = row * (st::cpIconSize + st::cpSpacingY);

if (x >= xOffset && x <= xOffset + st::cpIconSize && e->pos().y() >= yOffset
auto appIcon = RabbitSettings::JsonSettings::GetString("app_icon");
auto changed = false;

auto x = e->pos().x();
for (int row = 0; row < rows; row++) {
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;
auto const yOffset = row * (st::cpIconSize + st::cpSpacingY);

if (x >= xOffset && x <= xOffset + st::cpIconSize && e->pos().y() >= yOffset
&& e->pos().y() <= yOffset + st::cpIconSize) {
const auto &iconName = icons[idx];
if (appIcon != iconName) {
RabbitSettings::JsonSettings::Set("app_icon", iconName);
changed = true;
break;
}
}
}
}

if (changed) {
const auto &iconName = icons[idx];
if (appIcon != iconName) {
RabbitSettings::JsonSettings::Set("app_icon", iconName);
changed = true;
break;
}
}
}
}

if (changed) {
#ifdef Q_OS_WIN
loadAppIco();
reloadAppIconFromTaskBar();
loadAppIco();
reloadAppIconFromTaskBar();
#endif

Window::OverrideApplicationIcon(currentAppLogo());
Core::App().refreshApplicationIcon();
Core::App().tray().updateIconCounters();
Core::App().domain().notifyUnreadBadgeChanged();
Window::OverrideApplicationIcon(currentAppLogo());
Core::App().refreshApplicationIcon();
Core::App().tray().updateIconCounters();
Core::App().domain().notifyUnreadBadgeChanged();

repaint();
}
repaint();
}
}
5 changes: 4 additions & 1 deletion Telegram/SourceFiles/ui/controls/userpic_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ For license and copyright information please follow this link:
*/
#include "ui/controls/userpic_button.h"

#include "rabbit/settings/rabbit_settings.h"

#include "base/call_delayed.h"
#include "ui/effects/ripple_animation.h"
#include "ui/empty_userpic.h"
Expand Down Expand Up @@ -132,9 +134,10 @@ void SetupSubButtonBackground(
) | rpl::start_with_next([=] {
auto p = QPainter(background);
auto hq = PainterHighQualityEnabler(p);
auto radius = RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100;
p.setBrush(st::boxBg);
p.setPen(Qt::NoPen);
p.drawEllipse(background->rect());
p.drawEllipse(background->rect(), size * radius, size * radius);
}, background->lifetime());

upload->positionValue(
Expand Down
1 change: 1 addition & 0 deletions Telegram/ThirdParty/jemalloc
Submodule jemalloc added at 54eaed

0 comments on commit e61ba4c

Please sign in to comment.