From e61ba4ca8054092f2b0a1205b20f0b50a572f245 Mon Sep 17 00:00:00 2001 From: xmdnx Date: Mon, 27 Nov 2023 14:54:11 +0300 Subject: [PATCH] UPLOAD_ARTIFACT="true" for actions --- .github/workflows/linux.yml | 2 +- .github/workflows/mac.yml | 2 +- .github/workflows/mac_packaged.yml | 2 +- .github/workflows/snap.yml | 2 +- .github/workflows/win.yml | 2 +- .../rabbit/ui/settings/icon_picker.cpp | 148 +++++++++--------- .../ui/controls/userpic_button.cpp | 5 +- Telegram/ThirdParty/jemalloc | 1 + 8 files changed, 84 insertions(+), 80 deletions(-) create mode 160000 Telegram/ThirdParty/jemalloc diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9dc35d6fd6e714..1c0ec6691682a1 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -62,7 +62,7 @@ jobs: - "DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION" env: - UPLOAD_ARTIFACT: "false" + UPLOAD_ARTIFACT: "true" steps: - name: Get repository name. diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 1d47762750f584..3ac1d563c96483 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -48,7 +48,7 @@ jobs: defines: - "" env: - UPLOAD_ARTIFACT: "false" + UPLOAD_ARTIFACT: "true" ONLY_CACHE: "false" PREPARE_PATH: "Telegram/build/prepare/prepare.py" diff --git a/.github/workflows/mac_packaged.yml b/.github/workflows/mac_packaged.yml index 631ff2a70a28cb..45be743ce2db47 100644 --- a/.github/workflows/mac_packaged.yml +++ b/.github/workflows/mac_packaged.yml @@ -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" diff --git a/.github/workflows/snap.yml b/.github/workflows/snap.yml index 0c5c430bd04ee1..4f133ecaf97e65 100644 --- a/.github/workflows/snap.yml +++ b/.github/workflows/snap.yml @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-20.04 env: - UPLOAD_ARTIFACT: "false" + UPLOAD_ARTIFACT: "true" steps: - name: Clone. diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml index 2eb3080116e562..94fa44de867627 100644 --- a/.github/workflows/win.yml +++ b/.github/workflows/win.yml @@ -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" diff --git a/Telegram/SourceFiles/rabbit/ui/settings/icon_picker.cpp b/Telegram/SourceFiles/rabbit/ui/settings/icon_picker.cpp index 11a3c8e5b626bd..7b43af16ddb121 100644 --- a/Telegram/SourceFiles/rabbit/ui/settings/icon_picker.cpp +++ b/Telegram/SourceFiles/rabbit/ui/settings/icon_picker.cpp @@ -22,101 +22,101 @@ For license and copyright information please follow this link: #endif const QVector 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(icons.size()) / 4 + std::min(1, static_cast(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(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(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(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(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(); + } } \ No newline at end of file diff --git a/Telegram/SourceFiles/ui/controls/userpic_button.cpp b/Telegram/SourceFiles/ui/controls/userpic_button.cpp index d6f1f1f0ca67fc..ae9417761024e4 100644 --- a/Telegram/SourceFiles/ui/controls/userpic_button.cpp +++ b/Telegram/SourceFiles/ui/controls/userpic_button.cpp @@ -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" @@ -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( diff --git a/Telegram/ThirdParty/jemalloc b/Telegram/ThirdParty/jemalloc new file mode 160000 index 00000000000000..54eaed1d8b56b1 --- /dev/null +++ b/Telegram/ThirdParty/jemalloc @@ -0,0 +1 @@ +Subproject commit 54eaed1d8b56b1aa528be3bdd1877e59c56fa90c