Compare commits

...

17 Commits

Author SHA1 Message Date
John Preston
3dccdf2f05 Beta version 5.4.5.
- Fix possible crash in text rendering.
2024-09-01 10:19:39 +04:00
John Preston
8a708c6655 Update Qt to 5.15.15 on Windows. 2024-09-01 10:19:39 +04:00
Ilya Fedin
9e1d9eee4b Fix snap build 2024-08-31 20:09:36 +02:00
Ilya Fedin
f30aabc365 Update Qt 6.7.2 -> 6.8.0 2024-08-31 19:54:58 +02:00
John Preston
a5546d016f Fix possible crash in long-word texts. 2024-08-31 21:48:52 +04:00
John Preston
f79d70d112 Use Ui::Text::String in Ui::RoundButton. 2024-08-31 21:48:52 +04:00
John Preston
ec28f258fb Use full bubble width in message text rendering.
Fixes #28331.
2024-08-31 21:48:52 +04:00
John Preston
08f3a6fb40 Fix local group sent-as display. 2024-08-31 21:48:52 +04:00
John Preston
8823d5256f Fix indentation. 2024-08-31 21:48:52 +04:00
23rd
60e7aa90d2 Added ability to report profile photo from peer info section. 2024-08-31 12:34:50 +03:00
John Preston
71357a9546 Fix archive chats list bidi support. 2024-08-29 17:48:06 +04:00
John Preston
a5b06e9c56 Fix possible crash in text elision. 2024-08-29 17:41:15 +04:00
23rd
0f94419f6d Improved fix of crash in video messages playback.
Regression was introduced in ad3e447f08.
2024-08-29 17:37:55 +04:00
John Preston
94e7aabea5 Fix spaces after emoji in text rendering. 2024-08-29 17:19:28 +04:00
John Preston
f6c816cafe Beta version 5.4.4.
- Fix wrong layout and crashes in text shaping.
- Fix crashes in voice / video messages playback.
2024-08-29 13:01:06 +04:00
John Preston
4cf160e8dc Fix UB in text shaping. 2024-08-29 12:54:52 +04:00
John Preston
9252be5e8c Fix crash in video messages playback.
Regression was introduced in ad3e447f08.
2024-08-29 12:13:51 +04:00
48 changed files with 224 additions and 131 deletions

View File

@@ -10,7 +10,7 @@
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
ProcessorArchitecture="ARCHITECTURE"
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
Version="5.4.3.0" />
Version="5.4.5.0" />
<Properties>
<DisplayName>Telegram Desktop</DisplayName>
<PublisherDisplayName>Telegram Messenger LLP</PublisherDisplayName>

View File

@@ -44,8 +44,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,4,3,0
PRODUCTVERSION 5,4,3,0
FILEVERSION 5,4,5,0
PRODUCTVERSION 5,4,5,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -62,10 +62,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop"
VALUE "FileVersion", "5.4.3.0"
VALUE "FileVersion", "5.4.5.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.4.3.0"
VALUE "ProductVersion", "5.4.5.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -35,8 +35,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,4,3,0
PRODUCTVERSION 5,4,3,0
FILEVERSION 5,4,5,0
PRODUCTVERSION 5,4,5,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -53,10 +53,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "Telegram FZ-LLC"
VALUE "FileDescription", "Telegram Desktop Updater"
VALUE "FileVersion", "5.4.3.0"
VALUE "FileVersion", "5.4.5.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2024"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "5.4.3.0"
VALUE "ProductVersion", "5.4.5.0"
END
END
BLOCK "VarFileInfo"

View File

@@ -12,6 +12,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/core_cloud_password.h"
#include "passport/passport_encryption.h"
#include "base/unixtime.h"
#include "base/call_delayed.h"
namespace Api {
namespace {
@@ -78,6 +81,11 @@ auto CloudPassword::stateCurrent() const
auto CloudPassword::resetPassword()
-> rpl::producer<CloudPassword::ResetRetryDate, QString> {
return [=](auto consumer) {
base::call_delayed(3000, [=] {
consumer.put_next_copy(base::unixtime::now() + 86400);
consumer.put_done();
});
return rpl::lifetime();
_api.request(MTPaccount_ResetPassword(
)).done([=](const MTPaccount_ResetPasswordResult &result) {
result.match([&](const MTPDaccount_resetPasswordOk &data) {

View File

@@ -44,7 +44,10 @@ void InnerFillMessagePostFlags(
if (ShouldSendSilent(peer, options)) {
flags |= MessageFlag::Silent;
}
if (!peer->amAnonymous()) {
if (!peer->amAnonymous()
|| (!peer->isBroadcast()
&& options.sendAs
&& options.sendAs != peer)) {
flags |= MessageFlag::HasFromId;
}
const auto channel = peer->asBroadcast();

View File

@@ -787,7 +787,7 @@ backgroundConfirmPadding: margins(24px, 16px, 24px, 16px);
backgroundConfirm: RoundButton(defaultActiveButton) {
height: 44px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
}
backgroundConfirmCancel: RoundButton(backgroundConfirm) {
textFg: mediaviewSaveMsgFg;
@@ -799,7 +799,7 @@ backgroundConfirmCancel: RoundButton(backgroundConfirm) {
height: 44px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
ripple: RippleAnimation(defaultRippleAnimation) {
color: shadowFg;
@@ -951,7 +951,7 @@ sponsoredUrlButton: RoundButton(defaultActiveButton) {
textFg: historyLinkInFg;
textFgOver: historyLinkInFg;
textTop: 7px;
font: normalFont;
style: defaultTextStyle;
ripple: RippleAnimation(defaultRippleAnimation) {
color: windowBgOver;

View File

@@ -241,8 +241,8 @@ RequestsBoxController::RowHelper::RowHelper(bool isGroup)
? tr::lng_group_requests_add(tr::now)
: tr::lng_group_requests_add_channel(tr::now))
, _rejectText(tr::lng_group_requests_dismiss(tr::now))
, _acceptTextWidth(st::requestsAcceptButton.font->width(_acceptText))
, _rejectTextWidth(st::requestsRejectButton.font->width(_rejectText)) {
, _acceptTextWidth(st::requestsAcceptButton.style.font->width(_acceptText))
, _rejectTextWidth(st::requestsRejectButton.style.font->width(_rejectText)) {
}
RequestsBoxController::RequestsBoxController(
@@ -491,7 +491,7 @@ void RequestsBoxController::RowHelper::paintButton(
const auto textLeft = geometry.x()
+ ((geometry.width() - textWidth) / 2);
const auto textTop = geometry.y() + st.textTop;
p.setFont(st.font);
p.setFont(st.style.font);
p.setPen(over ? st.textFgOver : st.textFg);
p.drawTextLeft(textLeft, textTop, outerWidth, text);
}

View File

@@ -1216,11 +1216,12 @@ StickersBox::Inner::Inner(
})
, _itemsTop(st::lineWidth)
, _addText(tr::lng_stickers_featured_add(tr::now))
, _addWidth(st::stickersTrendingAdd.font->width(_addText))
, _addWidth(st::stickersTrendingAdd.style.font->width(_addText))
, _undoText(tr::lng_stickers_return(tr::now))
, _undoWidth(st::stickersUndoRemove.font->width(_undoText))
, _undoWidth(st::stickersUndoRemove.style.font->width(_undoText))
, _installedText(tr::lng_stickers_featured_installed(tr::now))
, _installedWidth(st::stickersTrendingInstalled.font->width(_installedText)) {
, _installedWidth(st::stickersTrendingInstalled.style.font->width(
_installedText)) {
setup();
}
@@ -1666,7 +1667,7 @@ void StickersBox::Inner::paintFakeButton(Painter &p, not_null<Row*> row, int ind
row->ripple.reset();
}
}
p.setFont(st.font);
p.setFont(st.style.font);
p.setPen(st.textFg);
p.drawTextLeft(rect.x() - (st.width / 2), rect.y() + st.textTop, width(), text, textWidth);
} else {
@@ -1700,7 +1701,7 @@ void StickersBox::Inner::paintFakeButton(Painter &p, not_null<Row*> row, int ind
row->ripple.reset();
}
}
p.setFont(st.font);
p.setFont(st.style.font);
p.setPen(selected ? st.textFgOver : st.textFg);
p.drawTextLeft(rect.x() - (st.width / 2), rect.y() + st.textTop, width(), text, textWidth);
}

View File

@@ -296,7 +296,9 @@ emojiPanButton: RoundButton(defaultActiveButton) {
textTop: 2px;
}
emojiPanExpand: RoundButton(defaultActiveButton) {
font: font(12px bold);
style: TextStyle(semiboldTextStyle) {
font: font(12px bold);
}
width: -8px;
height: 19px;
textTop: 1px;
@@ -1499,5 +1501,7 @@ pickLocationChooseOnMap: RoundButton(defaultActiveButton) {
height: 44px;
textTop: 11px;
width: -96px;
font: font(15px semibold);
style: TextStyle(semiboldTextStyle) {
font: font(15px semibold);
}
}

View File

@@ -1450,17 +1450,17 @@ void EmojiListWidget::drawCollapsedBadge(
int count) {
const auto &st = st::emojiPanExpand;
const auto text = u"+%1"_q.arg(count - _columnCount * kCollapsedRows + 1);
const auto textWidth = st.font->width(text);
const auto textWidth = st.style.font->width(text);
const auto buttonw = std::max(textWidth - st.width, st.height);
const auto buttonh = st.height;
const auto buttonx = position.x() + (_singleSize.width() - buttonw) / 2;
const auto buttony = position.y() + (_singleSize.height() - buttonh) / 2;
_collapsedBg.paint(p, QRect(buttonx, buttony, buttonw, buttonh));
p.setPen(this->st().bg);
p.setFont(st.font);
p.setFont(st.style.font);
p.drawText(
buttonx + (buttonw - textWidth) / 2,
(buttony + st.textTop + st.font->ascent),
(buttony + st.textTop + st.style.font->ascent),
text);
}
@@ -2546,12 +2546,12 @@ int EmojiListWidget::paintButtonGetWidth(
: selected
? st::emojiPanButton.textFgOver
: st::emojiPanButton.textFg);
p.setFont(st::emojiPanButton.font);
p.setFont(st::emojiPanButton.style.font);
p.drawText(
rect.x() - (st::emojiPanButton.width / 2),
(rect.y()
+ st::emojiPanButton.textTop
+ st::emojiPanButton.font->ascent),
+ st::emojiPanButton.style.font->ascent),
button.text);
return emojiRight() - rect.x();
}
@@ -2678,7 +2678,7 @@ void EmojiListWidget::initButton(
const QString &text,
bool gradient) {
button.text = text;
button.textWidth = st::emojiPanButton.font->width(text);
button.textWidth = st::emojiPanButton.style.font->width(text);
const auto width = button.textWidth - st::emojiPanButton.width;
const auto height = st::emojiPanButton.height;
const auto factor = style::DevicePixelRatio();

View File

@@ -213,11 +213,14 @@ StickersListWidget::StickersListWidget(
st().pathBg,
st().pathFg,
[=] { update(); }))
, _megagroupSetAbout(st::columnMinimalWidthThird - st::emojiScroll.width - st().headerLeft)
, _megagroupSetAbout(st::columnMinimalWidthThird
- st::emojiScroll.width
- st().headerLeft)
, _addText(tr::lng_stickers_featured_add(tr::now))
, _addWidth(st::stickersTrendingAdd.font->width(_addText))
, _addWidth(st::stickersTrendingAdd.style.font->width(_addText))
, _installedText(tr::lng_stickers_featured_installed(tr::now))
, _installedWidth(st::stickersTrendingInstalled.font->width(_installedText))
, _installedWidth(
st::stickersTrendingInstalled.style.font->width(_installedText))
, _settings(this, tr::lng_stickers_you_have(tr::now))
, _previewTimer([=] { showPreview(); })
, _premiumMark(std::make_unique<StickerPremiumMark>(
@@ -974,7 +977,7 @@ void StickersListWidget::paintStickers(Painter &p, QRect clip) {
const auto &st = installedSet
? st::stickersTrendingInstalled
: st::stickersTrendingAdd;
p.setFont(st.font);
p.setFont(st.style.font);
p.setPen(selected ? st.textFgOver : st.textFg);
p.drawTextLeft(
add.x() - (st.width / 2),
@@ -1238,7 +1241,7 @@ void StickersListWidget::paintMegagroupEmptySet(Painter &p, int y, bool buttonSe
_megagroupSetButtonRipple.reset();
}
}
p.setFont(st::stickerGroupCategoryAdd.font);
p.setFont(st::stickerGroupCategoryAdd.style.font);
p.setPen(buttonSelected ? st::stickerGroupCategoryAdd.textFgOver : st::stickerGroupCategoryAdd.textFg);
p.drawTextLeft(button.x() - (st::stickerGroupCategoryAdd.width / 2), button.y() + st::stickerGroupCategoryAdd.textTop, width(), _megagroupSetButtonText, _megagroupSetButtonTextWidth);
}
@@ -2734,7 +2737,7 @@ void StickersListWidget::refreshMegagroupSetGeometry() {
auto left = megagroupSetInfoLeft();
auto availableWidth = (width() - left);
auto top = _megagroupSetAbout.countHeight(availableWidth) + st::stickerGroupCategoryAddMargin.top();
_megagroupSetButtonTextWidth = st::stickerGroupCategoryAdd.font->width(_megagroupSetButtonText);
_megagroupSetButtonTextWidth = st::stickerGroupCategoryAdd.style.font->width(_megagroupSetButtonText);
auto buttonWidth = _megagroupSetButtonTextWidth - st::stickerGroupCategoryAdd.width;
_megagroupSetButtonRect = QRect(left, top, buttonWidth, st::stickerGroupCategoryAdd.height);
}

View File

@@ -22,7 +22,7 @@ constexpr auto AppId = "{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"_cs;
constexpr auto AppNameOld = "Telegram Win (Unofficial)"_cs;
constexpr auto AppName = "Telegram Desktop"_cs;
constexpr auto AppFile = "Telegram"_cs;
constexpr auto AppVersion = 5004003;
constexpr auto AppVersionStr = "5.4.3";
constexpr auto AppVersion = 5004005;
constexpr auto AppVersionStr = "5.4.5";
constexpr auto AppBetaVersion = true;
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;

View File

@@ -70,7 +70,7 @@ constexpr auto kShowChatNamesCount = 8;
);
const auto wrapName = [](not_null<History*> history) {
const auto name = history->peer->name();
return TextWithEntities{
return st::wrap_rtl(TextWithEntities{
.text = name,
.entities = (history->chatListBadgesState().unread
? EntitiesInText{
@@ -78,7 +78,7 @@ constexpr auto kShowChatNamesCount = 8;
{ EntityType::Colorized, 0, int(name.size()), QString() },
}
: EntitiesInText{}),
};
});
};
const auto shown = int(peers.size());
const auto accumulated = [&] {

View File

@@ -70,14 +70,18 @@ exportCancelButton: RoundButton(attentionBoxButton) {
width: 200px;
height: 44px;
textTop: 12px;
font: font(semibold 15px);
style: TextStyle(semiboldTextStyle) {
font: font(semibold 15px);
}
}
exportCancelBottom: 30px;
exportDoneButton: RoundButton(defaultActiveButton) {
width: 200px;
height: 44px;
textTop: 12px;
font: font(semibold 15px);
style: TextStyle(semiboldTextStyle) {
font: font(semibold 15px);
}
}
exportAboutLabel: FlatLabel(boxLabel) {

View File

@@ -362,9 +362,9 @@ void ProgressWidget::showDone() {
tr::lng_export_done(),
st::exportDoneButton);
const auto desired = std::min(
st::exportDoneButton.font->width(tr::lng_export_done(tr::now))
st::exportDoneButton.style.font->width(tr::lng_export_done(tr::now))
+ st::exportDoneButton.height
- st::exportDoneButton.font->height,
- st::exportDoneButton.style.font->height,
st::exportPanelSize.width() - 2 * st::exportCancelBottom);
if (_done->width() < desired) {
_done->setFullWidth(desired);

View File

@@ -1933,6 +1933,7 @@ void Message::paintText(
.pausedSpoiler = context.paused || On(PowerSaving::kChatSpoiler),
.selection = context.selection,
.highlight = highlightRequest ? &*highlightRequest : nullptr,
.useFullWidth = true,
});
}

View File

@@ -91,7 +91,7 @@ constexpr auto kPremiumToastDuration = 5 * crl::time(1000);
result->paintRequest() | rpl::start_with_next([=] {
auto p = QPainter(result);
const auto font = st::historyPremiumViewSet.font;
const auto font = st::historyPremiumViewSet.style.font;
const auto top = (result->height() - font->height) / 2;
auto pen = st::historyPremiumViewSet.textFg->p;
p.setPen(pen);
@@ -229,7 +229,7 @@ void PaidReactionToast::showFor(
child->show();
const auto leftSkip = skip + size + skip - st.padding.left();
const auto undoFont = st::historyPremiumViewSet.font;
const auto undoFont = st::historyPremiumViewSet.style.font;
const auto rightSkip = undoFont->width(undoText)
+ st::toastUndoSpace

View File

@@ -154,7 +154,7 @@ void StickerToast::showWithTitle(const QString &title) {
? tr::lng_animated_emoji_saved_open(tr::now)
: tr::lng_sticker_premium_view(tr::now);
_st.padding.setLeft(skip + size + skip);
_st.padding.setRight(st::historyPremiumViewSet.font->width(view)
_st.padding.setRight(st::historyPremiumViewSet.style.font->width(view)
- st::historyPremiumViewSet.width);
clearHiddenHiding();

View File

@@ -518,7 +518,7 @@ void TranslateBar::showToast(
const QString &buttonText,
Fn<void()> buttonCallback) {
const auto st = std::make_shared<style::Toast>(st::historyPremiumToast);
st->padding.setRight(st::historyPremiumViewSet.font->width(buttonText)
st->padding.setRight(st::historyPremiumViewSet.style.font->width(buttonText)
- st::historyPremiumViewSet.width);
const auto weak = Ui::Toast::Show(_wrap.window(), Ui::Toast::Config{

View File

@@ -60,9 +60,7 @@ giveawayGiftCodeQuantitySubtitle: FlatLabel(defaultFlatLabel) {
align: align(right);
}
giveawayGiftCodeQuantityFloat: FlatLabel(defaultFlatLabel) {
style: TextStyle(semiboldTextStyle) {
font: font(13px);
}
style: semiboldTextStyle;
textFg: windowActiveTextFg;
minWidth: 50px;
align: align(center);
@@ -164,7 +162,7 @@ giveawayGiftCodeBox: Box(defaultBox) {
button: RoundButton(defaultActiveButton) {
height: 42px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
}
shadowIgnoreTopSkip: true;
}

View File

@@ -32,8 +32,7 @@ channelEarnOverviewSubMinorLabel: FlatLabel(channelEarnOverviewMinorLabel) {
}
channelEarnOverviewSubMinorLabelPos: point(4px, 2px);
channelEarnSemiboldLabel: FlatLabel(channelEarnOverviewMajorLabel) {
style: TextStyle(semiboldTextStyle) {
}
style: semiboldTextStyle;
}
channelEarnHeaderLabel: FlatLabel(channelEarnOverviewMajorLabel) {
style: TextStyle(statisticsHeaderTitleTextStyle) {
@@ -91,7 +90,7 @@ channelEarnHistoryRecipientButton: RoundButton {
iconPosition: point(0px, 0px);
font: semiboldFont;
style: semiboldTextStyle;
ripple: RippleAnimation(defaultRippleAnimation) {
color: windowBgRipple;

View File

@@ -368,7 +368,9 @@ infoProfileCover: InfoProfileCover {
width: -12px;
height: 18px;
textTop: 0px;
font: font(12px);
style: TextStyle(defaultTextStyle) {
font: font(12px);
}
ripple: defaultRippleAnimation;
}
showLastSeenPosition: point(3px, 58px);
@@ -607,8 +609,7 @@ infoMembersCancelSearch: CrossButton {
}
infoMembersSearchTop: 15px;
infoMediaHeaderStyle: TextStyle(semiboldTextStyle) {
}
infoMediaHeaderStyle: semiboldTextStyle;
infoMediaHeaderHeight: 28px;
infoMediaHeaderPosition: point(14px, 6px);
infoMediaSkip: 2px;
@@ -1100,7 +1101,7 @@ similarChannelsLockFade: 58px;
similarChannelsLock: RoundButton(defaultActiveButton) {
height: 44px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
}
similarChannelsLockLabel: FlatLabel(defaultFlatLabel) {
textFg: premiumButtonFg;

View File

@@ -24,13 +24,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/profile/info_profile_emoji_status_panel.h"
#include "info/info_controller.h"
#include "boxes/peers/edit_forum_topic_box.h"
#include "boxes/report_messages_box.h"
#include "history/view/media/history_view_sticker_player.h"
#include "lang/lang_keys.h"
#include "ui/boxes/show_or_premium_box.h"
#include "ui/controls/userpic_button.h"
#include "ui/widgets/buttons.h"
#include "ui/widgets/labels.h"
#include "ui/widgets/popup_menu.h"
#include "ui/text/text_utilities.h"
#include "base/event_filter.h"
#include "base/unixtime.h"
#include "window/window_session_controller.h"
#include "main/main_session.h"
@@ -41,6 +44,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_boxes.h"
#include "styles/style_info.h"
#include "styles/style_dialogs.h"
#include "styles/style_menu_icons.h"
namespace Info::Profile {
namespace {
@@ -504,7 +508,7 @@ void Cover::refreshUploadPhotoOverlay() {
return;
}
_userpic->switchChangePhotoOverlay([&] {
const auto canChange = [&] {
if (const auto chat = _peer->asChat()) {
return chat->canEditInformation();
} else if (const auto channel = _peer->asChannel()) {
@@ -516,7 +520,10 @@ void Cover::refreshUploadPhotoOverlay() {
&& !user->isServiceUser());
}
Unexpected("Peer type in Info::Profile::Cover.");
}(), [=](Ui::UserpicButton::ChosenImage chosen) {
}();
_userpic->switchChangePhotoOverlay(canChange, [=](
Ui::UserpicButton::ChosenImage chosen) {
using ChosenType = Ui::UserpicButton::ChosenType;
auto result = Api::PeerPhoto::UserPhoto{
base::take<QImage>(chosen.image), // Strange MSVC bug with take.
@@ -538,6 +545,53 @@ void Cover::refreshUploadPhotoOverlay() {
}
});
const auto canReport = [=, peer = _peer] {
if (!peer->hasUserpic()) {
return false;
}
const auto user = peer->asUser();
if (!user) {
if (canChange) {
return false;
}
} else if (user->hasPersonalPhoto()
|| user->isSelf()
|| user->isInaccessible()
|| user->isRepliesChat()
|| (user->botInfo && user->botInfo->canEditInformation)
|| user->isServiceUser()) {
return false;
}
return true;
};
const auto contextMenu = _userpic->lifetime()
.make_state<base::unique_qptr<Ui::PopupMenu>>();
const auto showMenu = [=, peer = _peer, controller = _controller](
not_null<Ui::RpWidget*> parent) {
if (!canReport()) {
return false;
}
*contextMenu = base::make_unique_q<Ui::PopupMenu>(
parent,
st::popupMenuWithIcons);
contextMenu->get()->addAction(tr::lng_profile_report(tr::now), [=] {
controller->show(
ReportProfilePhotoBox(
peer,
peer->owner().photo(peer->userpicPhotoId())),
Ui::LayerOption::CloseOther);
}, &st::menuIconReport);
contextMenu->get()->popup(QCursor::pos());
return true;
};
base::install_event_filter(_userpic, [showMenu, raw = _userpic.data()](
not_null<QEvent*> e) {
return (e->type() == QEvent::ContextMenu && showMenu(raw))
? base::EventFilterResult::Cancel
: base::EventFilterResult::Continue;
});
if (const auto user = _peer->asUser()) {
_userpic->resetPersonalRequests(
) | rpl::start_with_next([=] {

View File

@@ -149,7 +149,7 @@ private:
const std::unique_ptr<Badge> _badge;
rpl::variable<int> _onlineCount;
object_ptr<Ui::UserpicButton> _userpic;
const object_ptr<Ui::UserpicButton> _userpic;
Ui::UserpicButton *_changePersonal = nullptr;
std::optional<QImage> _personalChosen;
object_ptr<TopicIconButton> _iconButton;

View File

@@ -81,7 +81,9 @@ introNextButton: RoundButton(defaultActiveButton) {
height: 42px;
radius: 6px;
textTop: 11px;
font: font(boxFontSize semibold);
style: TextStyle(semiboldTextStyle) {
font: font(boxFontSize semibold);
}
}
introFragmentIcon: icon{{ "fragment", activeButtonFg }};
introFragmentIconOver: icon{{ "fragment", activeButtonFgOver }};

View File

@@ -432,7 +432,7 @@ QByteArray Parser::block(const MTPDpageBlockFooter &data) {
}
QByteArray Parser::block(const MTPDpageBlockDivider &data) {
return tag("hr", { { "class", "divider" } });
return tag("hr", Attributes{ { "class", "divider" } });
}
QByteArray Parser::block(const MTPDpageBlockAnchor &data) {

View File

@@ -670,8 +670,9 @@ void Widget::updateTimeLabel() {
void Widget::handleSongChange() {
const auto current = instance()->current(_type);
const auto document = current.audio();
_lastSongFromAnotherSession = (document->session().uniqueId()
!= _controller->session().uniqueId());
_lastSongFromAnotherSession = document
&& (document->session().uniqueId()
!= _controller->session().uniqueId());
if (!current
|| !document
|| ((_lastSongId.audio() == document)

View File

@@ -371,11 +371,15 @@ themePreviewLoadingFont: font(16px);
themePreviewLoadingFg: windowSubTextFg;
themePreviewApplyButton: RoundButton(defaultActiveButton) {
height: 38px;
font: font(15px semibold);
style: TextStyle(semiboldTextStyle) {
font: font(15px semibold);
}
}
themePreviewCancelButton: RoundButton(defaultLightButton) {
height: 38px;
font: font(15px semibold);
style: TextStyle(semiboldTextStyle) {
font: font(15px semibold);
}
}
themePreviewButtonsSkip: 20px;
themePreviewDialogsWidth: 312px;
@@ -796,7 +800,9 @@ storiesComposeControls: ComposeControls(defaultComposeControls) {
width: -12px;
height: 18px;
textTop: 0px;
font: font(12px);
style: TextStyle(defaultTextStyle) {
font: font(12px);
}
ripple: storiesComposeRipple;
}
buttonSkip: 6px;
@@ -959,7 +965,7 @@ storiesStealthBox: Box(defaultBox) {
button: RoundButton(defaultBoxButton) {
height: 42px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
textFg: storiesComposeWhiteText;
textFgOver: storiesComposeWhiteText;

View File

@@ -4917,7 +4917,7 @@ void OverlayWidget::paintThemePreviewContent(
+ (_themeShare->y() - _themePreviewRect.y())
+ st::themePreviewCancelButton.padding.top()
+ st::themePreviewCancelButton.textTop
+ st::themePreviewCancelButton.font->ascent;
+ st::themePreviewCancelButton.style.font->ascent;
p.drawText(
left,
baseline,

View File

@@ -49,7 +49,9 @@ passportPasswordSubmit: RoundButton(defaultActiveButton) {
width: 200px;
height: 44px;
textTop: 12px;
font: font(semibold 15px);
style: TextStyle(semiboldTextStyle) {
font: font(semibold 15px);
}
}
passportPasswordSubmitBottom: 72px;
passportPasswordForgotBottom: 36px;

View File

@@ -14,12 +14,16 @@ paymentsPanelSize: size(392px, 600px);
paymentsPanelButton: RoundButton(defaultBoxButton) {
width: -36px;
height: 36px;
font: boxButtonFont;
style: TextStyle(defaultTextStyle) {
font: boxButtonFont;
}
}
paymentsPanelSubmit: RoundButton(defaultActiveButton) {
width: -36px;
height: 36px;
font: boxButtonFont;
style: TextStyle(defaultTextStyle) {
font: boxButtonFont;
}
}
paymentsPanelPadding: margins(8px, 12px, 15px, 12px);
@@ -139,6 +143,8 @@ paymentsLoading: InfiniteRadialAnimation(defaultInfiniteRadialAnimation) {
botWebViewPanelSize: size(384px, 694px);
botWebViewBottomButton: RoundButton(paymentsPanelSubmit) {
height: 56px;
font: boxButtonFont;
style: TextStyle(defaultTextStyle) {
font: boxButtonFont;
}
textTop: 19px;
}

View File

@@ -61,7 +61,7 @@ void BackButton::paintEvent(QPaintEvent *e) {
p.fillRect(e->rect(), st::profileBg);
st::topBarBack.paint(p, (st::topBarArrowPadding.left() - st::topBarBack.width()) / 2, (st::topBarHeight - st::topBarBack.height()) / 2, width());
p.setFont(st::topBarButton.font);
p.setFont(st::topBarButton.style.font);
p.setPen(st::topBarButton.textFg);
p.drawTextLeft(st::topBarArrowPadding.left(), st::topBarButton.padding.top() + st::topBarButton.textTop, width(), _text);
}

View File

@@ -531,7 +531,7 @@ filterInviteBox: Box(defaultBox) {
button: RoundButton(defaultActiveButton) {
height: 42px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
}
}
filterInviteButtonStyle: TextStyle(defaultTextStyle) {

View File

@@ -1429,7 +1429,7 @@ not_null<Ui::RoundButton*> CreateLockedButton(
const auto labelSt = result->lifetime().make_state<style::FlatLabel>(
st::defaultFlatLabel);
labelSt->style.font = st.font;
labelSt->style.font = st.style.font;
labelSt->textFg = st.textFg;
const auto label = Ui::CreateChild<Ui::FlatLabel>(

View File

@@ -68,7 +68,9 @@ statisticsHeaderButton: RoundButton(defaultLightButton) {
width: -14px;
height: 20px;
textTop: 2px;
font: font(11px semibold);
style: TextStyle(semiboldTextStyle) {
font: font(11px semibold);
}
}
statisticsLoadingSubtext: FlatLabel(changePhoneDescription) {

View File

@@ -276,7 +276,7 @@ void Panel::Button::paintEvent(QPaintEvent *e) {
paintRipple(p, rect().topLeft(), &ripple);
}
p.setFont(_st.font);
p.setFont(_st.style.font);
const auto height = rect().height();
const auto progress = st::paymentsLoading.size;

View File

@@ -396,7 +396,7 @@ object_ptr<RoundButton> FilterLinkProcessButton(
const auto label = result->lifetime().make_state<Label>(result.data());
label->setAttribute(Qt::WA_TransparentForMouseEvents);
result->sizeValue() | rpl::start_with_next([=](QSize size) {
const auto xskip = st->font->spacew;
const auto xskip = st->style.font->spacew;
const auto yskip = xskip / 2;
label->setGeometry(QRect(QPoint(), size).marginsRemoved(
{ xskip, yskip, xskip, yskip }));

View File

@@ -97,7 +97,7 @@ premiumPreviewBox: Box(defaultBox) {
button: RoundButton(defaultActiveButton) {
height: 44px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
}
}
premiumPreviewDoubledLimitsBox: Box(premiumPreviewBox) {
@@ -295,7 +295,7 @@ boostBox: Box(premiumPreviewDoubledLimitsBox) {
button: RoundButton(defaultActiveButton) {
height: 42px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
}
}
@@ -323,7 +323,7 @@ showOrShowButton: RoundButton(defaultActiveButton) {
width: 308px;
height: 42px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
}
showOrLabel: FlatLabel(boostText) {
textFg: windowSubTextFg;
@@ -372,7 +372,7 @@ paidReactBox: Box(boostBox) {
button: RoundButton(defaultActiveButton) {
height: 42px;
textTop: 12px;
font: font(13px semibold);
style: semiboldTextStyle;
}
}
paidReactBubbleIcon: icon{{ "settings/premium/star", premiumButtonFg }};

View File

@@ -1,8 +1,8 @@
{%- set GIT = "https://github.com" -%}
{%- set GIT_FREEDESKTOP = GIT ~ "/gitlab-freedesktop-mirrors" -%}
{%- set GIT_UPDATE_M4 = "git submodule set-url m4 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 && git config -f .gitmodules submodule.m4.shallow true && git submodule init && git submodule update" -%}
{%- set QT = "6.7.2" -%}
{%- set QT_TAG = "v" ~ QT -%}
{%- set QT = "6.8.0" -%}
{%- set QT_TAG = "v" ~ QT ~ "-beta4" -%}
{%- set CFLAGS_DEBUG = "$CFLAGS -O0 -fno-lto -U_FORTIFY_SOURCE" -%}
{%- set LibrariesPath = "/usr/src/Libraries" -%}
@@ -42,7 +42,7 @@ FROM builder AS patches
RUN git init patches \
&& cd patches \
&& git remote add origin {{ GIT }}/desktop-app/patches.git \
&& git fetch --depth=1 origin 85a1c4ec327ed390a27e85f2162c31525220a50d \
&& git fetch --depth=1 origin 5361159037f844567cfffbd98c90d48d052fb5d0 \
&& git reset --hard FETCH_HEAD \
&& rm -rf .git
@@ -726,24 +726,18 @@ RUN git clone -b {{ QT_TAG }} --depth=1 {{ GIT }}/qt/qt5.git \
&& cd ../qtwayland \
&& find ../../patches/qtwayland_{{ QT }} -type f -print0 | sort -z | xargs -r0 git apply \
&& cd .. \
&& ./configure \
CMAKE_BUILD_TYPE=None \
-opensource \
-confirm-license \
-qt-libpng \
-qt-harfbuzz \
-qt-pcre \
-no-icu \
INPUT_forkfd_pidfd=no \
-no-feature-xcb-sm \
-static \
-dbus-runtime \
-openssl-linked \
-system-webp \
-nomake examples \
-nomake tests \
&& cmake --build . --parallel \
&& DESTDIR="{{ LibrariesPath }}/qt-cache" cmake --install . \
&& cmake -GNinja -B build . \
-DCMAKE_BUILD_TYPE=None \
-DBUILD_SHARED_LIBS=OFF \
-DINPUT_libpng=qt \
-DINPUT_harfbuzz=qt \
-DINPUT_pcre=qt \
-DFEATURE_icu=OFF \
-DFEATURE_xcb_sm=OFF \
-DINPUT_dbus=runtime \
-DINPUT_openssl=linked \
&& cmake --build build --parallel \
&& DESTDIR="{{ LibrariesPath }}/qt-cache" cmake --install build \
&& cd .. \
&& rm -rf qt5

View File

@@ -457,7 +457,7 @@ if customRunCommand:
stage('patches', """
git clone https://github.com/desktop-app/patches.git
cd patches
git checkout 85a1c4ec32
git checkout ac72a4f597
""")
stage('msys64', """
@@ -1620,7 +1620,7 @@ mac:
make install
""")
else: # qt > '6'
branch = 'v$QT' + ('-lts-lgpl' if qt < '6.3' else '')
branch = 'v$QT' + ('-lts-lgpl' if qt < '6.3' else '-beta4')
stage('qt_' + qt, """
git clone -b """ + branch + """ https://github.com/qt/qt5.git qt_$QT
cd qt_$QT

View File

@@ -6,10 +6,10 @@ def resolve(arch):
elif sys.platform == 'win32':
if arch == 'arm' or 'qt6' in sys.argv:
print('Choosing Qt 6.')
os.environ['QT'] = '6.7.2'
os.environ['QT'] = '6.8.0'
elif os.environ.get('QT') is None:
print('Choosing Qt 5.')
os.environ['QT'] = '5.15.13'
os.environ['QT'] = '5.15.15'
elif os.environ.get('QT') is None:
return False
print('Choosing Qt ' + os.environ.get('QT'))

View File

@@ -1,7 +1,7 @@
AppVersion 5004003
AppVersion 5004005
AppVersionStrMajor 5.4
AppVersionStrSmall 5.4.3
AppVersionStr 5.4.3
AppVersionStrSmall 5.4.5
AppVersionStr 5.4.5
BetaChannel 1
AlphaVersion 0
AppVersionOriginal 5.4.3.beta
AppVersionOriginal 5.4.5.beta

View File

@@ -1,3 +1,12 @@
5.4.5 beta (31.08.24)
- Fix possible crash in text rendering.
5.4.4 beta (29.08.24)
- Fix wrong layout and crashes in text shaping.
- Fix crashes in voice / video messages playback.
5.4.3 beta (29.08.24)
- Fix working on Windows 7.

2
cmake

Submodule cmake updated: af43537447...ed508c3cdc

View File

@@ -166,7 +166,7 @@ parts:
patches:
source: https://github.com/desktop-app/patches.git
source-depth: 1
source-commit: 85a1c4ec327ed390a27e85f2162c31525220a50d
source-commit: 5361159037f844567cfffbd98c90d48d052fb5d0
plugin: dump
override-pull: |
craftctl default
@@ -379,9 +379,9 @@ parts:
- mesa-vulkan-drivers
- xkb-data
override-pull: |
QT=6.7.2
QT=6.8.0
git clone -b v${QT} --depth=1 https://github.com/qt/qt5.git .
git clone -b v${QT}-beta4 --depth=1 https://github.com/qt/qt5.git .
git submodule update --init --recursive --depth=1 qtbase qtdeclarative qtwayland qtimageformats qtsvg qtshadertools
cd qtbase
@@ -390,17 +390,12 @@ parts:
find $CRAFT_STAGE/patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ..
override-build: |
./configure \
-prefix /usr \
-libdir /usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR \
-release \
-opensource \
-confirm-license \
-openssl-linked \
-nomake examples \
-nomake tests \
-- \
-DCMAKE_PREFIX_PATH=$CRAFT_STAGE/usr
cmake -GNinja -B $CRAFT_PART_BUILD \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_PREFIX_PATH=$CRAFT_STAGE/usr \
-DINSTALL_LIBDIR=/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR \
-DINPUT_openssl=linked
cmake --build . -j$CRAFT_PARALLEL_BUILD_COUNT
DESTDIR="$CRAFT_PART_INSTALL" cmake --install .